
How to add MotherDuck / DuckDB MCP Server to Cursor
Query local DuckDB files, in-memory DBs, S3, or MotherDuck cloud with read/write SQL. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 15, 2026 · 800★ · stdio · apikey · official
Cursor config for MotherDuck / DuckDB MCP Server
uvx mcp-server-motherduck --db-path md: --read-write{
"mcpServers": {
"motherduck-duckdb-mcp-server": {
"command": "uvx",
"args": [
"mcp-server-motherduck",
"--db-path",
"md:"
],
"env": {
"motherduck_token": "<your-motherduck-token>"
}
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the MotherDuck / DuckDB MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of MotherDuck / DuckDB MCP Server's tools to confirm it's connected.
Before you start
- Python with the `uv`/`uvx` package manager installed (`pip install uv` or `brew install uv`)
- A DuckDB target: nothing for `:memory:`, a path to a local `.duckdb` file, an S3 URL, or `md:` for MotherDuck
- For MotherDuck connections: a MotherDuck access token from your MotherDuck account (app.motherduck.com), set as `MOTHERDUCK_TOKEN`
- For S3 access: AWS credentials (access key / secret key, optional session token and region)
What MotherDuck / DuckDB MCP Server can do in Cursor
execute_queryRun a SQL query in the DuckDB dialect against the active database (read-only unless --read-write is set)
list_databasesEnumerate all attached/available databases
list_tablesList tables and views, optionally scoped to a database/schema
list_columnsShow the columns of a given table or view
switch_database_connectionChange the active database connection at runtime (requires --allow-switch-databases)
Security
The server is read-only by default; only add --read-write when the agent genuinely needs to mutate data. The motherduck_token grants access to your cloud data, so keep it in env vars rather than command-line args.
MotherDuck / DuckDB MCP Server + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the MotherDuck / DuckDB MCP Server config there under the "mcpServers" key and restart the client.
Is MotherDuck / DuckDB MCP Server safe to use with Cursor?
The server is read-only by default; only add --read-write when the agent genuinely needs to mutate data. The motherduck_token grants access to your cloud data, so keep it in env vars rather than command-line args.
Is it read-only by default?
Yes. The server runs in read-only mode unless you explicitly pass the `--read-write` flag, which then permits INSERT/UPDATE/DDL and other write operations.
How do I connect to MotherDuck instead of a local file?
Set `--db-path md:` and provide a `MOTHERDUCK_TOKEN` (env var or `--motherduck-token`). You can get the token from your MotherDuck account settings.
Can it query files in S3?
Yes. Point `--db-path` at an S3 URL (or attach one in SQL) and supply AWS credentials; DuckDB reads Parquet/CSV/JSON directly from the bucket.