Labsco
MCP SERVER

MotherDuck

by motherduckdb

Run SQL against a local DuckDB file or a MotherDuck database and read the schema — including the comments on tables and columns — through the same connection.

Relational SQL DatabasesVerified
Summary
Schema comments reach the model, so the first query is written against documented columns rather than guessed ones.

Listing tables and columns returns the comments alongside the names and types, which is the difference between a model inventing what status means and reading it. The safety posture is set once at startup — read-only by default, writes and database switching each their own flag — and holds for every database the session reaches afterwards.

What it is

A SQL front end to DuckDB and MotherDuck: execute queries, describe what is in the database, and move the connection between databases mid-session. It reads local files, in-memory databases, DuckDB files on S3, and MotherDuck, and it starts read-only unless you say otherwise.

What you get
  • SQL execution where unqualified table names resolve against the current database and schema, so fully qualified names are only needed once several databases are attached
  • The databases available on the connection, which is what tells you whether you are looking at one attached file, several, or MotherDuck
  • Tables and views listed with the comments stored against them, and columns listed with their types and comments — the documentation a model needs before it writes a query
  • A connection switch to another database at runtime, by absolute path for a local file, available only when the server was started with that switch enabled
  • Read-only by default, with --read-write as the deliberate opt-in, and a SaaS mode that shuts off local filesystem access entirely
  • Results bounded so a wide query cannot flood the context: 1024 rows and 50000 characters by default, both adjustable, with an optional query timeout
  • A SQL file or statement run at startup, for attaching databases or setting up extensions before the first question
Requirements

Uv, and a database to point at — --db-path takes :memory:, a file path, an s3:// path or md: for MotherDuck, and defaults to an in-memory database. MotherDuck needs a token in motherduck_token, and in read-only mode it specifically needs a read-scaling token; an ordinary token requires --read-write. S3 paths use the usual AWS environment variables. Switching databases mid-session only works if the server was started with --allow-switch-databases, and the read-only or read-write mode it started in follows the connection wherever you switch it. MotherDuck also runs a fully hosted remote server if you would rather not install anything. MIT licensed.

Setup effort

One command plus a key — uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databases, then supply credentials