MotherDuck
SQL analytics and data engineering for AI Assistants and IDEs
What is MotherDuck?
MotherDuck is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to sql analytics and data engineering for ai assistants and ides
SQL analytics and data engineering for AI Assistants and IDEs
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- SQL analytics and data engineering for AI Assistants and IDE
Use Cases
Maintainer
Works with
Installation
NPM
npx -y mcp-server-motherduckPIP
pip install mcp-server-motherduckManual Installation
npx -y mcp-server-motherduckConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MotherDuck
The MotherDuck MCP server connects AI assistants and coding tools directly to DuckDB and MotherDuck's cloud analytics platform, exposing SQL execution and schema inspection as first-class MCP tools. It lets you query in-memory databases, local DuckDB files, cloud MotherDuck databases, and S3-hosted data without leaving your AI workflow. Data engineers and analysts use it to run ad-hoc SQL analytics, explore schemas, and prototype data pipelines through natural-language prompts in Claude, Cursor, VS Code, or any MCP-compatible IDE.
Prerequisites
- Python 3.10+ and uv or pip installed (uvx is the recommended runner)
- A MotherDuck account and token if connecting to cloud databases (free tier available at motherduck.com)
- AWS credentials if querying databases hosted on S3
- An MCP-compatible client such as Claude Desktop, Cursor, or VS Code Copilot
Install the server package
Install mcp-server-motherduck using pip or uv. The uvx runner can also execute it directly without a persistent install.
pip install mcp-server-motherduck
# Or run without installing:
uvx mcp-server-motherduck --db-path :memory:Set your MotherDuck token (if using cloud)
Export your MotherDuck authentication token as an environment variable. You can find this token in the MotherDuck console under Settings → Access Tokens. Skip this step if using only local DuckDB files.
export motherduck_token=your_motherduck_token_hereAdd the server to Claude Code CLI
Use the Claude Code CLI to register the MCP server for your user. Adjust --db-path to point at a local file, md: for MotherDuck, or an S3 URL.
claude mcp add --scope user duckdb --transport stdio -- uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databasesConfigure Claude Desktop manually
Alternatively, add the server directly to your Claude Desktop configuration file. Enable --read-write only if you need write operations; omit it for read-only analytics.
Verify the connection
Once configured, open your MCP client and ask it to list available databases or run a simple test query to confirm the server is responding correctly.
MotherDuck Examples
Client configuration
Claude Desktop configuration for connecting to an in-memory DuckDB instance with read-write access. Replace :memory: with a file path or md: for MotherDuck cloud.
{
"mcpServers": {
"DuckDB": {
"command": "uvx",
"args": [
"mcp-server-motherduck",
"--db-path", ":memory:",
"--read-write",
"--allow-switch-databases"
],
"env": {
"motherduck_token": "your_motherduck_token_here"
}
}
}
}Prompts to try
Use these prompts with your connected AI assistant to run SQL analytics through the MCP server.
- "List all tables in my database"
- "Run a SQL query to find the top 10 rows in the sales table ordered by revenue"
- "What columns does the customers table have?"
- "Switch to my MotherDuck database named analytics and show me its tables"
- "Create a summary table of monthly revenue from the orders table"Troubleshooting MotherDuck
Authentication error when connecting to MotherDuck cloud
Ensure the motherduck_token environment variable is set correctly. You can also pass it directly via --motherduck-token flag. Retrieve your token from the MotherDuck console under Settings → Access Tokens.
Write queries fail even though --read-write is set
Confirm the --read-write flag is included in your args array and that your MotherDuck token has write permissions for the target database.
S3 database access returns permission errors
Set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION environment variables. For temporary credentials also set AWS_SESSION_TOKEN.
Frequently Asked Questions about MotherDuck
What is MotherDuck?
MotherDuck is a Model Context Protocol (MCP) server that sql analytics and data engineering for ai assistants and ides It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MotherDuck?
Install via npm with the command: npx -y mcp-server-motherduck. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with MotherDuck?
MotherDuck works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MotherDuck free to use?
Yes, MotherDuck is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
MotherDuck Alternatives — Similar Databases Servers
Looking for alternatives to MotherDuck? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MotherDuck in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MotherDuck?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.