Fast analytics and data processing with DuckDB and MotherDuck
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
SQL analytics and data engineering for AI Assistants and IDEs.
Connect AI assistants to your data using DuckDB's powerful analytical SQL engine. Supports connecting to local DuckDB files, in-memory databases, S3-hosted databases, and MotherDuck. Allows executing SQL read- and write-queries, browsing database catalogs, and switching between different database connections on-the-fly.
Looking for a fully-managed remote MCP server for MotherDuck? β Go to the MotherDuck Remote MCP docs
| Remote MCP | Local MCP (this repo) | |
|---|---|---|
| Hosting | Hosted by MotherDuck | Runs locally/self-hosted |
| Setup | Zero-setup | Requires local installation |
| Access | Read-write supported | Read-write supported |
| Local filesystem | - | Query across local and remote databases, ingest data from / export data to local filesystem |
π Migrating from v0.x?
- Read-only by default: The server now runs in read-only mode by default. Add
--read-writeto enable write access. See Securing for Production.- Default database changed:
--db-pathdefault changed frommd:to:memory:. Add--db-path md:explicitly for MotherDuck.- MotherDuck read-only requires read-scaling token: MotherDuck connections in read-only mode require a read-scaling token. Regular tokens require
--read-write.
Prerequisites: Install uv via pip install uv or brew install uv
Full flexibility with no guardrails β read-write access and the ability to switch to any database (local files, S3, or MotherDuck) at runtime.
Connects to a specific DuckDB file in read-only mode. Won't hold on to the file lock, so convenient to use alongside a write connection to the same DuckDB file. You can also connect to remote DuckDB files on S3 using s3://bucket/path.duckdb β see Environment Variables for S3 authentication. If you're considering third-party access to the MCP, see Securing for Production.
See Command Line Parameters for more options, Securing for Production for deployment guidance, and Troubleshooting if you encounter issues.
| Client | Config Location | One-Click Install |
|---|---|---|
| Claude Desktop | Settings β Developer β Edit Config | .mcpb (MCP Bundle) |
| Claude Code | Use CLI commands below | - |
| Codex CLI | Use CLI commands below or ~/.codex/config.toml | - |
| Gemini CLI | Use CLI commands below or ~/.gemini/settings.json | - |
| Cursor | Settings β MCP β Add new global MCP server | |
| VS Code | Ctrl+Shift+P β "Preferences: Open User Settings (JSON)" | |
| Kiro | ~/.kiro/settings/mcp.json (global) or .kiro/settings/mcp.json (project) |
Any MCP-compatible client can use this server. Add the JSON configuration from Quick Start to your client's MCP config file. Consult your client's documentation for the config file location.
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
Add the following to your Kiro MCP config file (~/.kiro/settings/mcp.json for global, or .kiro/settings/mcp.json for project-scoped). See the Kiro MCP documentation for more details.
In-Memory DuckDB (Dev Mode):
MotherDuck (Read-Write):
| Tool | Description | Required Inputs | Optional Inputs |
|---|---|---|---|
execute_query | Execute SQL query (DuckDB dialect) | sql | - |
list_databases | List all databases (useful for MotherDuck or multiple attached DBs) | - | - |
list_tables | List tables and views | - | database, schema |
list_columns | List columns of a table/view | table | database, schema |
switch_database_connection* | Switch to different database | path | create_if_not_exists |
*Requires --allow-switch-databases flag
All tools return JSON. Results are limited to 1024 rows / 50,000 chars by default (configurable via --max-rows, --max-chars).
When giving third parties access to a self-hosted MCP server, read-only mode alone is not sufficient β it still allows access to the local filesystem, changing DuckDB settings, and other potentially sensitive operations.
For production deployments with third-party access, we recommend MotherDuck Remote MCP β zero-setup, read-write capable, and hosted by MotherDuck.
Self-hosting MotherDuck MCP: Fork this repo and customize as needed. Use a service account with read-scaling tokens and enable SaaS mode to restrict local file access.
Self-hosting DuckDB MCP: Use --init-sql to apply security settings. See the Securing DuckDB guide for available options.
Build and run the server with Streamable HTTP on port 8000 (defaults to an in-memory DuckDB):
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-server-motherduck)<a href="https://allmcps.com/mcp/mcp-server-motherduck"><img src="https://allmcps.com/api/badge/mcp-server-motherduck?style=directory" alt="MCP Server Motherduck on AllMCPs" /></a>