MCP/DuckDB & MotherDuck
DuckDB & MotherDuck logo

DuckDB & MotherDuck

Verified Blue (500+ GitHub stars)

Local and cloud analytical SQL engine for DuckDB files, in-memory databases, S3 data lakes, and MotherDuck.

rag-data•Databases & Storage
GitHub534
License:MIT
VERIFIED

About this Server

The official DuckDB and MotherDuck Model Context Protocol (MCP) server connects AI assistants to DuckDB fast columnar analytical SQL engine. It enables querying in-memory tables, local .duckdb files, remote Parquet data on Amazon S3, and cloud-hosted MotherDuck databases. Agents can execute queries, inspect catalogs, list schemas and columns, and switch active database connections dynamically.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

Read-Only Locks: Use default read-only flags for local DuckDB files to prevent holding write locks against other processes.
Token Environment Isolation: Pass motherduck_token via client environment variables rather than command-line arguments.
Filesystem Access Constraints: Enable SaaS mode (--motherduck-saas-mode) when exposing DuckDB to third-party or multi-tenant agents.

When to Use (and When Not To)

Best For
  • •Fast OLAP analytical queries, aggregation rollups, and summary metrics over large datasets
  • •Querying local Parquet, CSV, and JSON files directly without provisioning heavyweight database servers
  • •Connecting AI agents to serverless MotherDuck cloud data warehouses
Not For / Limitations
  • •High-frequency transactional OLTP row writes and ACID bank transactions (use DBHub with PostgreSQL instead)
  • •Document collections and Atlas stream pipelines (use MongoDB MCP instead)
  • •Vector embedding cosine similarity searches (use Chroma MCP instead)

Install & Setup

terminal command
$claude mcp add motherduck -- uvx mcp-server-motherduck --db-path md: --read-write

Exposed Tools & Endpoints

5 tools

Functions your AI agent can invoke via this Model Context Protocol server

execute_query

Executes SQL analytical queries using DuckDB dialect against connected local or cloud databases.

list_databases

Lists all accessible databases attached to the current DuckDB or MotherDuck session.

list_tables

Lists tables and views in a specified database and schema.

list_columns

Retrieves column names, data types, and nullability for a table or view.

switch_database_connection

Dynamically switches the active database connection to another file, S3 path, or MotherDuck.