We Built a Machine for Getting AnswersTry the MotherDuck MCP

Skip to main content

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.

  1. Go to SettingsConnectors
  2. Click Add Custom Connector
  3. Enter the following:
    • Name: MotherDuck
    • URL: https://api.motherduck.com/mcp
  4. Click Add, then click Connect next to the MotherDuck connector and authenticate with your MotherDuck account

Claude MCP Documentation

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:

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