MotherDuck is an MCP server that connects AI assistants and development environments to local DuckDB instances, in-memory databases, S3-hosted DuckDB files, and MotherDuck cloud data warehouses. Designed for data analysts, data engineers, and developers, this server enables AI models to interact directly with analytical datasets using standard DuckDB SQL dialect. Users can execute analytical SQL queries for both read and optional write operations, inspect database catalogs, explore schemas, and list table definitions or column types. The server allows switching across multiple database connections on the fly, enabling users to bridge local data exploration with cloud-scale analytics in MotherDuck. Output size controls such as row limits and character caps ensure that data returned to the language model stays within prompt token budgets. By exposing database introspection tools, it allows assistants to autonomously construct queries based on accurate schema definitions, ingest or export local file formats, and run complex aggregations across persistent files or transient in-memory tables.
Category: Data & Analytics
Tags: analytics, data-warehousing, duckdb, motherduck, SQL
uv is installed on your system using pip install uv or brew install uv. 2. In Claude Desktop, open Settings > Developer > Edit Config to edit your configuration JSON file. 3. Add the server entry using uvx mcp-server-motherduck. For an in-memory DuckDB instance with read-write access, use: json { "mcpServers": { "duckdb": { "command": "uvx", "args": ["mcp-server-motherduck", "--db-path", ":memory:", "--read-write", "--allow-switch-databases"] } } } 4. To connect to MotherDuck cloud storage, pass --db-path md: in the args array, specify --read-write, and set the motherduck_token environment variable inside the env object. 5. If using Claude Code CLI, add the server directly by running: claude mcp add --scope user duckdb --transport stdio -- uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databases.duckdb files in read-only mode to prevent file locking during concurrent analytical workloads. - Developing with transient in-memory datasets: Spin up temporary in-memory DuckDB instances to test SQL queries, create transient staging tables, and validate transformations via AI prompts. - Cloud data warehousing with MotherDuck: Execute cloud analytics across distributed datasets by connecting to MotherDuck databases using authentication tokens and inspecting remote catalogs. - Catalog and schema exploration: Allow AI assistants to examine schemas, discover tables, and check column data types before generating accurate SQL queries. - Querying remote S3 data files: Connect directly to remote DuckDB files stored in Amazon S3 buckets to run analytical queries without manual local downloads.Part of MCP Servers
You can run MotherDuck MCP without manual cloning using the uv package manager. First, install uv with brew or pip. Then, configure your MCP client such as Claude Desktop, Cursor, or VS Code by pointing the command to uvx mcp-server-motherduck. Pass parameters like db-path to select between in-memory DuckDB, a local file path, or MotherDuck cloud databases.
The server provides tools to execute DuckDB SQL queries, list available databases, inspect database schemas, and list table columns. It supports running analytical queries on local DuckDB files, in-memory databases, S3 buckets, and MotherDuck cloud warehouses. Additionally, when enabled, it provides tools to switch active database connections dynamically during conversational AI sessions.
The server works with any MCP-compliant client. Supported clients documented by the project include Claude Desktop, Claude Code CLI, Cursor, VS Code, Codex CLI, Gemini CLI, and Kiro. You can configure it either via standard JSON configuration files or using dedicated CLI integration commands provided by tools like Claude Code and Gemini CLI.
To connect directly to the MotherDuck cloud service, set the database path parameter to md: using the db-path md: flag. You must also supply your MotherDuck authentication token through the motherduck_token environment variable in your MCP client configuration, along with the read-write flag for standard tokens.