Skip to content
Skillpedia
βœ“ Official Β· MotherDuck● Free and open sourceπŸ’» LocalπŸ”“ No API keyData and databases

DuckDB / MotherDuck Local MCP Server

Lets your AI agent run SQL on DuckDB files, in-memory data, S3 databases and MotherDuck, and browse tables.

538 stars on GitHubby MotherDuckLicense MITUpdated 24 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add motherduck -- uvx mcp-server-motherduck --transport stdio --port 8000 --host 127.0.0.1 --db-path :memory: --max-rows 1024 --max-chars 50000 --query-timeout -1

What to fill in

NameWhat it isRequired
motherduck_tokenAccess token for MotherDuck connections (alternative to --motherduck-token)No
MOTHERDUCK_TOKENAccess token for MotherDuck connections (alternative to --motherduck-token)No
HOMEUsed by DuckDB for extensions and config. Override with --home-dir if not set.No
AWS_ACCESS_KEY_IDAWS access key for S3 database connectionsNo
AWS_SECRET_ACCESS_KEYAWS secret access key for S3 database connectionsNo
AWS_SESSION_TOKENAWS session token for temporary credentialsNo
AWS_DEFAULT_REGIONAWS region for S3 database connectionsNo
AWS_ENDPOINTAWS endpoint for S3 database connectionsNo

Ready! Now test it

Restart the app and paste one of these requests in the chat:

List all tables in my DuckDB file and show the columns of the biggest one
Run a query that counts orders by month

What it is

This server connects your AI agent to DuckDB, an analytics SQL engine, and to MotherDuck, its cloud service. The agent can run read or write queries, list databases, tables and columns, and switch between connections. It runs on your own computer, so it can also work with local files.

What it can do

  • execute_query: run SQL in the DuckDB dialect
  • list_databases: list attached databases
  • list_tables: list tables and views
  • list_columns: list columns of a table or view
  • switch_database_connection: change database (needs --allow-switch-databases)

When to use

  • β€ΊWhen you want to analyse a local DuckDB file by asking questions in plain words
  • β€ΊWhen you need to query a MotherDuck or S3-hosted database from your AI agent
  • β€ΊWhen you want a scratch in-memory database to try out SQL and data work

What you need

The uv tool (for uvx). A MotherDuck token only if you connect to MotherDuck, and AWS keys only for S3 databases.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

The server is a public project from MotherDuck. MotherDuck itself is a service that needs an account and a token; local DuckDB needs neither.

Is it read-only by default?

Yes. Write access needs the --read-write flag.

Is read-only mode enough to protect my data?

Not for third-party access. The readme says it still allows local filesystem access and settings changes, and recommends MotherDuck Remote MCP for production.

How many rows come back?

By default 1024 rows and 50,000 characters, which you can change with --max-rows and --max-chars.

Is there a hosted version?

Yes. MotherDuck offers a separate remote MCP server with no local setup.

Can I use Docker?

Yes. The readme shows a Docker build that serves the MCP endpoint over HTTP on port 8000.

If it does not work

  • β€ΊIf you see spawn uvx ENOENT, give the full path to uvx (find it with which uvx)
  • β€ΊIf the file is locked, keep --ephemeral-connections on (the default) and do not connect in read-write mode
  • β€ΊFor MotherDuck, check that the motherduck_token environment variable is set

5 new skills a week. 1 minute to read.