# MotherDuck MCP MCP Server

> **MotherDuck MCP MCP Server** is a hosted, multitenant Model Context Protocol (MCP) server run by **MewCP** (https://mewcp.com), giving AI agents managed access to MotherDuck MCP.
>
> MewCP takes care of all MCP infrastructure for you — credential storage, OAuth flows,
> token refresh, and production-grade auto-scaling — so your AI agents can connect to
> third-party services and run freely without you managing any MCP server yourself.
>
> Server page:  https://mewcp.com/mcp/motherduck-mcp
> MewCP docs:   https://docs.mewcp.com
> All servers:  https://mewcp.com/servers (JSON: https://mewcp.com/api/servers)
> About MewCP:  https://mewcp.com/llms.txt

---

## About

Query and analyze cloud data warehouses with MotherDuck’s MCP server. Explore databases, tables, columns and data catalogues; execute DuckDB SQL queries, retrieve documentation answers, and create, update, read and share interactive data visualizations (Dives). Supports traceable SQL execution and isolated compute for analytics workflows.

---

## Details

- Server ID: `motherduck-mcp`
- Version: 1.0.0
- Tools: 50
- Authentication: OAuth, managed by MewCP
- Transport: http

---

## Access

The gateway URL below serves your **entire MewCP toolset**, not this server on its
own. Pasting a config snippet is not enough — MotherDuck MCP has to be in the toolset
first. In order:

1. Add MotherDuck MCP to your toolset at https://mewcp.com/mcp/motherduck-mcp
2. Connect your MotherDuck MCP account (OAuth); MewCP stores the credential and attaches it to each call
3. Add the gateway URL to your client (see Connect below). It signs in with OAuth
   the first time it connects, so there is no key to copy.

Once connected, an agent does **not** see this server's tools as top-level tools.
It sees four meta-tools and reaches everything through them:

- `search(query)` — find tools by keyword across the toolset
- `get_schema(tools)` — full description and arguments for the tools you picked
- `manage_connections(requests?)` — connection status and account aliases, plus
  links the user opens to add an app or connect an account
- `call_tool(app_maskedId, tool_name, args, alias?)` — execute

If MotherDuck MCP isn't in the toolset or connected yet, `manage_connections` with
app_maskedId `motherduck-mcp` returns a link that adds it and connects an account.

So the list below is what `search` can return for this server, not a set of
callable tool names on their own.

---

## Tools (50)

Descriptions are truncated to 160 characters; call `get_schema`
for the full text and the argument schema. Where a tool is annotated, its type
is shown — treat `destructive` as irreversible.

- `query` _(read)_ — Before writing SQL to answer a data question, call `get_query_guide` first — it returns this organization's query guidance and an overview of its curated…
- `query_rw` _(destructive)_ — Execute a DuckDB SQL query that modifies data, schema, or connection state. RULES: 1. Only execute writes authorized by the user's explicit request or the…
- `list_databases` _(read)_ — List all databases in your MotherDuck account. Shows each database's alias, type, and its `url` — a fully qualified MotherDuck database name (e.g. `md:my_db`)…
- `get_connection_info` _(read)_ — Show the MotherDuck user and organization this connection is signed in as: the user's name and email, and the organization's name and web app URL. A user can…
- `list_tables` _(read)_ — List all tables and views in a MotherDuck database with comments. Optionally filter by keywords. Also returns `relatedGuides` — curated guides associated with…
- `list_columns` _(read)_ — List all columns of a table or view with their types and comments.
- `list_views` _(read)_ — List all views in a MotherDuck database, with their schema, comment, and column count. Optionally filter by schema or keywords.
- `list_macros` _(read)_ — List all macros (table and scalar macros) in a MotherDuck database, with their schema and parameters. Optionally filter by schema or keywords.
- `search_catalog` _(read)_ — Search the catalog for databases, schemas, tables, columns, and shares using fuzzy matching. Returns matching objects with their fully qualified names, types,…
- `ask_docs_question` _(read)_ — Ask a question about DuckDB or MotherDuck. Returns answers from official documentation.
- `list_shares` _(read)_ — List all database shares that have been shared with you. Returns share names and URLs. To attach a share, use the query_rw tool: ATTACH '<share_url>' AS…
- `list_dives` _(read)_ — List all dives in MotherDuck. Dives are interactive React data apps that query live data. Returns metadata including current_version and status. Each dive has…
- `save_dive` _(write)_ — Save a new dive to MotherDuck. Returns a URL the user can click to view the dive. Get the dive guide first and iterate with the user on the design thoroughly…
- `update_dive` _(write)_ — Update an existing dive's title, description, or content. Returns a URL the user can click to view the updated dive. At least one field must be provided.
- `read_dive` _(read)_ — Read a specific dive by ID, including its ownership metadata, required resources, plain-language guidance for using those resources in the current workspace,…
- `delete_dive` _(destructive)_ — Delete a dive by ID. This action is permanent and cannot be undone.
- `get_dive_guide` _(read)_ — Load instructions for creating MotherDuck dives. You MUST call this tool first — before generating any chart, visualization, plot, dashboard, inline graphic,…
- `share_dive_data` _(write)_ — Share the data for a dive with your organization. Creates discoverable, automatically updating organization shares for owned databases used in the dive, and…
- `edit_dive_content` _(write)_ — Edit a dive's content by applying one or more text replacements, then save to MotherDuck. Accepts `id` (dive UUID) and `edits` (an array of {old_string,…
- `get_flight_guide` _(read)_ — Load instructions for authoring, scheduling, running, and troubleshooting MotherDuck flights. Call this tool first whenever the user asks about creating,…
- `get_flight_viz_guide` _(read)_ — Load the convention for making a MotherDuck flight's runs show up in the Flight Explainer, a live, step-by-step view with per-step timing. Use section only for…
- `create_flight` _(write)_ — Create a new MotherDuck flight. Read the flight guide before you create your first flight. A flight is a Python entrypoint (`source_code`) plus an optional…
- `get_flight` _(read)_ — Fetch a flight by UUID. Returns metadata plus a version snapshot (source code, requirements, config, secret names, token name). Large source files return a…
- `list_flights` _(read)_ — List MotherDuck flights. Org admins see every flight in their organization (with `owner_name` identifying whose is whose); everyone else sees only their own.…
- `update_flight` _(write)_ — Update a flight. Any subset of name, source_code, requirements_txt, schedule_cron, config, access_token_name, flight_secret_names, max_runtime_sec, or…
- `edit_flight_source` _(write)_ — Edit a flight's source_code by applying one or more text replacements, then save as a new FlightVersion. Accepts `id` (flight UUID) and `edits` (an array of…
- `delete_flight` _(destructive)_ — Permanently delete a flight, its versions, schedule, and run history. This action cannot be undone.
- `list_flight_versions` _(read)_ — List the immutable versions of a flight, newest first. Each update to source_code / requirements_txt / config / access_token_name / flight_secret_names…
- `run_flight` _(destructive)_ — Trigger an on-demand execution of a flight using its current version. Optionally pass `config` to override the flight version's config for this run only (the…
- `cancel_flight_run` _(destructive)_ — Cancel an in-flight run of a flight. Identified by the flight UUID and the sequential run number (from list_flight_runs). Returns `canceled: true` on a…
- `list_flight_runs` _(read)_ — List executions of a flight, newest first. Each run has a sequential number, status (PENDING/RUNNING/SUCCEEDED/FAILED/CANCELLED), timing metadata, and the…
- `get_flight_run` _(read)_ — Fetch a single run of a flight by its sequential run number (from run_flight or list_flight_runs). Returns its status…
- `get_flight_logs` _(read)_ — Fetch the plain-text logs (stdout + stderr) of a flight run plus the matching `Run` record (status, exit_code, timing). Returns the last 200 lines by default;…
- `view_flight_run` _(read)_ — Open a flight run as a live diagram: the flight's declared chart as a step-by-step view, each step coloured by what the run actually did, with its timing,…
- `get_guide` _(read)_ — Load a guide by uuid. Guides are curated markdown documents about this organization's data (metric definitions, conventions, pitfalls). Large guides return a…
- `get_query_guide` _(read)_ — Call this before writing SQL to answer a data question. Returns this organization's query guidance: what guides exist (curated markdown documents about the…
- `list_guides` _(read)_ — Browse this organization's curated guides — markdown documents that capture organization and personal context about the data in MotherDuck. Called with no…
- `create_guide` _(write)_ — Create a new guide — a markdown document that agents read to answer this org's data questions correctly (metric definitions, join/filter conventions,…
- `update_guide` _(write)_ — Append a new version to an existing guide, identified by `uuid`. Omit `content` to keep the current text and just change metadata such as references. A…
- `edit_guide_content` _(write)_ — Edit a guide's markdown body by applying one or more text replacements, then save as a new version. Identify the guide by `uuid`. Reads the stored guide,…
- `update_guide_metadata` _(write)_ — Change a guide's title, description, or topic without appending a content version. Identify it by `uuid`. Pass an empty `description` to clear it; pass an…
- `set_guide_access` _(write)_ — Set a guide's visibility to 'user' (private to the owner) or 'organization' (visible to the whole org). Identify it by `uuid`. Org-wide scoping is…
- `delete_guide` _(destructive)_ — Soft-delete a guide while preserving its version history. Identify it by `uuid`.
- `grant_access` _(write)_ — Grant a permission on one flight to users, roles or the whole organization. Re-granting is a no-op. Only a flight's owner can grant 'run' on it. An object you…
- `revoke_access` _(destructive)_ — Revoke a permission on one flight from users, roles or the whole organization; takes the same parameters as grant_access. Revoking a grant that doesn't exist…
- `dive_query` _(read)_ — Execute a read-only DuckDB query on behalf of a dive. This tool is used by the dive viewer and is not intended for direct use by the AI assistant.
- `log_dive_viewer_event` _(read)_ — Log a dive viewer event for analytics. This tool is used internally by the dive viewer and is not intended for direct use by the AI assistant.
- `view_dive` _(read)_ — Open and render a MotherDuck Dive as a live MCP app with interactive charts. Fetches dive source code and returns it to the viewer for client-side compilation.
- `get_short_lived_token` _(read)_ — Returns a short-lived token and connection details for the MotherDuck database endpoint.
- `mint_dive_state_reference` _(write)_ — Mint a server-stored reference for a `useDiveState` bag and return its id. Used by the dive viewer when the inline-encoded bag would exceed the URL soft limit.…

---

## Connect

- URL: https://gateway.mewcp.com/personal/mcp
- Transport: Streamable HTTP (remote). Nothing to install.
- Sign-in: OAuth. On first connect the client opens a browser window to sign in
  to MewCP and approve access. No API key.
- Headless clients (SDKs, servers without a browser) send an API key instead:
  `Authorization: Bearer <API_KEY>`, key from https://mewcp.com/dashboard/api-keys

Agents setting themselves up: follow https://mewcp.com/SKILL.md

Step-by-step guide per client:

- Claude Desktop: https://mewcp.com/mcp/motherduck-mcp/connect/claude
- ChatGPT: https://mewcp.com/mcp/motherduck-mcp/connect/chatgpt
- Grok: https://mewcp.com/mcp/motherduck-mcp/connect/grok
- DeepSeek Harness: https://mewcp.com/mcp/motherduck-mcp/connect/dsh
- Mistral Vibe: https://mewcp.com/mcp/motherduck-mcp/connect/mistral-vibe
- VS Code: https://mewcp.com/mcp/motherduck-mcp/connect/vscode
- Cursor: https://mewcp.com/mcp/motherduck-mcp/connect/cursor
- Codex: https://mewcp.com/mcp/motherduck-mcp/connect/codex
- Claude Code: https://mewcp.com/mcp/motherduck-mcp/connect/claude-code
- OpenCode: https://mewcp.com/mcp/motherduck-mcp/connect/opencode
- OpenClaw: https://mewcp.com/mcp/motherduck-mcp/connect/openclaw
- Antigravity: https://mewcp.com/mcp/motherduck-mcp/connect/antigravity
- Hermes: https://mewcp.com/mcp/motherduck-mcp/connect/hermes
- Kimi Code: https://mewcp.com/mcp/motherduck-mcp/connect/kimi-code
- Grok Build: https://mewcp.com/mcp/motherduck-mcp/connect/grok-build
- Devin Desktop: https://mewcp.com/mcp/motherduck-mcp/connect/devin-desktop
- Zed: https://mewcp.com/mcp/motherduck-mcp/connect/zed
- Muse Code: https://mewcp.com/mcp/motherduck-mcp/connect/muse-code
- Cline: https://mewcp.com/mcp/motherduck-mcp/connect/cline
- Kilo Code: https://mewcp.com/mcp/motherduck-mcp/connect/kilo-code
- Kiro: https://mewcp.com/mcp/motherduck-mcp/connect/kiro
- Junie: https://mewcp.com/mcp/motherduck-mcp/connect/junie
- Amp: https://mewcp.com/mcp/motherduck-mcp/connect/amp
- Qwen Code: https://mewcp.com/mcp/motherduck-mcp/connect/qwen-code
- Goose: https://mewcp.com/mcp/motherduck-mcp/connect/goose
- Python: https://mewcp.com/mcp/motherduck-mcp/connect/python
- TypeScript: https://mewcp.com/mcp/motherduck-mcp/connect/typescript