Skip to content
← All MCP servers

Is the DuckDB MCP server safe? What it can reach

What the DuckDB MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.

Community serverChecked

The most used DuckDB MCP server is mcp-server-motherduck, a local Python server maintained by MotherDuck, not by the DuckDB project. It starts read-only. Add --read-write and execute_query can change or drop data. MotherDuck says read-only mode alone is not enough to protect the filesystem, so lock it down with --init-sql.

Who maintains it

ImplementationKindStatus
mcp-server-motherduck (local DuckDB and MotherDuck, maintained by MotherDuck)Communityactive
MotherDuck remote MCP server (hosted)Officialactive

It runs as a local process on your machine or as a hosted remote server. The documented endpoint is https://api.motherduck.com/mcp.

How it signs in

A local DuckDB file or in-memory database needs no sign-in. A MotherDuck database uses a MotherDuck token in the motherduck_token variable, and S3 databases use AWS keys.

What its tools can do

KindTools
Readlist_databases, list_tables, list_columns
Writeswitch_database_connection
Can’t be undoneexecute_query

execute_query runs any DuckDB SQL. It is read-only unless you start the server with --read-write. switch_database_connection exists only with --allow-switch-databases.

Built-in limits

OptionWhat it does
--read-writeOff by default. Without it the connection is read-only.
--allow-switch-databasesOff by default. Turns on switch_database_connection, which can open local files, S3 or MotherDuck.
--init-sqlSQL run at startup, used to apply DuckDB security settings such as disabling external access.
--max-rows and --query-timeoutCap results at 1024 rows and 50,000 characters by default, and set a query timeout in seconds.
--motherduck-saas-modeMotherDuck recommends it, with a service account and read-scaling token, when you self-host for others.

The risks

  • With --read-write, an injected instruction can run DROP or DELETE through execute_query, and there is no undo on a local file.
  • The README says read-only mode still allows local filesystem access and changes to DuckDB settings, so a read-only query can read files on your machine.
  • A MotherDuck token or AWS keys in the environment let the agent reach cloud data well beyond one local file.
  • Query results go to your AI provider, capped at 1024 rows by default.

Limit it in Claude Code

Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:

claude mcp add duckdb -- uvx mcp-server-motherduck --db-path /absolute/path/to/your.duckdb

Claude Code names MCP tools mcp__duckdb__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:

{
  "permissions": {
    "deny": [
      "mcp__duckdb__switch_database_connection"
    ],
    "ask": [
      "mcp__duckdb__execute_query"
    ]
  }
}

Limit it in Codex

Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:

[mcp_servers.duckdb]
command = "uvx"
args = ["mcp-server-motherduck", "--db-path", "/absolute/path/to/your.duckdb"]
disabled_tools = ["switch_database_connection"]

Checklist

  • Leave out --read-write and --allow-switch-databases unless you need them.
  • Point --db-path at a copy of the database, not the original.
  • Use --init-sql to disable external access, following DuckDB’s securing guide.
  • For MotherDuck, use a service account with a read-scaling token.
  • Ask before each execute_query call.

Checked against the vendor documentation on November 25, 2026. mcp-server-motherduck README · MotherDuck docs: remote MCP (linked from the README)

What Excellent covers

Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing