DuckDB / MotherDuck MCP Server
DuckDB / MotherDuck Local MCP Server
An MCP server for SQL analytics on DuckDB: local files, in-memory databases, S3-hosted databases and MotherDuck
Install
claude mcp add --scope user duckdb --transport stdio -- uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databasesIn-memory database with writes and database switching.
This is third-party code. Review the repository files before installing.
What it does
The server gives an agent DuckDB's analytical SQL engine. The agent runs DuckDB-dialect queries, lists databases, tables and columns, and with a flag switches databases on the fly. It connects to an in-memory database, a DuckDB file on disk, a file on S3 or cloud MotherDuck. It is read-only by default, --read-write enables writes, and results are capped by rows and characters.
Who it is for. For analysts and data engineers who want to explore CSV, Parquet and DuckDB databases through an agent.
Good fit when
- You need quick numbers from local CSV or Parquet without standing up a database
- You want the agent to access data in MotherDuck
- You are debugging a DuckDB data pipeline with an agent
Not a fit when
- Third parties need access: read-only mode still exposes the filesystem
- Your data lives in PostgreSQL or ClickHouse and should stay there
Example request
Load sales.csv from this folder and compute revenue by monthLimitations
Requires uv. MotherDuck needs a token, and read-only mode needs a read-scaling token. Read-only mode does not block access to the local filesystem or DuckDB settings; for outside users the authors recommend MotherDuck's remote MCP. Local files need no external services; MotherDuck availability from Russia is unverified.
How to disable. Run claude mcp remove duckdb or remove the server block from your client config.
MCP
- Transport
- stdio, http
- Authentication
- not required
| Environment variables | |
|---|---|
| motherduck_token secret | MotherDuck token, needed only for md: |
| AWS_ACCESS_KEY_ID secret | Access key for S3 databases |
| AWS_SECRET_ACCESS_KEY secret | Secret key for S3 databases |
Security check
- Runs SQL with access to the local filesystem
- Can modify and delete data in read-write mode
README in short
The README compares the local server with MotherDuck's remote MCP and gives three configs: in-memory, a read-only local file and read-write MotherDuck. It includes commands for Claude Code, Codex and Gemini CLI, an MCPB bundle for Claude Desktop and install buttons for Cursor, VS Code and Kiro. It covers tools, Docker over HTTP, CLI flags and security advice. MIT licensed.
FAQ
How does this differ from MotherDuck's remote MCP?
The remote one is hosted by MotherDuck and needs no install but cannot see local files. This server runs on your machine and can read and export data on disk.
What changed after 0.x?
The server became read-only by default, and the default database changed from MotherDuck to in-memory.
Related
166 skills for scientific work: bioinformatics, cheminformatics, clinical data, geospatial analysis and 100+ databases
Google's open-source MCP server for databases: ready tools for Postgres, MySQL, BigQuery, Spanner and more, plus custom tools in tools.yaml
A token-lean MCP server for PostgreSQL, MySQL, MariaDB, SQL Server and SQLite with a read-only mode
Official MongoDB MCP server: queries and aggregations, index management, Atlas clusters and local deployments