MCP Server Motherduck logo

MCP Server Motherduck

Run DuckDB SQL against local files, in-memory databases, S3-hosted databases, or MotherDuck through MCP.

Install MCP Server Motherduck

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-server-motherduck": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

uvx mcp-server-motherduck

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 7d ago.

Overview

DuckDB and MotherDuck access comes through the mcp-server-motherduck MCP server, which exposes SQL execution and database catalog tools to AI assistants and IDEs. It runs locally via stdio and can connect to in-memory databases, local DuckDB files, S3-hosted databases, or MotherDuck. Use it for querying, inspecting schemas, and optionally writing data when the server is started with read-write access. Database switching is available when enabled with the appropriate command-line flag.

Use cases

  • Query local DuckDB files with an AI assistant
  • Analyze MotherDuck data through DuckDB SQL
  • Inspect tables, views, and column definitions
  • Run read-only analytics against S3-hosted databases
  • Switch between database connections during a session

Key features

  • DuckDB SQL query execution
  • MotherDuck and local DuckDB connectivity
  • S3-hosted DuckDB file support
  • Database and schema catalog browsing
  • Optional read-write access
  • Optional runtime database switching

Tools4

What MCP Server Motherduck lets your agent do. Expand a tool for its parameters.

Self-reported~50 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

8/8 checks healthy over the last 39d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · mcp-server-motherduck (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars534Stargazers on the source repository.
Last commit15d agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Tools exposed4Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Server Motherduck works

What mcp-server-motherduck does

The mcp-server-motherduck MCP server gives an MCP-compatible AI client access to DuckDB's analytical SQL engine. It can work with an in-memory database, a local DuckDB file, a DuckDB database on S3, or MotherDuck. The process runs locally rather than using MotherDuck's hosted remote MCP service.

The server supports SQL reads and writes, but new installations start in read-only mode. Write operations require the --read-write option. This makes it suitable for inspecting data by default, while allowing explicitly configured development or trusted environments to mutate databases.

How it works

The mcp-server-motherduck MCP server is launched as a local MCP process, commonly through uvx. The database target is selected with --db-path; examples include :memory:, an absolute .duckdb path, an s3:// URL, and md: for MotherDuck. A MotherDuck connection uses a token supplied through the client environment configuration.

Clients call execute_query with SQL written in DuckDB dialect. Catalog tools expose available databases, tables, views, and columns so an agent can inspect a data source before querying it. list_tables and list_columns accept database and schema selectors where applicable.

The optional switch_database_connection tool permits changing the active database connection at runtime. It is only available when the server starts with --allow-switch-databases; this option can also permit creating a missing database when requested. Tool responses are returned as JSON.

Setup and configuration

Install uv before using the quick-start configurations. A minimal read-only setup points --db-path at a local DuckDB file. An in-memory development setup can add --read-write and --allow-switch-databases. For MotherDuck read-write access, use --db-path md: with --read-write and provide the MotherDuck token.

Read-only MotherDuck connections require a read-scaling token. Regular MotherDuck tokens require read-write mode. S3-backed DuckDB files can be addressed with an s3:// path; the repository also documents S3 authentication under its environment-variable configuration.

The server can be configured in Claude Desktop, Claude Code, Codex CLI, Gemini CLI, Cursor, VS Code, and other MCP-compatible clients. Configuration is client-specific, but the core command uses uvx mcp-server-motherduck followed by the database and access flags.

Tools and capabilities

  • execute_query: Runs a DuckDB SQL query, including read or write statements allowed by the selected mode.
  • list_databases: Shows databases available through the current connection setup.
  • list_tables: Lists tables and views, optionally narrowed by database and schema.
  • list_columns: Lists columns for a table or view, with optional database and schema selectors.
  • switch_database_connection: Changes the active connection when database switching is enabled.

Results are limited by default to 1,024 rows or 50,000 characters. The limits can be changed with --max-rows and --max-chars.

Limitations and notes

Read-only mode does not by itself provide complete isolation for third-party access: the local process can still access the filesystem and change DuckDB settings. The repository recommends considering the hosted MotherDuck Remote MCP service for production deployments involving third parties. The default database path is now :memory:, so MotherDuck users must specify md: explicitly.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Server Motherduck

mcp-server-motherduck is an MCP server that connects AI assistants and IDEs to local DuckDB files, in-memory databases, S3-hosted DuckDB databases, and MotherDuck. Its main tools execute DuckDB SQL, list databases, inspect tables and views, and list table or view columns; optional database switching is also supported.

Install `uv` first, then configure your MCP client to launch `uvx mcp-server-motherduck` with a `--db-path` argument. The repository provides configurations for local files, in-memory DuckDB, and MotherDuck.

Set `--db-path md:` and provide a MotherDuck token through the client environment. Add `--read-write` for regular tokens; read-only MotherDuck connections require a read-scaling token.

Yes, mcp-server-motherduck works with Cursor through its MCP settings. Add a server using the `uvx mcp-server-motherduck` command and the required database path and access flags.

Yes, but runtime switching requires the `--allow-switch-databases` flag. When enabled, the server exposes a tool for changing the active connection and can optionally create a database if requested.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Server Motherduck AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-server-motherduck?style=directory)](https://allmcps.com/mcp/mcp-server-motherduck)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-server-motherduck"><img src="https://allmcps.com/api/badge/mcp-server-motherduck?style=directory" alt="MCP Server Motherduck on AllMCPs" /></a>