MotherDuck MCP Server Setup Guide

Prerequisites
  1. MotherDuck Account and Token

    • Sign up for a MotherDuck account at motherduck.com.
    • Generate an access token via the MotherDuck UI.
    • Store the token securely for use in the configuration.
  2. Install uv

    • Install uv using one of the following methods:
      • Using pip:
        pip install uv
         
      • Using Homebrew:
        brew install uv
         
  3. Claude Desktop (if applicable)

Setting up your MotherDuck Token

  1. Generate and Store Token
    • Generate an access token via the MotherDuck UI.
    • Store the token securely.

Configuration for Claude Desktop

  1. Access Claude Desktop Configuration

    • Open the Claude Desktop app.
    • Navigate to Settings > Developer tab.
    • Click on the Edit Config button.
  2. Edit Configuration File

    • Add the following configuration to your claude_desktop_config.json:
      "mcpServers": {
        "mcp-server-motherduck": {
        "command": "uvx",
        "args": [
        "mcp-server-motherduck",
        "--db-path",
        "md:",
        "--motherduck-token",
        "<YOUR_MOTHERDUCK_TOKEN_HERE>"
        ]
        }
       }
       
    • Replace <YOUR_MOTHERDUCK_TOKEN_HERE> with your actual MotherDuck token.

Testing the Server

  1. Start Server Manually
    • To connect to the default MotherDuck database, run:
      uvx mcp-server-motherduck --db-path md: --motherduck-token <your_motherduck_token>
       
    • For a specific MotherDuck database:
      uvx mcp-server-motherduck --db-path md:your_database_name --motherduck-token <your_motherduck_token>
       
    • For a local DuckDB database:
      uvx mcp-server-motherduck --db-path /path/to/your/local.db
       
    • For an in-memory database:
      uvx mcp-server-motherduck --db-path :memory:
       

Running in SSE Mode

  1. Run Server in SSE Mode
    • Execute the following command:
      npx -y supergateway --stdio "uvx mcp-server-motherduck --db-path md: --motherduck-token <your_motherduck_token>"
       

Troubleshooting

  • Verify your MotherDuck token is correct if you encounter connection issues.
  • Ensure the --home-dir parameter is set correctly for local file access.
  • Check that the uvx command is available in your PATH.
  • If you encounter spawn uvx ENOENT errors, specify the full path to uvx (output of which uvx).
Share this post: