← Back to directory
M

MCP Server Motherduck

Official
SQL analytics and data engineering for AI Assistants and IDEs
Category
Database #17 of 58
Stars
★ 527 Very popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Python · Docker
Credentials
No credential needed
License
MIT
Last commit
Tools
5
60FMRS · C

This MCP server connects AI assistants to DuckDB and MotherDuck, providing powerful SQL analytics. It is flexible, supporting local, in-memory, S3, and cloud databases, with read/write access controlled by flags. The default read-only mode reduces risk, but security configurations must be considered when exposing it to third parties.

Strongest · Documentation 15/20 Weakest · Reliability 7/20

Reliability
7/20
Security and permissions
13/20
Maintenance
12/20
Documentation
15/20
Setup experience
13/20
Why each score
Reliability 7/20
The README and manifest give a clear startup path, a tool table, CLI arguments, Docker usage, and a release process, so the happy path is plausible. However, no source code, tests, or CI workflows are provided, so the MCP init/tool-list handshake and the match between declared and actual tools cannot be verified. Error handling and edge cases are thinly evidenced, so under the static calibration rule the score cannot exceed 12; I assign 7.
Security and permissions 13/20
The server defaults to read-only, requires the explicit --read-write flag for writes, requires --allow-switch-databases for runtime database switching, and offers --motherduck-saas-mode to restrict local file access. Tokens and AWS credentials are marked secret in the manifest. The README explicitly warns that read-only mode still permits local filesystem access and DuckDB setting changes, and recommends MotherDuck Remote MCP for third-party access; data-flow disclosure is fairly clear. However, without source code we cannot verify enforcement of these permissions or any confirmation mechanism for dangerous operations, and no security reporting channel is shown. No real tokens, malware, or other red-line issues are present, so I assign 13.
Maintenance 12/20
The repository has an MIT license, version 1.0.7, a documented release process via GitHub Action to PyPI/MCP registry, and is not archived. But there is no evidence of commit frequency, issue response time, dependency update practices, or a security-response channel, leaving governance gaps. Stars are only a discovery signal and add no points, so I assign 12.
Documentation 15/20
The README is layered and practical: quick start, multi-client configuration examples, CLI parameters, environment variables, Docker, troubleshooting, security guidance, and explicit disclosures of row/character limits and migration changes. It lacks cost information, the troubleshooting section is thin, and without source/tests we cannot confirm full alignment between docs and behavior, so I assign 15.
Setup experience 13/20
Setup is clear and low-friction: uv/uvx plus a JSON snippet, with examples for Claude, Cursor, VS Code, Kiro, and other clients, plus a Docker path. However, static calibration caps setup at 15 when there is no real CI or committed test evidence, and the docs mention environment issues such as uvx ENOENT. I therefore assign 13.

Static review · not runListed 2026-08-07

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesUses the networkConnects to a database

Best for

  • Data scientists and analysts needing SQL analytics on local or remote databases
  • Developers wanting AI-assisted data engineering within IDEs
  • Teams needing to quickly explore DuckDB files
  • Users who want to incorporate MotherDuck cloud capabilities

Not for

  • Users who want a fully managed remote MCP service without local installation
  • Production environments with strict security requirements (default read-only mode still allows local filesystem access)
  • Third-party access without additional security configurations

Required permissions

  • Access to local filesystem (to read DuckDB files or export data)
  • Reads environment variables for MotherDuck tokens and AWS credentials
  • Executes SQL queries in read-only mode by default; write access must be explicitly enabled
  • Optionally switches database connections at runtime (requires --allow-switch-databases)

Risks and side effects

  • If write mode is enabled, data in databases could be modified or deleted
  • By default, when exposed to third parties, local filesystem or sensitive data may be accessed
  • MotherDuck tokens or AWS credentials could be leaked if misconfigured
  • Queries may consume significant resources (memory, CPU) or time out

Setup

Before you start

Runtime:Python · Docker

MOTHERDUCK_TOKEN optionalsecret Uppercase variant of the MotherDuck access token.
AWS_ACCESS_KEY_ID optionalsecret AWS access key for connecting to S3-hosted DuckDB files; from AWS IAM.
AWS_SECRET_ACCESS_KEY optionalsecret AWS secret access key paired with AWS_ACCESS_KEY_ID.
AWS_SESSION_TOKEN optionalsecret Session token for temporary credentials (IAM roles, SSO, EC2 instance profiles).
Other optional settings (3)
HOME optional Home directory used by DuckDB for extensions and config; override with --home-dir if unset.
AWS_DEFAULT_REGION optional AWS region used for S3 connections.
AWS_ENDPOINT optional Custom AWS endpoint for S3 connections.
  1. Install uv via pip install uv or brew install uv.
  2. Add the JSON configuration to your MCP client's config file, or use client-specific CLI commands as shown in the README. For example, for in-memory DuckDB dev mode: use 'uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databases'.
  3. For MotherDuck, provide an access token via --motherduck-token or the environment variable motherduck_token.
claude_desktop_config.json
{
  "mcpServers": {
    "DuckDB (in-memory, r/w)": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path",
        ":memory:",
        "--read-write",
        "--allow-switch-databases"
      ]
    }
  }
}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "DuckDB (in-memory, r/w)": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path",
        ":memory:",
        "--read-write",
        "--allow-switch-databases"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add 'DuckDB (in-memory, r/w)' -- uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databases

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

After installation, the client's tool list should show execute_query, list_databases, list_tables, list_columns (plus switch_database_connection if --allow-switch-databases is enabled); running list_databases and getting a database list confirms the connection works.

Troubleshooting

  1. 'spawn uvx ENOENT': specify the full path to uvx (run which uvx to find it)
  2. File locked: ensure --ephemeral-connections is on (default: true) and you are not connected in read-write mode
  3. MotherDuck read-only connections require a read-scaling token; otherwise use --read-write
  4. Ensure the database path is correct (e.g., :memory:, md:, absolute file path, or s3:// URL)

Things to try

Once connected, you can ask your AI assistant things like:

  • Use execute_query to show what tables exist in the in-memory database
  • List all available databases
  • Show the columns of the table my_table
  • Switch the database connection to md: and list its tables

Tools 5

execute_query writes
Execute SQL query (DuckDB dialect)
list_databases read-only
List all databases
list_tables read-only
List tables and views
list_columns read-only
List columns of a table/view
switch_database_connection writes
Switch to a different database (requires --allow-switch-databases flag)

Use cases

Having an AI assistant analyze data from local DuckDB files
Interactive querying and exploration of in-memory DuckDB databases
Combining local data with MotherDuck cloud databases for analysis
Querying DuckDB databases hosted on S3
Using AI for data engineering and prototyping in development environments

Supported clients

Claude Desktop
Claude Code
Codex
Gemini CLI
Cursor
VS Code
Kiro

Listed from the project's documentation, not tested by this site.

Overview

This is a local MCP server that connects AI assistants to DuckDB or MotherDuck databases. It supports querying local DuckDB files, in-memory databases, S3-hosted databases, and MotherDuck. The server allows executing SQL read and write queries, browsing database catalogs, and switching between different database connections on the fly. It runs in read-only mode by default; write access must be explicitly enabled.

Similar servers

Source revision 41acb581d9bc Data synced 2026-10-12 Read the FMRS scoring method