Databases#Data analysis

DuckDB / MotherDuck MCP: SQL analytics on local data

MotherDuck's official DuckDB MCP server: agents run analytical SQL on local DuckDB files, S3 or MotherDuck, read-only by default, with no server to deploy.

Project and installation docs

View project

https://github.com/motherduckdb/mcp-server-motherduck

You have a pile of exported data and want an agent to run a few rounds of group-bys, but standing up an analytics database for that is a chore. DuckDB is an embedded analytics engine that runs columnar SQL on a single file or in memory. This server, maintained by MotherDuck, hands it to the agent, with one tool set for local files, S3 and the MotherDuck cloud. It had about 530 stars as of 2026-10-06.

What it does

  • SQL: execute_query runs DuckDB-dialect queries; results cap at 1,024 rows and 50,000 characters by default (--max-rows, --max-chars).
  • Catalog: list_databases, list_tables and list_columns browse databases, tables and columns.
  • Switching connections: with --allow-switch-databases, switch_database_connection moves between local files, S3 and MotherDuck.
  • Guardrails: read-only by default, --read-write to allow writes, --query-timeout to bound queries and --init-sql to run setup statements at start.
  • Cloud details: connects to MotherDuck via the motherduck_token env var or --motherduck-token; DuckDB uses HOME to find extensions and config, so an unset HOME in a container needs --home-dir, and reading from S3 and similar cloud storage also honors temporary credentials via AWS_SESSION_TOKEN.

Who it’s for

  • Analysts who want Claude to explore a local DuckDB file directly.
  • Data engineers on MotherDuck who want an agent in the IDE to query cloud data.

Setup

Needs uv. To connect read-only to a local DuckDB file in Claude Code:

claude mcp add --scope user duckdb --transport stdio -- uvx mcp-server-motherduck --db-path /absolute/path/to/db.duckdb

Our take

In the data category it complements Confluent MCP, which handles message streams rather than analytical queries. We picked this over the ClickHouse server for the analytics slot because the bar is low: nothing to deploy, one file to start, and MotherDuck when you need the cloud. The read-only default and row caps make it safe to try. Note that the dev-mode example turns on both --read-write and --allow-switch-databases, which lets the agent read and write any DuckDB file on the machine and export to the local filesystem. The README also warns that read-only mode still reaches the local filesystem and DuckDB settings, so for third-party access use MotherDuck’s hosted remote server, or a dedicated service account with a read-scaling token plus SaaS mode (which restricts local file access) and --init-sql security settings. Read-only MotherDuck connections need that dedicated read-scaling token; a regular token requires --read-write. Licensed MIT.