MotherDuck
An MCP server for MotherDuck and local DuckDB.
motherduckdb
Tools
initialize-connection
Create a connection to either a local DuckDB or MotherDuck and retrieve available databases
read-schemas
Get table schemas from a specific DuckDB/MotherDuck database
execute-query
Execute a query on the MotherDuck (DuckDB) database
README
MotherDuck MCP Server
An MCP server implementation that integrates MotherDuck and local DuckDB, providing SQL analytics capabilities to Claude.
Features
- Hybrid execution: query data from both cloud-based MotherDuck and local DuckDB
- Cloud storage integration: access data stored in Amazon S3 or other cloud storage thanks to MotherDuck's integrations
- Data sharing: create and share databases
- SQL analytics: use DuckDB's SQL dialect to query any size of data directly from Claude
- Serverless architecture: run analytics without needing to configure instances or clusters
Components
Prompts
The server provides one prompt:
duckdb-motherduck-initial-prompt
: A prompt to initialize a connection to DuckDB or MotherDuck and start working with it
Tools
The server offers one tool:
query
: Execute a SQL query on the MotherDuck/DuckDB database- Inputs:
query
(string, required): The SQL query to execute
- Inputs:
All interactions with both DuckDB and MotherDuck are done through writing SQL queries.
Getting Started
Prerequisites
- A MotherDuck account (sign up at motherduck.com)
- A MotherDuck access token
uv
installed, you can install it usingpip install uv
orbrew install uv
If you plan to use MotherDuck MCP with Claude Desktop, you will also need Claude Desktop installed.
Setting up your MotherDuck token
- Sign up for a MotherDuck account
- Generate an access token via the MotherDuck UI
- Store the token securely for use in the configuration
Usage with VS Code
- For the quickest installation, click one of the "Install with UV" buttons at the top of this README.
Manual Installation
Add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P
and typing Preferences: Open User Settings (JSON)
.
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "motherduck_token",
"description": "MotherDuck Token",
"password": true
}
],
"servers": {
"motherduck": {
"command": "uvx",
"args": [
"mcp-server-motherduck",
"--db-path",
"md:",
"--motherduck-token",
"${input:motherduck_token}"
]
}
}
}
}
Optionally, you can add it to a file called .vscode/mcp.json
in your workspace. This will allow you to share the configuration with others.
{
"inputs": [
{
"type": "promptString",
"id": "motherduck_token",
"description": "MotherDuck Token",
"password": true
}
],
"servers": {
"motherduck": {
"command": "uvx",
"args": [
"mcp-server-motherduck",
"--db-path",
"md:",
"--motherduck-token",
"${input:motherduck_token}"
]
}
}
}
Usage with Claude Desktop
-
Install Claude Desktop from claude.ai/download if you haven't already
-
Open the Claude Desktop configuration file:
- To quickly access it or create it the first time, open the Claude Desktop app, select Settings, and click on the "Developer" tab, finally click on the "Edit Config" button.
- Add the following configuration to your
claude_desktop_config.json
:
{
"mcpServers": {
"mcp-server-motherduck": {
"command": "uvx",
"args": [
"mcp-server-motherduck",
"--db-path",
"md:",
"--motherduck-token",
"<YOUR_MOTHERDUCK_TOKEN_HERE>"
],
}
}
}
Important Notes:
- Replace
YOUR_MOTHERDUCK_TOKEN_HERE
with your actual MotherDuck token - Replace
YOUR_HOME_FOLDER_PATH
with the path to your home directory (needed by DuckDB for file operations). For example, on macOS, it would be/Users/your_username
- The
HOME
environment variable is required for DuckDB to function properly.
Example Queries
Once configured, you can ask Claude to run queries like:
- "Create a new database and table in MotherDuck"
- "Query data from my local CSV file"
- "Join data from my local DuckDB database with a table in MotherDuck"
- "Analyze data stored in Amazon S3"
Testing
The server is designed to be run by tools like Claude Desktop and Cursor, but you can start it manually for testing purposes. When testing the server manually, you can specify which database to connect to using the --db-path
parameter:
-
Default MotherDuck database:
- To connect to the default MotherDuck database, you will need to pass the auth token using the
--motherduck-token
parameter.
uvx mcp-server-motherduck --db-path md: --motherduck-token <your_motherduck_token>
- To connect to the default MotherDuck database, you will need to pass the auth token using the
-
Specific MotherDuck database:
uvx mcp-server-motherduck --db-path md:your_database_name --motherduck-token <your_motherduck_token>
-
Local DuckDB database:
uvx mcp-server-motherduck --db-path /path/to/your/local.db
-
In-memory database:
uvx mcp-server-motherduck --db-path :memory:
If you don't specify a database path but have set the motherduck_token
environment variable, the server will automatically connect to the default MotherDuck database (md:
).
Running in SSE mode
The server could also be run ing SSE mode using supergateway
by running the following command:
npx -y supergateway --stdio "uvx mcp-server-motherduck --db-path md: --motherduck-token <your_motherduck_token>"
And you can point your clients such as Claude Desktop, Cursor to this endpoint.
Troubleshooting
- If you encounter connection issues, verify your MotherDuck token is correct
- For local file access problems, ensure the
--home-dir
parameter is set correctly - Check that the
uvx
command is available in your PATH - If you encounter
spawn uvx ENOENT
errors, try specifying the full path touvx
(output ofwhich uvx
) - In version previous for v0.4.0 we used environment variables, now we use parameters
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Recommended Servers

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
AIO-MCP Server
🚀 All-in-one MCP server with AI search, RAG, and multi-service integrations (GitLab/Jira/Confluence/YouTube) for AI-enhanced development workflows. Folk from
Persistent Knowledge Graph
An implementation of persistent memory for Claude using a local knowledge graph, allowing the AI to remember information about users across conversations with customizable storage location.
Hyperbrowser MCP Server
Welcome to Hyperbrowser, the Internet for AI. Hyperbrowser is the next-generation platform empowering AI agents and enabling effortless, scalable browser automation. Built specifically for AI developers, it eliminates the headaches of local infrastructure and performance bottlenecks, allowing you to

Any OpenAI Compatible API Integrations
Integrate Claude with Any OpenAI SDK Compatible Chat Completion API - OpenAI, Perplexity, Groq, xAI, PyroPrompts and more.
Exa MCP
A Model Context Protocol server that enables AI assistants like Claude to perform real-time web searches using the Exa AI Search API in a safe and controlled manner.
BigQuery
This is a server that lets your LLMs (like Claude) talk directly to your BigQuery data! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently.
Web Research Server
A Model Context Protocol server that enables Claude to perform web research by integrating Google search, extracting webpage content, and capturing screenshots.