Mcp Server Motherduck
io.github.motherduckdbPublished by GitHub account motherduckdbv1.1.0Updated Oct 24, 2026
SQL analytics and data engineering for AI Assistants and IDEs
Overview
Local MCP server that connects an AI assistant to DuckDB and MotherDuck so it can run analytical SQL, browse catalogs and switch databases.
- What you can do
- Run SQL queries against DuckDB or MotherDuck, including read and write statements when enabled, with results returned as JSON and capped by row and character limits by default. Browse database catalogs by listing databases, tables and views, and columns of a table or view. Switch the active database connection to another local file, S3 path or MotherDuck database when the switch flag is enabled. Query across local and remote databases and ingest or export data through the local filesystem.
- When to use it
- Use it when an assistant should analyze data with DuckDB's SQL engine, work with local DuckDB files, in-memory databases or MotherDuck, or run data engineering queries from an IDE or chat client. It is the local option; a hosted MotherDuck remote server exists for zero-setup use.
- Requirements
- Runs locally as a Python package launched with uvx, so uv must be installed. A database path is chosen with a flag: in-memory, an absolute local file, an s3:// URL or md: for MotherDuck. MotherDuck needs a token via the motherduck_token or MOTHERDUCK_TOKEN variable or the token flag; S3 access needs AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and optionally AWS_SESSION_TOKEN, AWS_DEFAULT_REGION and AWS_ENDPOINT. HOME is used by DuckDB for extensions and config.
Installation
In SourceWeft
- Open Mcp Server Motherduck in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
[MotherDuck / DuckDB Local MCP Server]
DuckDB / MotherDuck Local MCP Server
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 vs Local MCP
Quick Start
Prerequisites: Install uv via pip install uv or brew install uv
Connecting to In-Memory DuckDB (Dev Mode)
Full flexibility with no guardrails — read-write access and the ability to switch to any database (local files, S3, or MotherDuck) at runtime.
Connecting to a Local DuckDB File in Read-Only Mode
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.
Connecting to MotherDuck in Read-Write Mode
See Command Line Parameters for more options, Securing for Production for deployment guidance, and Troubleshooting if you encounter issues.
Client Setup
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.
Claude Code CLI commands
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
Codex CLI commands
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
Gemini CLI commands
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
Kiro manual JSON config
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):
Tools
*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).
Securing for Production
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.
Docker
Build and run the server with Streamable HTTP on port 8000 (defaults to an in-memory DuckDB):
Connect to MotherDuck by passing a token and overriding the command:
The MCP endpoint is available at http://localhost:8000/mcp. CLI flags and env vars from below still apply.
Command Line Parameters
Environment Variables
Troubleshooting
spawn uvx ENOENT: Specify full path touvx(runwhich uvxto find it)- File locked: Make sure
--ephemeral-connectionsis turned on (default: true) and that you're not connected in read-write mode
Resources
- MotherDuck MCP Documentation
- Close the Loop: Faster Data Pipelines with MCP, DuckDB & AI (Blog)
- Faster Data Pipelines with MCP and DuckDB (YouTube)
Development
To run from source:
Release Process
- Run the
Release New VersionGitHub Action - Enter version in
MAJOR.MINOR.PATCHformat - The workflow bumps version, publishes to PyPI/MCP registry, and creates the GitHub release with MCPB package
License
MIT License - see LICENSE file.
mcp-name: io.github.motherduckdb/mcp-server-motherduck
Source: README.md at commit 41acb58
Tools
0Version history
2- v1.1.0LatestOct 7, 2026
- v1.0.8Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts