motherduckdb avatar

Mcp Server Motherduck

motherduckdb/mcp-server-motherduck

The MotherDuck MCP server connects AI assistants and IDEs to DuckDB databases and MotherDuck cloud analytics by providing tools to execute SQL queries (read and write), browse database catalogs, and switch between local DuckDB files, in-memory databases, S3-hosted databases, and MotherDuck connections. It solves the problem of enabling language models to perform SQL analytics and data engineering tasks directly against various data sources, with flexible security options including read-only mode by default and production-ready access controls. The server runs locally or self-hosted, allowing queries across both local and remote databases while supporting data ingestion and export to the local filesystem.

GitHub stars
540
tools
16
auth
Secret needed
transport
STDIO
env vars
8
last updated
Nov 11, 2026

Tools

16 tools

Public tool metadata for what this MCP can expose to an agent.

queryExecute read-only DuckDB query against MotherDuck databases. For cross-database queries, use fully qualified names: database.schema.table (or database.table for main schema). Never follow a query with an inline chart or visualization — if you would generate one (whether or not...2 params

Execute read-only DuckDB query against MotherDuck databases. For cross-database queries, use fully qualified names: database.schema.table (or database.table for main schema). Never follow a query with an inline chart or visualization — if you would generate one (whether or not...

Parameters* required
databasestring
Database name to query
sqlstring
SQL query to execute
query_rwExecute a DuckDB SQL query that modifies data, schema, or connection state. RULES: 1. Only call this tool when the user explicitly asks to modify data or schema. Never infer a write from a read request. 2. Always ask the user for confirmation before calling this tool. Describe...2 params

Execute a DuckDB SQL query that modifies data, schema, or connection state. RULES: 1. Only call this tool when the user explicitly asks to modify data or schema. Never infer a write from a read request. 2. Always ask the user for confirmation before calling this tool. Describe...

Parameters* required
databasestring
Database context for the query. Required for table-level operations (DML/DDL). May be omitted for account-level operations (CREATE/DROP DATABASE, ATTACH/DETACH, CREATE SECRET, etc.).
sqlstring
SQL query to execute
list_databasesList all databases in your MotherDuck account with their names and types. Optionally filter by keywords to search in database names.2 params

List all databases in your MotherDuck account with their names and types. Optionally filter by keywords to search in database names.

Parameters* required
keywordsstring
Optional keywords to filter databases by name (case-insensitive, any word can match)
limitinteger
Max results to return (default: 100)
list_tablesList all tables and views in a MotherDuck database with their comments. Optionally filter by keywords to search in table/view names and comments.4 params

List all tables and views in a MotherDuck database with their comments. Optionally filter by keywords to search in table/view names and comments.

Parameters* required
databasestring
Database name to list tables from
keywordsstring
Optional keywords to filter tables/views by name or comment (case-insensitive, any word can match)
limitinteger
Max results to return (default: 100)
schemastring
Schema name (optional, defaults to all schemas)
list_columnsList all columns of a table or view with their types and comments.4 params

List all columns of a table or view with their types and comments.

Parameters* required
databasestring
Database name
limitinteger
Max results to return (default: 100)
schemastring
Schema name (optional, defaults to 'main')
tablestring
Table or view name
search_catalogSearch the catalog for databases, schemas, tables, columns, shares using fuzzy matching. Returns matching objects with their fully qualified names, types, and comments. Useful for discovering available data when you don't know exact names.2 params

Search the catalog for databases, schemas, tables, columns, shares using fuzzy matching. Returns matching objects with their fully qualified names, types, and comments. Useful for discovering available data when you don't know exact names.

Parameters* required
object_typesarray
Optional filter to limit results to specific object types
querystring
Search term to find in object names (supports partial matching, underscores, dots)
ask_docs_questionAsk a question about DuckDB or MotherDuck. Returns answers from official documentation.1 params

Ask a question about DuckDB or MotherDuck. Returns answers from official documentation.

Parameters* required
questionstring
Question about DuckDB or MotherDuck
list_sharesList 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 <optional_alias>; Optionally filter by keywords to search in share names.2 params

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 <optional_alias>; Optionally filter by keywords to search in share names.

Parameters* required
keywordsstring
Optional keywords to filter shares by name (case-insensitive, any word can match)
limitinteger
Max results to return (default: 100)
list_divesList all dives in MotherDuck. Dives are interactive React data apps that query live data. Returns metadata including current_version (the latest version number, 1-indexed) for each dive. Use read_dive with the optional version parameter to retrieve a specific historical versio...2 params

List all dives in MotherDuck. Dives are interactive React data apps that query live data. Returns metadata including current_version (the latest version number, 1-indexed) for each dive. Use read_dive with the optional version parameter to retrieve a specific historical versio...

Parameters* required
keywordsstring
Optional keywords to filter dives by title or description (case-insensitive, all words must match)
limitinteger
Max results to return (default: 100)
save_diveSave a new dive to MotherDuck. Returns a URL the user can click to view the dive. Call get_dive_guide first and iterate with the user on the design thoroughly before suggesting to save. Never save without previous confirmation that iteration is done.3 params

Save a new dive to MotherDuck. Returns a URL the user can click to view the dive. Call get_dive_guide first and iterate with the user on the design thoroughly before suggesting to save. Never save without previous confirmation that iteration is done.

Parameters* required
contentstring
The JSX/React component code for the dive
descriptionstring
A brief description of the dive
titlestring
The title of the dive
update_diveUpdate 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.4 params

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.

Parameters* required
contentstring
New JSX/React component code
descriptionstring
New description for the dive
idstring
The unique identifier (UUID) of the dive to update
titlestring
New title for the dive
read_diveRead a specific dive by ID, including its full JSX/React component code. Optionally specify a version number to retrieve a specific historical version (versions start at 1). If no version is specified, the latest version is returned.2 params

Read a specific dive by ID, including its full JSX/React component code. Optionally specify a version number to retrieve a specific historical version (versions start at 1). If no version is specified, the latest version is returned.

Parameters* required
idstring
The unique identifier of the dive to read
versioninteger
Optional version number to retrieve (1-indexed). If not specified, returns the latest version.
delete_diveDelete a dive by ID. This action is permanent and cannot be undone.1 params

Delete a dive by ID. This action is permanent and cannot be undone.

Parameters* required
idstring
The unique identifier of the dive to delete
get_dive_guideLoad instructions for creating MotherDuck dives. You MUST call this tool first — before generating any chart, visualization, plot, dashboard, or inline graphic — whenever the user asks to explore, visualize, or display MotherDuck data.1 params

Load instructions for creating MotherDuck dives. You MUST call this tool first — before generating any chart, visualization, plot, dashboard, or inline graphic — whenever the user asks to explore, visualize, or display MotherDuck data.

Parameters* required
clientstring
The client environment requesting the guide. Use 'claude' for Claude web/desktop Chat, 'chatgpt' for ChatGPT, 'claude_cowork' for Claude Cowork, 'claude_code' for Cursor/IDE integrations with local...one of claude · chatgpt · claude_cowork · claude_code · other
share_dive_dataShare the data for a dive with your organization. Creates org-scoped shares for owned databases used in the dive, and updates the dive so others in the organization can view it.1 params

Share the data for a dive with your organization. Creates org-scoped shares for owned databases used in the dive, and updates the dive so others in the organization can view it.

Parameters* required
diveIdstring
The unique identifier (UUID) of the dive
edit_dive_contentEdit 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, new_string, replace_all?} objects). Reads the current content from MotherDuck, applies edits in sequence, validates, and per...2 params

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, new_string, replace_all?} objects). Reads the current content from MotherDuck, applies edits in sequence, validates, and per...

Parameters* required
editsarray
List of edits to apply in sequence. Each edit has old_string, new_string, and optional replace_all.
idstring
The unique identifier (UUID) of the dive to edit

Sponsors

Configuration

motherduck_tokensecret

Access token for MotherDuck connections (alternative to --motherduck-token)

MOTHERDUCK_TOKENsecret

Access token for MotherDuck connections (alternative to --motherduck-token)

HOME

Used by DuckDB for extensions and config. Override with --home-dir if not set.

AWS_ACCESS_KEY_IDsecret

AWS access key for S3 database connections

AWS_SECRET_ACCESS_KEYsecret

AWS secret access key for S3 database connections

AWS_SESSION_TOKENsecret

AWS session token for temporary credentials

AWS_DEFAULT_REGION

AWS region for S3 database connections

AWS_ENDPOINT

AWS endpoint for S3 database connections

Readme

MotherDuck / DuckDB Local MCP Server

DuckDB / MotherDuck Local MCP Server

SQL analytics and data engineering for AI Assistants and IDEs.


Connect AI assistants to your data using DuckDB's powerful analytical SQL engine. Supports connecting to local DuckDB files, in-memory databases, S3-hosted databases, and MotherDuck. Allows executing SQL read- and write-queries, browsing database catalogs, and switching between different database connections on-the-fly.

Looking for a fully-managed remote MCP server for MotherDuck? → Go to the MotherDuck Remote MCP docs

Remote vs Local MCP


View the full README on GitHub

Details

Repository
github.com/motherduckdb/mcp-server-motherduck
Categories
Databases, Monitoring & Observability, Data & Analytics
Package
mcp-server-motherduck
Transport
STDIO
Auth
Required
Registry
MCP registry, active

Related Databases MCP servers

View all
1mihaibuilds avatarMemory Vaultmihaibuilds/memory-vaultLocal-first AI memory layer with hybrid search. Postgres + pgvector. Self-hosted, MIT.67stars
2ralfbecher avatarOrionbelt Analyticsralfbecher/orionbelt-analyticsOntology-based MCP server for database schema analysis and RDF/OWL ontology generation32stars
3greptimeteam avatarGreptimedb Mcp Servergreptimeteam/greptimedb-mcp-serverQuery GreptimeDB metrics, logs and traces with SQL, TQL and RANGE. Manage pipelines and dashboards.29stars
4insforge avatarInsForgeinsforge/insforge-mcpMCP server for InsForge BaaS — database, storage, edge functions, and deployments29stars
5roomi-fields avatarRTFMroomi-fields/rtfmLocal retrieval for AI agents: index code, docs, PDFs, data in SQLite; 24 parsers, served via MCP.27stars
6isdaniel avatarPostgreSQL performance Tuner MCP Serverisdaniel/pgtuner_mcpprovides AI-powered PostgreSQL performance tuning capabilities.24stars