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
{
"mcpServers": {
"DuckDB (in-memory, r/w)": {
"command": "uvx",
"args": ["mcp-server-motherduck", "--db-path", ":memory:", "--read-write", "--allow-switch-databases"]
}
}
}Full flexibility with no guardrails â read-write access and the ability to switch to any database (local files, S3, or MotherDuck) at runtime.
{
"mcpServers": {
"DuckDB (read-only)": {
"command": "uvx",
"args": ["mcp-server-motherduck", "--db-path", "/absolute/path/to/your.duckdb"]
}
}
}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.
{
"mcpServers": {
"MotherDuck (local, r/w)": {
"command": "uvx",
"args": ["mcp-server-motherduck", "--db-path", "md:", "--read-write"],
"env": {
"motherduck_token": "<YOUR_MOTHERDUCK_TOKEN>"
}
}
}
}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)" |
Claude Code CLI commandsIn-Memory DuckDB (Dev Mode): claude mcp add --scope user duckdb --transport stdio -- uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databasesLocal DuckDB (Read-Only): claude mcp add --scope user duckdb --transport stdio -- uvx mcp-server-motherduck --db-path /absolute/path/to/db.duckdbMotherDuck (Read-Write): claude mcp add --scope user motherduck --transport stdio --env motherduck_token=YOUR_TOKEN -- uvx mcp-server-motherduck --db-path md: --read-writeCodex CLI commandsIn-Memory DuckDB (Dev Mode): codex mcp add duckdb -- uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databasesLocal DuckDB (Read-Only): codex mcp add duckdb -- uvx mcp-server-motherduck --db-path /absolute/path/to/db.duckdbMotherDuck (Read-Write): codex mcp add motherduck --env motherduck_token=YOUR_TOKEN -- uvx mcp-server-motherduck --db-path md: --read-writeGemini CLI commandsIn-Memory DuckDB (Dev Mode): gemini mcp add -s user duckdb uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databasesLocal DuckDB (Read-Only): gemini mcp add -s user duckdb uvx mcp-server-motherduck --db-path /absolute/path/to/db.duckdbMotherDuck (Read-Write): gemini mcp add -s user -e motherduck_token=YOUR_TOKEN motherduck uvx mcp-server-motherduck --db-path md: --read-write
*Requires All tools return JSON. Results are limited to 1024 rows / 50,000 chars by default (configurable via 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
To run from source: {
"mcpServers": {
"Local DuckDB (Dev)": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-server-motherduck", "run", "mcp-server-motherduck", "--db-path", "md:"],
"env": {
"motherduck_token": "<YOUR_MOTHERDUCK_TOKEN>"
}
}
}
}
MIT License - see LICENSE file. mcp-name: io.github.motherduckdb/mcp-server-motherduck Release History
Dependencies & License AuditLoading dependencies... Similar PackagesAI-Skillsđ¤ Enhance AI capabilities with modular Skills that provide expert knowledge, workflows, and integrations for any project.main@2026-06-07 telegram-mcpđ¤ Manage multiple Telegram accounts effortlessly with AI-driven tools for bulk messaging, scheduling, and more in one easy-to-use platform.main@2026-06-07 AIDomesticCoreAIJđ ī¸ Build a robust AI Kernel for stable, auditable, and sovereign AI systems, ensuring secure execution and compliance across various domains.main@2026-06-07 refragđ Enhance retrieval with REFRAG, using micro-chunking and fast indexing for optimized RAG systems that improve efficiency and effectiveness.main@2026-06-07 mcp-agent-frameworkđ¤ Orchestrate AI agents at scale using the MCP framework, enabling seamless context sharing, communication, and integration for enhanced collaboration.master@2026-06-07 More in MCP Serversclaude-plugins-officialOfficial, Anthropic-managed directory of high quality Claude Code Plugins. langchain4jLangChain4j is an open-source Java library that simplifies the integration of LLMs into Java applications through a unified API, providing access to popular LLMs and vector databases. It makes impleme hyperframesWrite HTML. Render video. Built for agents. claude-code-guideClaude Code Guide - Setup, Commands, workflows, agents, skills & tips-n-tricks go from beginner to power user! |

