# MotherDuck Documentation - How-To Guides > Scoped MotherDuck documentation index for How-To Guides. Use this before the root index when the user's question is clearly about this area. - [Full scoped context](https://motherduck.com/docs/key-tasks/llms-full.txt): Complete Markdown content for How-To Guides. - [Root documentation index](https://motherduck.com/docs/llms.txt): All MotherDuck documentation sections. ## Pages - [Connect to the MotherDuck MCP Server](https://motherduck.com/docs/key-tasks/ai-and-motherduck/mcp-setup): Set up the MotherDuck MCP Server with Claude, ChatGPT, Cursor, Claude Code, and other AI assistants - Sections: Prerequisites, Set up the remote MCP server, Configuring tool permissions, Remote vs local MCP server, Where to go from here - [Loading Data Best Practices](https://motherduck.com/docs/key-tasks/loading-data-into-motherduck/considerations-for-loading-data): Understanding trade-offs and performance implications when loading data into MotherDuck - Sections: File format considerations, Avoid single-row INSERTs, Performance optimization strategies, Duckling sizing, Summary - [From Your Local Machine](https://motherduck.com/docs/key-tasks/loading-data-into-motherduck/loading-data-from-local-machine): Moving data from local to MotherDuck through the UI or programmatically. - Sections: Single file, Multiple files or database - [Authenticating to MotherDuck](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck): Authenticate to a MotherDuck account - Sections: Manual authentication, Authentication using an access token, Using connection string parameters - [Basics database operations](https://motherduck.com/docs/key-tasks/database-operations/basics-operations): Create, list, and drop MotherDuck databases using SQL commands. - Sections: Create database, Listing databases, Delete database - [Connect via the Postgres endpoint](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint): Connect to MotherDuck using any Postgres-compatible client via the Postgres wire protocol endpoint - Sections: Before you start, Connect with psql, Connect with a URI, Secure your connection, Key things to know, DuckLake databases... - [Create and configure service accounts](https://motherduck.com/docs/key-tasks/service-accounts-guide/create-and-configure-service-accounts): Learn how to create service accounts, create access tokens, and configure Duckling resources. - Sections: Create a service account, Create an access token, Configure Ducklings, Connect as the service account, Related content - [GitHub Actions](https://motherduck.com/docs/key-tasks/data-warehousing/orchestration/github-action-cron): Schedule MotherDuck SQL and dbt jobs with GitHub Actions as a lightweight cron-based orchestrator. - Sections: When to use this pattern, Set up authentication, Choose the trigger, Example: run a SQL file on a schedule, Example: run dbt on a schedule, Production checklist... - [Loading data to MotherDuck with Python](https://motherduck.com/docs/key-tasks/loading-data-into-motherduck/loading-data-md-python): Efficient methods for loading data from Python using DataFrames, temporary files, or bulk inserts. - Sections: 1. load data to MotherDuck with Pandas, Polars, or PyArrow, 2. write to a temporary file and load with COPY, 3. use executemany for small datasets - [PostgreSQL](https://motherduck.com/docs/key-tasks/data-warehousing/replication/postgres): Replicate PostgreSQL tables to MotherDuck using DuckDB and the PostgreSQL extension. - Sections: Loading the PostgreSQL extension and authenticating, Connecting to MotherDuck and inserting the table, Choosing the right PostgreSQL workflow, Best practices, Handling more complex workflows - [Sharing concepts and overview](https://motherduck.com/docs/key-tasks/sharing-data/sharing-overview): MotherDuck data sharing model concepts including read-only shares and scope options. - Sections: Creating a share, Consuming shared data, Updating shared data, Consuming updated data - [Using the MotherDuck MCP Server](https://motherduck.com/docs/key-tasks/ai-and-motherduck/mcp-workflows): Effective workflows and best practices for getting the most out of the MotherDuck MCP Server with AI assistants - Sections: Prerequisites, How it works, Start with schema exploration, Frame questions with context, Iterate, Common workflow patterns... - [Connect from Python via Postgres endpoint](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/python): Connect to MotherDuck from Python using psycopg2 or psycopg3 via the Postgres wire protocol - Sections: Prerequisites, Connect, Loading data from Python, SSL notes - [Connecting to MotherDuck](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/connecting-to-motherduck): Create one or more connections to a MotherDuck database - Sections: Connecting with the DuckDB SDK, Create a connection, Session names, Multiple connections and the database instance cache, Setting custom database instance cache time (TTL), Connect to multiple databases - [Dagster](https://motherduck.com/docs/key-tasks/data-warehousing/orchestration/dagster): Orchestrate an incremental S3-to-MotherDuck data loading pipeline with Dagster and Python. - Sections: How the pipeline works, Prerequisites, Create the Dagster project, Run the ingestion, Run it in Dagster, Production considerations... - [From Cloud Storage or over HTTPS](https://motherduck.com/docs/key-tasks/loading-data-into-motherduck/loading-data-from-cloud-or-https): Load data into MotherDuck from S3, Azure, GCS, or public HTTPS URLs. - Sections: From a secure cloud storage provider, Over HTTPS, Related content - [Impersonate service accounts](https://motherduck.com/docs/key-tasks/service-accounts-guide/impersonate-service-accounts): Use UI impersonation to troubleshoot and inspect resources as a service account. - Sections: Start an impersonation session, Use impersonation for troubleshooting, Use tokens for applications, Related content - [Install MotherDuck Skills for coding agents](https://motherduck.com/docs/key-tasks/ai-and-motherduck/agent-skills): Install the MotherDuck Skills plugin catalog to teach Claude Code, Cursor, Codex, Copilot CLI, and Gemini CLI to work with MotherDuck. - Sections: What agent skills are, Prerequisites, Install, Verify the installation, Prompts to try, How the catalog is organized - [Restricting to read-only access](https://motherduck.com/docs/key-tasks/ai-and-motherduck/securing-read-only-access): Restrict the remote MCP server to read-only queries using client-side blocking, read scaling tokens, or proxy filtering - Sections: Block the query_rw tool at the client, Use a read scaling token, Proxy filtering - [Setting up SSO](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck/sso-setup): Configure Single Sign-On (SSO) for your MotherDuck organization using your identity provider. - Sections: How SSO works, Supported SSO configurations, Prerequisites, Setting up SSO, Just-in-Time (JIT) user provisioning, Managing members... - [Sharing data with your organization](https://motherduck.com/docs/key-tasks/sharing-data/sharing-within-org): Share databases with all members of your MotherDuck organization. - Sections: 1. create an organization-scoped, discoverable share, 2. find and consume shares, 3. update shared data - [SQL Server](https://motherduck.com/docs/key-tasks/data-warehousing/replication/sql-server): Replicate SQL Server tables to MotherDuck using Python and dataframes. - Sections: SQL Server Authentication, Reading a SQL Server table into a dataframe, Inserting the table into MotherDuck, Handling More Complex Workflows - [Specifying different databases](https://motherduck.com/docs/key-tasks/database-operations/specifying-different-databases): Reference tables across databases using fully qualified names with database.schema.table syntax. - [Connect from Java via Postgres endpoint](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/java): Connect to MotherDuck from Java using the PostgreSQL JDBC driver via the Postgres wire protocol - Sections: Prerequisites, Connect, SSL notes - [Creating Visualizations with Dives](https://motherduck.com/docs/key-tasks/ai-and-motherduck/dives): Build interactive visualizations from natural language using AI agents and the MotherDuck MCP Server - Sections: How Dives work, Prerequisites, Creating a Dive, Finding your Dives, Sharing Dives with your team, Sharing the current view... - [Manage service accounts and tokens](https://motherduck.com/docs/key-tasks/service-accounts-guide/manage-service-accounts-and-tokens): Use the MotherDuck UI and REST API to view, delete, and rotate service account tokens. - Sections: Check what each interface supports, View service accounts, View tokens for a service account, Rotate a service account token, Revoke a token, Delete a service account... - [Setting up SCIM provisioning](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck/scim): Automate user lifecycle management in MotherDuck using SCIM with your identity provider. - Sections: How SCIM complements SSO, Prerequisites, Supported operations, Attribute mapping, Enabling SCIM, Managing SCIM after enablement... - [Sharing data with specific users](https://motherduck.com/docs/key-tasks/sharing-data/sharing-with-users): Grant read access to specific users for multi-tenant applications and collaboration. - Sections: Creating a share with restricted access (ACL), Creating hidden shares, Updating shared data - [Switching the current database](https://motherduck.com/docs/key-tasks/database-operations/switching-the-current-database): Change the active database and schema context using USE statements. - [Theming and styling your Dives](https://motherduck.com/docs/key-tasks/ai-and-motherduck/dives/theming-and-styling-dives): Control the visual appearance of your Dives with theme definitions, chart selection, and interactive filters - Sections: How theming works in Dives, Writing a theme prompt, Choosing chart types, Adding interactivity, Laying out a multi-chart Dive, Example: full theme prompt... - [Dive theme gallery](https://motherduck.com/docs/key-tasks/ai-and-motherduck/dives/dive-theme-gallery): Ready-to-use theme prompts for Dives with screenshots showing each style applied to the same dataset - Sections: Tufte Minimal, Ink & Paper, Corporate Dashboard, FT Salmon, Soft Infographic, Du Bois... - [Connect from Node.js via Postgres endpoint](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/nodejs): Connect to MotherDuck from Node.js using the pg (node-postgres) library via the Postgres wire protocol - Sections: Prerequisites, Connect, SSL notes - [Load a DuckDB database into MotherDuck](https://motherduck.com/docs/key-tasks/loading-data-into-motherduck/loading-duckdb-database): Upload a local DuckDB database file to MotherDuck cloud storage. - [Managing Dives as Code](https://motherduck.com/docs/key-tasks/ai-and-motherduck/dives/managing-dives-as-code): Set up a Git-based workflow for developing, previewing, and deploying Dives with GitHub Actions and Claude Code - Sections: Quick start, Prerequisites, Pull a dive for local development, Edit locally with an AI agent, Deploy a preview with GitHub actions, Merge to production... - [Managing shares](https://motherduck.com/docs/key-tasks/sharing-data/managing-shares): View share details, modify permissions, and manage shared database access. - Sections: Getting details about a share, Listing Shares, Deleting a share, Updating a share, Editing/Altering a share - [AI Features in the MotherDuck UI](https://motherduck.com/docs/key-tasks/ai-and-motherduck/ai-features-in-ui): Use AI-powered SQL editing, FixUp, and natural language queries in the MotherDuck web interface. - Sections: Automatically Edit SQL Queries in the MotherDuck UI, Automatically Fix SQL Errors in the MotherDuck UI, Access SQL Assistant functions - [Connect from Cloudflare Workers](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/cloudflare-workers): Query MotherDuck from Cloudflare Workers using the Postgres wire protocol - Sections: Prerequisites, Project setup, Write the Worker, Test locally, Deploy, Using Hyperdrive for connection pooling... - [Custom AI Agent Builder's Guide](https://motherduck.com/docs/key-tasks/ai-and-motherduck/building-analytics-agents): Build AI-powered analytics agents using MotherDuck's SQL functions and MCP server integration. - Sections: Prerequisites, Step 1: Define your agent's interface, Step 2: Give your agent SQL knowledge, General Knowledge, Step 3: Give your agent schema context, Step 4: Configure access controls... - [Embedding Dives in your web application](https://motherduck.com/docs/key-tasks/ai-and-motherduck/dives/embedding-dives): Embed interactive MotherDuck Dives in your web app using iframes and embed sessions - Sections: Prerequisites, How it works, Step 1: Create an embed session, Customize the embed session (optional), Step 2: Embed the iframe, Handle link navigation from embedded Dives... - [Querying Files in Amazon S3](https://motherduck.com/docs/key-tasks/cloud-storage/querying-s3-files): Query Parquet, CSV, and JSON files in S3 with automatic cloud execution routing. - Sections: Accessing private files in S3 - [Updating shares](https://motherduck.com/docs/key-tasks/sharing-data/updating-shares): Learn about data replication timing, checkpoints, and how to ensure your latest data is available in shares and read-only Ducklings. - Sections: Data replication speed, Manual share updates, Refreshing shared data (consumer side) - [Writing Data to Amazon S3](https://motherduck.com/docs/key-tasks/cloud-storage/writing-to-s3): Export data from MotherDuck to Amazon S3 or transform S3 files in place. - Sections: Syntax, Example usage - [Connect from Drizzle via Postgres endpoint](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/drizzle): Use Drizzle as a typed wrapper around the pg driver to query MotherDuck via the Postgres wire protocol - Sections: Prerequisites, Connect, Read scaling and concurrency, What doesn't work, SSL notes - [Multithreading and parallelism](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/multithreading-and-parallelism): Run concurrent queries against MotherDuck, and learn when to use Read Scaling or the Postgres endpoint instead of managing connection pools. - Sections: You probably don't need a connection pool, Run many concurrent read-only queries, Use the Postgres endpoint for connection pooling - [Querying historical data with time travel](https://motherduck.com/docs/key-tasks/database-operations/time-travel): Use MotherDuck snapshots to query past database states, compare data across time periods, debug pipeline issues, reproduce reports, and create audit checkpoints. - Sections: Try it yourself: sample data setup, Core pattern: clone a point-in-time snapshot, Comparing data across time periods, Debugging data pipeline issues, Reproducing past reports, Creating audit checkpoints with named snapshots... - [S3 Import Best Practices](https://motherduck.com/docs/key-tasks/cloud-storage/s3-import-best-practices): Optimize file size, format, and layout in Amazon S3 for fast, cost-effective data loading into MotherDuck. - Sections: Choose the right file format, Optimize file size, Organize your S3 bucket, Set up continuous loading from S3, Use ingestion tools for production pipelines, Colocate data with MotherDuck... - [Running dual execution (or hybrid) queries](https://motherduck.com/docs/key-tasks/running-hybrid-queries): Query local and cloud data together using MotherDuck's dual execution hybrid query engine. - Sections: Create a remote sales table, Join local and remote data, Inspect the hybrid query plan - [Copying DuckDB Databases](https://motherduck.com/docs/key-tasks/database-operations/copying-databases): Duplicate databases between MotherDuck cloud and local DuckDB using COPY FROM DATABASE. - Sections: Syntax, Example Usage - [Flat Files](https://motherduck.com/docs/key-tasks/data-warehousing/replication/flat-files): Load CSV, Parquet, and JSON files into MotherDuck from local storage or cloud sources. - Sections: CSV, JSON, Parquet, Handling more complex workflows - [From a PostgreSQL or MySQL Database](https://motherduck.com/docs/key-tasks/loading-data-into-motherduck/loading-data-from-postgres): Learn to load a table from your PostgreSQL or MySQL database into MotherDuck. - Sections: Using PostgreSQL or MySQL DuckDB extensions, Using MotherDuck ingestion partners - [Detach and re-attach a MotherDuck database](https://motherduck.com/docs/key-tasks/database-operations/detach-and-reattach-motherduck-database): Temporarily disconnect from a MotherDuck database using DETACH and reconnect with ATTACH. - Sections: Creating, detaching, and re-attaching a database, Show All Databases - [Via the Postgres Endpoint](https://motherduck.com/docs/key-tasks/loading-data-into-motherduck/loading-data-via-postgres-endpoint): Best practices for loading data into MotherDuck efficiently when you are connected through the Postgres endpoint. - Sections: Recommended patterns, Use a DuckDB client path instead when, Protected cloud storage, Decision guide, Summary, Related pages - [Build a customer-facing analytics app](https://motherduck.com/docs/key-tasks/customer-facing-analytics): Build customer-facing analytics applications with read scaling tokens and isolated tenant data. - Sections: Customer provisioning, Data modeling and loading, Other considerations - [Excel and Google Sheets](https://motherduck.com/docs/key-tasks/data-warehousing/replication/spreadsheets): Load Excel and Google Sheets data into MotherDuck using the DuckDB CLI or HTTPS CSV export URLs. - Sections: Microsoft Excel, Google Sheets, Handling more complex workflows - [3-tier customer-facing analytics guide](https://motherduck.com/docs/key-tasks/customer-facing-analytics/3-tier-cfa-guide): Step-by-step guide to building a 3-tier customer-facing analytics application with MotherDuck. - Sections: 1. understand the 3-tier CFA architecture, 2. set up your dev environment and organization, 3. create a service account for a customer company, 4. model and load customer data in MotherDuck, 5. run analytics queries from your backend, 6. scaling to many customer companies... - [Attach Modes](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/attach-modes): Understand Workspace and Single attach modes - Sections: MotherDuck attach modes: workspace and single modes - [Authenticating and connecting to MotherDuck](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck): Learn how to authenticate and connect to MotherDuck - [Data Warehousing How-to](https://motherduck.com/docs/key-tasks/data-warehousing): Data Warehousing How-to guides - Sections: Introduction to MotherDuck for data warehousing, MotherDuck basics: concepts to understand before you start, Data ingestion: getting your data in, Data transformation: shaping your data for analysis, Orchestration: automating your data pipelines, Connecting BI tools and data applications... - [Database operations](https://motherduck.com/docs/key-tasks/database-operations): Learn how to work with databases and MotherDuck - [How-to guides](https://motherduck.com/docs/key-tasks/how-to-guides): How-to guides - [Interacting with cloud storage](https://motherduck.com/docs/key-tasks/cloud-storage): Learn how to work with databases and MotherDuck - [Loading Data into MotherDuck](https://motherduck.com/docs/key-tasks/loading-data-into-motherduck): Learn how to load data into MotherDuck from various sources - Sections: Before You Start: Understanding Trade-offs - [Managing organizations](https://motherduck.com/docs/key-tasks/managing-organizations): Learn how to manage your organization with MotherDuck - Sections: Creating an organization, Inviting users to your organization, Joining an existing organization, Roles, Deprovisioning users, Removing users... - [Read Scaling](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/read-scaling): Learn how to scale your data applications using read scaling tokens - Sections: Configuring a read scaling duckling pool, Ensuring data freshness, Best practices - [Service accounts](https://motherduck.com/docs/key-tasks/service-accounts-guide): Learn how to create, configure, manage, and impersonate MotherDuck service accounts. - [Sharing data in MotherDuck](https://motherduck.com/docs/key-tasks/sharing-data): Learn how to securely share data in MotherDuck - [Text Search in MotherDuck](https://motherduck.com/docs/key-tasks/ai-and-motherduck/text-search-in-motherduck): Text search strategies from pattern matching to semantic search with embeddings in MotherDuck. - Sections: Quick Start: Common Search Patterns, Refining Your Search Strategy, Search Methods, Performance Guide, Advanced Methods, Next Steps