MotherDuck MCP Server
The MotherDuck MCP Server enables AI assistants to query and explore your MotherDuck databases using the Model Context Protocol (MCP). Connect your favorite AI agent to explore schemas, run SQL queries, and ask documentation questions with natural language.
Quick Start
Select your MCP client and follow the instructions to connect to the MotherDuck MCP server.
- Claude
- ChatGPT
- Cursor
- Claude Code
- Others
- Go to Settings → Connectors
- Click Add Custom Connector
- Enter the following:
- Name:
MotherDuck - URL:
https://api.motherduck.com/mcp
- Name:
- Click Add, then click Connect next to the MotherDuck connector and authenticate with your MotherDuck account
- Go to ChatGPT Settings → Connectors
- Click Create App
- Enter the following:
- Name:
MotherDuck - MCP Server URL:
https://api.motherduck.com/mcp
- Name:
- Click Create and authenticate with your MotherDuck account
- Open Cursor Settings (
Cmd/Ctrl + ,) - Navigate to Tools & MCP
- Click + New MCP Server
- Add the following to the configuration file:
{
"MotherDuck": {
"url": "https://api.motherduck.com/mcp",
"type": "http"
}
}
- Save and click Connect to authenticate with your MotherDuck account
- Run the following command in your terminal:
claude mcp add MotherDuck --transport http https://api.motherduck.com/mcp
- Run
claudeto start Claude Code - Type
/mcp, select MotherDuck from the list, and press Enter - Select Authenticate and confirm the authorization dialog
If you're using Windsurf, Zed, or another MCP-compatible client, use the following JSON configuration:
{
"mcpServers": {
"MotherDuck": {
"url": "https://api.motherduck.com/mcp",
"type": "http"
}
}
}
Authentication: The MCP server supports OAuth authentication. When you add the server to your AI client, you'll be redirected to authenticate with your MotherDuck account. The server uses your MotherDuck credentials to access your databases with the same permissions as your account.
Some clients also support simple authentication - in that case, you can provide your MotherDuck access token as a Bearer header.
Server Capabilities
With the MCP server, your agent can:
- Execute read-only SQL queries against your databases
- Explore database schemas, tables, and columns
- Attach and detach shares that have been shared with you
- Ask questions about DuckDB and MotherDuck documentation
Example prompts:
- "Analyze monthly revenue trends and identify our fastest-growing product categories"
- "Compare customer retention rates across different acquisition channels"
- "Build a cohort analysis showing user engagement over their first 90 days"
For clients that support MCP instructions, the server provides detailed query guidelines to help AI assistants write effective DuckDB SQL.
Learn more about using the MotherDuck MCP Server.
Available Tools
The MCP server provides the following tools for AI assistants:
📄️ list_databases
List all databases in your MotherDuck account
📄️ list_shares
List database shares that have been shared with you
📄️ list_tables
List tables and views in a MotherDuck database
📄️ list_columns
List columns of a table or view with types and comments
📄️ search_catalog
Fuzzy search across databases, schemas, tables, columns, and shares
📄️ query
Execute read-only SQL queries against MotherDuck databases
📄️ ask_docs_question
Ask questions about DuckDB or MotherDuck documentation
Regional Availability
The MotherDuck MCP server is available in all MotherDuck regions. Requests are routed to the MCP server closest to where the client runs:
- Desktop clients (Cursor, Claude Code): Routed based on your physical location
- Web-based agents (Claude.ai, ChatGPT): Routed based on the agent provider's server location
Your data is always processed in your MotherDuck organization's region. However, query results transit through the MCP server. If you have strict data residency requirements, ensure your MCP client runs within your region.
Self-Hosted MCP Server
For local DuckDB databases or self-hosted scenarios, MotherDuck maintains an open-source MCP server that you can run locally.
📦 mcp-server-motherduck - Open-source MCP server for DuckDB and MotherDuck
The self-hosted server supports:
- Read-write operations on local and cloud databases
- Local DuckDB databases (no cloud connection required)
- MotherDuck cloud databases with your access token
- Custom configurations and security settings
Related Resources
- MCP User Guide - Tips and workflows for using the MotherDuck MCP Server
- Building Analytics Agents - Guide to building AI agents with MotherDuck
- MCP Specification (2025-06-18) - Official protocol documentation