MCP.so
登录

MotherDuck's DuckDB MCP Server

@motherduckdb

基本信息

分类

数据库

许可证

MIT

传输方式

stdio

作者

motherduckdb

关于 MotherDuck's DuckDB MCP Server

Local MCP server for DuckDB and MotherDuck

#ai#duckdb#motherduck

MotherDuck's DuckDB MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "DuckDB (in-memory, r/w)": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path",
        ":memory:",
        "--read-write",
        "--allow-switch-databases"
      ]
    }
  }
}

MotherDuck's DuckDB MCP Server 工具

4

Execute SQL query (DuckDB dialect)

List all databases (useful for MotherDuck or multiple attached DBs)

List tables and views

List columns of a table/view

概览

What is MotherDuck's DuckDB MCP Server?

An MCP server that connects AI assistants and IDEs to DuckDB's analytical SQL engine. It supports local DuckDB files, in-memory databases, S3-hosted databases, and MotherDuck. Users can execute SQL queries, browse database catalogs, and switch between connections at runtime.

How to use MotherDuck's DuckDB MCP Server?

Install uv via pip install uv or brew install uv, then add a JSON configuration to your MCP client’s config file. Use the command uvx mcp-server-motherduck with args like --db-path :memory: for in-memory, --db-path /path/to/file.duckdb for local files, or --db-path md: for MotherDuck. Additional flags control read-write access, database switching, and security.

Key features of MotherDuck's DuckDB MCP Server

  • Execute SQL queries in DuckDB dialect.
  • List databases, tables, and columns.
  • Switch database connections at runtime (requires --allow-switch-databases).
  • Read-only mode by default for safety.
  • Supports local, S3, and MotherDuck databases.
  • Configurable row and character limits for results.

Use cases of MotherDuck's DuckDB MCP Server

  • Analyze local DuckDB files from an AI assistant.
  • Query an in-memory database for development and testing.
  • Connect to MotherDuck for cloud-based analytics.
  • Ingest or export data between remote databases and local filesystem.

常见问题

1

What is the difference between the local and remote MCP server?

The local server runs on your machine and requires installation; the remote server is hosted by MotherDuck with zero setup. Both support read-write, but only the local server can access the local filesystem.

2

How do I enable write access?

Add the `--read-write` flag. Without it, the server runs in read-only mode by default.

3

What are the default settings for database path and access?

The default `--db-path` is `:memory:` (in-memory). The server starts in read-only mode unless `--read-write` is set.

4

How do I connect to MotherDuck?

Set `--db-path md:` and provide a MotherDuck token via the `motherduck_token` environment variable or `--motherduck-token` flag. Use a read-scaling token for read-only access.

5

How do I secure the server for production?

Read-only mode is not sufficient when giving third parties access. Consider using MotherDuck Remote MCP, or self-host with service accounts, read-scaling tokens, SaaS mode (`--motherduck-saas-mode`), and `--init-sql` to apply security settings.

评论

数据库 分类下的更多 MCP 服务器