# MotherDuck MCP server


> Connect AI assistants to MotherDuck using the remote (fully managed) or local (fully customizable) MCP server

MotherDuck offers a **remote MCP server** (fully managed, read-write) and a [**local MCP server**](#local-mcp-server) (fully customizable, self-hosted) that let AI assistants query and explore your MotherDuck databases using the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/).

:::info Connection URL
The remote MCP server is hosted at `https://api.motherduck.com/mcp`. Most clients connect through OAuth automatically; clients that need a manual configuration use this URL with an HTTP transport.
:::

For step-by-step setup instructions for all supported clients (Claude, ChatGPT, Cursor, Claude Code, and others), see [Connect to the MotherDuck MCP Server](/key-tasks/ai-and-motherduck/mcp-setup/).

## Server capabilities

With the remote MCP server, your agent can:
- Execute read-only and read-write SQL against your databases
- Explore database schemas, tables, and columns
- Attach and detach [shares](/key-tasks/sharing-data/sharing-overview)
- Ask questions about DuckDB and MotherDuck documentation
- Create and manage [Dives](/key-tasks/dives) (interactive data visualizations)
- Render Dives inline in supported clients with the Dive Viewer MCP App, so you iterate against live data instead of a sample-data preview
- Create, schedule, run, and monitor [Flights](/concepts/flights) (scheduled Python jobs on MotherDuck compute)
- Read and write [Guides](/key-tasks/guides/) — markdown documents that capture your org's metric definitions, join conventions, and domain context, so agents produce accurate SQL without repetitive prompting

For clients that [support MCP instructions](https://modelcontextprotocol.io/clients#feature-support-matrix), the remote MCP server provides detailed [query guidelines](https://app.motherduck.com/assets/docs/mcp_server_instructions.md) to help AI assistants write effective DuckDB SQL. Learn more about [using the MotherDuck MCP server](/key-tasks/ai-and-motherduck/mcp-workflows).

### Regional availability

The remote 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 remote MCP server. If you have strict data residency requirements, ensure your MCP client runs within your region.

### Restricting to read-only access

The remote MCP server exposes both read-only and read-write tools. To restrict your AI assistant to read-only access, see [Restricting to read-only access](/key-tasks/ai-and-motherduck/securing-read-only-access/).

## Local MCP server

For local DuckDB databases, custom configurations, or self-hosted scenarios, use the **local MCP server** ([mcp-server-motherduck](https://github.com/motherduckdb/mcp-server-motherduck)). For a comparison of remote vs local and when to use each, see the [setup guide](/key-tasks/ai-and-motherduck/mcp-setup/#remote-vs-local-mcp-server).

[📦 **Local MCP Server GitHub Repository** – Self-host the open-source MCP server for DuckDB and MotherDuck](https://github.com/motherduckdb/mcp-server-motherduck)

## Related resources

- [Connect to the MCP Server](/key-tasks/ai-and-motherduck/mcp-setup/) - Setup instructions for all supported AI clients
- [MCP Workflows Guide](/key-tasks/ai-and-motherduck/mcp-workflows) - Tips and workflows for using the MotherDuck MCP server
- [Building Analytics Agents](/key-tasks/ai-and-motherduck/building-analytics-agents) - Guide to building AI agents with MotherDuck
- [MCP Specification (2025-06-18)](https://modelcontextprotocol.io/specification/2025-06-18) - Official protocol documentation

## Tool reference

The remote MCP server's tools are grouped by what they operate on: **core tools** for querying databases, exploring schemas and shares, and asking documentation questions; **Dive tools** for creating and managing [Dives](/key-tasks/dives); **Flight tools** for creating, scheduling, and monitoring [Flights](/concepts/flights); and **Guide tools** for creating and managing [Guides](/key-tasks/guides/).

## Included pages

- [Core tools](https://motherduck.com/docs/category/core-tools): Query your databases, explore schemas and shares, search the catalog, and ask documentation questions through the MotherDuck MCP server.
- [Dives](https://motherduck.com/docs/category/dives): Create, read, update, share, and render Dives — interactive data visualizations — through the MotherDuck MCP server.
- [Flights](https://motherduck.com/docs/category/flights): Create, schedule, run, and monitor Flights — scheduled Python jobs on MotherDuck compute — through the MotherDuck MCP server.
- [Guides](https://motherduck.com/docs/category/guides): Create, read, update, and manage Guides — markdown documents that capture your organization's metric definitions, join conventions, and domain context so AI agents write accurate SQL — through the MotherDuck MCP server.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fmcp%2F&page_title=MCP%20Server&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
