Skip to content
MCP server

MCP Server Motherduck

Run DuckDB and MotherDuck SQL, browse catalogs and switch databases from an agent

Runs locally

MCP Server Motherduck is an MCP server for databases. It runs locally on your machine and is started by your AI client.

Platforms
CLI, Self-hosted
Runs
Locally
What it can do
Can change data (1 tool)
Version
1.1.1
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add mcp-server-motherduck --env motherduck_token='<motherduck_token>' --env MOTHERDUCK_TOKEN='<MOTHERDUCK_TOKEN>' --env AWS_ACCESS_KEY_ID='<AWS_ACCESS_KEY_ID>' --env AWS_SECRET_ACCESS_KEY='<AWS_SECRET_ACCESS_KEY>' --env AWS_SESSION_TOKEN='<AWS_SESSION_TOKEN>' -- uvx mcp-server-motherduck

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

{
  "mcpServers": {
    "mcp-server-motherduck": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "<motherduck_token>",
        "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
        "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
        "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
        "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
      }
    }
  }
}

Claude Code setup guide

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mcp-server-motherduck": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "<motherduck_token>",
        "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
        "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
        "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
        "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
      }
    }
  }
}

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-server-motherduck": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "<motherduck_token>",
        "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
        "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
        "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
        "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
      }
    }
  }
}

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "mcp-server-motherduck": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "<motherduck_token>",
        "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
        "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
        "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
        "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
      }
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add mcp-server-motherduck --env motherduck_token='<motherduck_token>' --env MOTHERDUCK_TOKEN='<MOTHERDUCK_TOKEN>' --env AWS_ACCESS_KEY_ID='<AWS_ACCESS_KEY_ID>' --env AWS_SECRET_ACCESS_KEY='<AWS_SECRET_ACCESS_KEY>' --env AWS_SESSION_TOKEN='<AWS_SESSION_TOKEN>' -- uvx mcp-server-motherduck

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.mcp-server-motherduck]
command = "uvx"
args = ["mcp-server-motherduck"]
env = { motherduck_token = "<motherduck_token>", MOTHERDUCK_TOKEN = "<MOTHERDUCK_TOKEN>", AWS_ACCESS_KEY_ID = "<AWS_ACCESS_KEY_ID>", AWS_SECRET_ACCESS_KEY = "<AWS_SECRET_ACCESS_KEY>", AWS_SESSION_TOKEN = "<AWS_SESSION_TOKEN>" }

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mcp-server-motherduck": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "<motherduck_token>",
        "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
        "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
        "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
        "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
      }
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "mcp-server-motherduck": {
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "<motherduck_token>",
            "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
            "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
            "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
          }
        }
      }
    }

    Or run: gemini mcp add -s user -e motherduck_token='<motherduck_token>' -e MOTHERDUCK_TOKEN='<MOTHERDUCK_TOKEN>' -e AWS_ACCESS_KEY_ID='<AWS_ACCESS_KEY_ID>' -e AWS_SECRET_ACCESS_KEY='<AWS_SECRET_ACCESS_KEY>' -e AWS_SESSION_TOKEN='<AWS_SESSION_TOKEN>' mcp-server-motherduck uvx -- mcp-server-motherduck

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "mcp-server-motherduck": {
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "<motherduck_token>",
            "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
            "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
            "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
          }
        }
      }
    }

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

    {
      "mcpServers": {
        "mcp-server-motherduck": {
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "<motherduck_token>",
            "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
            "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
            "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
          }
        }
      }
    }

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

    {
      "mcpServers": {
        "mcp-server-motherduck": {
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "<motherduck_token>",
            "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
            "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
            "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
          }
        }
      }
    }

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "mcp-server-motherduck": {
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "<motherduck_token>",
            "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
            "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
            "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
          }
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "mcpServers": {
        "mcp-server-motherduck": {
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "<motherduck_token>",
            "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
            "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
            "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
          }
        }
      }
    }

    The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "mcp-server-motherduck": {
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "<motherduck_token>",
            "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
            "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
            "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
          }
        }
      }
    }

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

    {
      "mcpServers": {
        "mcp-server-motherduck": {
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "<motherduck_token>",
            "MOTHERDUCK_TOKEN": "<MOTHERDUCK_TOKEN>",
            "AWS_ACCESS_KEY_ID": "<AWS_ACCESS_KEY_ID>",
            "AWS_SECRET_ACCESS_KEY": "<AWS_SECRET_ACCESS_KEY>",
            "AWS_SESSION_TOKEN": "<AWS_SESSION_TOKEN>"
          }
        }
      }
    }

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

Configuration

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

About MCP Server Motherduck

This local server connects an assistant to DuckDB's analytical SQL engine over an in-memory database, a local DuckDB file, an S3-hosted database or MotherDuck. It runs queries in the DuckDB dialect and can ingest from or export to the local filesystem, which the hosted remote MotherDuck server cannot.

The defaults lean cautious. A file connection is read-only and does not hold the file lock, so it can run beside a writer. Write access needs --read-write, and switching databases at runtime needs --allow-switch-databases. Results are capped at 1024 rows and 50,000 characters unless changed.

The README warns that read-only mode alone is not enough when giving third parties access, since local filesystem access and settings changes remain possible, and recommends MotherDuck's remote server for production. Install is through uvx, with a token for MotherDuck connections.

Tools this server provides (5)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 1 of 5 tools changes data; 1 name doesn't say.

From the server's own tool labels and tool names; not verified by us.

execute_queryName suggests: changes
Execute SQL in the DuckDB dialect
list_databasesName suggests: reads
List all databases
list_tablesName suggests: reads
List tables and views
list_columnsName suggests: reads
List columns of a table or view
switch_database_connection
Switch to a different database (needs --allow-switch-databases)

What it does

Multiple backends
In-memory, local file, S3 and MotherDuck connections are supported.
Read-only by default
Writes and database switching must be enabled with flags.
Catalog browsing
List databases, tables, views and columns.
Output limits
Row and character caps keep responses manageable.
One-click Claude bundle
An .mcpb bundle is offered for Claude Desktop.

Good for

  • Query a local DuckDB file in natural language
  • Explore a MotherDuck warehouse's tables
  • Load a CSV into an in-memory database for analysis
  • Export query results to the local filesystem

Pricing

Pricing unknown

MotherDuck connections need a token; licence not published

MCP Server Motherduck FAQ

What tools does MCP Server Motherduck expose?

execute_query, list_databases, list_tables, list_columns and switch_database_connection.

Is MCP Server Motherduck safe for third-party users?

The README says read-only mode alone is not enough and recommends the remote MotherDuck server for that.

Do I need uv?

Yes, install uv first, then run through uvx.

Can MCP Server Motherduck write data?

Yes, with the --read-write flag.

How do I add MCP Server Motherduck to Claude Code?

Run this command in your terminal: claude mcp add mcp-server-motherduck --env motherduck_token='<motherduck_token>' --env MOTHERDUCK_TOKEN='<MOTHERDUCK_TOKEN>' --env AWS_ACCESS_KEY_ID='<AWS_ACCESS_KEY_ID>' --env AWS_SECRET_ACCESS_KEY='<AWS_SECRET_ACCESS_KEY>' --env AWS_SESSION_TOKEN='<AWS_SESSION_TOKEN>' -- uvx mcp-server-motherduck

What are the best alternatives to MCP Server Motherduck?

The closest alternatives to MCP Server Motherduck are Agent-Native Analytics, dashboard-icons, Google Ads + Meta Ads + SEO/GEO MCP, Tapetide - Indian Stock Market MCP and Pitot.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers