MCP.so
登录
服务器

MotherDuck's DuckDB MCP Server

@motherduckdb

Local MCP server for DuckDB and MotherDuck

概览

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.

FAQ from MotherDuck's DuckDB MCP Server

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.

How do I enable write access?

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

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.

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.

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.

标签

来自「数据库」的更多内容