Skip to main content

Supported Clients

MCP Server MotherDuck works with any MCP-compatible client. Below are setup instructions for popular clients:
ClientConfig LocationOne-Click Install
Claude DesktopSettings → Developer → Edit ConfigDownload .mcpb Bundle
Claude CodeUse CLI commands-
Codex CLIUse CLI commands-
CursorSettings → MCP → Add new global MCP serverInstall in Cursor
VS CodeCtrl+Shift+P → “Preferences: Open User Settings (JSON)“Install with UV
Prerequisites: Install uv package manager via pip install uv or brew install uv

Configuration File Setup

Most MCP clients use a JSON configuration file. The configuration structure is similar across clients, with minor variations in file location.

Basic Configuration Structure

{
  "mcpServers": {
    "<server-name>": {
      "command": "uvx",
      "args": ["mcp-server-motherduck", "<parameters>..."],
      "env": {
        "<ENV_VAR>": "<value>"
      }
    }
  }
}

Client-Specific Setup

Claude Desktop Configuration

Config file location:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
Access via UI:
  1. Open Claude Desktop
  2. Go to Settings → Developer
  3. Click “Edit Config”

Example 1: In-Memory Database (Dev Mode)

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

Example 2: Local DuckDB File (Read-Only)

{
  "mcpServers": {
    "DuckDB (read-only)": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "/absolute/path/to/your.duckdb"
      ]
    }
  }
}

Example 3: MotherDuck (Read-Write)

{
  "mcpServers": {
    "MotherDuck (local, r/w)": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "md:",
        "--read-write"
      ],
      "env": {
        "motherduck_token": "<YOUR_MOTHERDUCK_TOKEN>"
      }
    }
  }
}

One-Click Installation

Download and double-click the .mcpb bundle file to automatically install in Claude Desktop.
After updating the config file, restart Claude Desktop for changes to take effect.

Advanced Configuration Examples

Multiple Database Connections

You can configure multiple MCP server instances to connect to different databases simultaneously:
{
  "mcpServers": {
    "Production MotherDuck": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "md:production_db"
      ],
      "env": {
        "motherduck_token": "<PROD_TOKEN>",
        "MCP_MAX_ROWS": "1024",
        "MCP_QUERY_TIMEOUT": "30"
      }
    },
    "Staging MotherDuck": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "md:staging_db",
        "--read-write"
      ],
      "env": {
        "motherduck_token": "<STAGING_TOKEN>"
      }
    },
    "Local Analytics": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "/Users/you/data/analytics.duckdb",
        "--read-write"
      ]
    },
    "S3 Data Lake": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "s3://my-data-lake/warehouse.duckdb"
      ],
      "env": {
        "AWS_ACCESS_KEY_ID": "<YOUR_KEY_ID>",
        "AWS_SECRET_ACCESS_KEY": "<YOUR_SECRET>",
        "AWS_DEFAULT_REGION": "us-west-2"
      }
    }
  }
}

Development Configuration with Initialization SQL

{
  "mcpServers": {
    "DuckDB Dev": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", ":memory:",
        "--read-write",
        "--allow-switch-databases",
        "--init-sql", "INSTALL httpfs; LOAD httpfs; INSTALL spatial; LOAD spatial;"
      ]
    }
  }
}

HTTP Transport Configuration

{
  "mcpServers": {
    "DuckDB HTTP": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--transport", "http",
        "--host", "127.0.0.1",
        "--port", "8000",
        "--db-path", "md:"
      ],
      "env": {
        "motherduck_token": "<YOUR_TOKEN>"
      }
    }
  }
}

Running from Source (Development)

For contributors or those testing local changes:
{
  "mcpServers": {
    "Local DuckDB (Dev)": {
      "command": "uv",
      "args": [
        "--directory", "/path/to/mcp-server-motherduck",
        "run", "mcp-server-motherduck",
        "--db-path", "md:"
      ],
      "env": {
        "motherduck_token": "<YOUR_MOTHERDUCK_TOKEN>"
      }
    }
  }
}

Common Configuration Patterns

Read-Only Production Database

{
  "mcpServers": {
    "Production (Read-Only)": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "md:production_db",
        "--motherduck-saas-mode"
      ],
      "env": {
        "motherduck_token": "<READ_SCALING_TOKEN>",
        "MCP_MAX_ROWS": "1024",
        "MCP_QUERY_TIMEOUT": "30"
      }
    }
  }
}

Local File with Custom Limits

{
  "mcpServers": {
    "Local Analytics": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "/Users/you/data/analytics.duckdb",
        "--read-write"
      ],
      "env": {
        "MCP_MAX_ROWS": "5000",
        "MCP_MAX_CHARS": "100000",
        "MCP_QUERY_TIMEOUT": "60",
        "MCP_EPHEMERAL_CONNECTIONS": "false"
      }
    }
  }
}

Troubleshooting

Common Issues

The client cannot find the uvx command.Solution: Specify the full path to uvx:
# Find uvx path
which uvx
# Returns: /Users/you/.local/bin/uvx
{
  "mcpServers": {
    "DuckDB": {
      "command": "/Users/you/.local/bin/uvx",
      "args": ["mcp-server-motherduck", "--db-path", ":memory:", "--read-write"]
    }
  }
}
Another process has a write lock on the DuckDB file.Solutions:
  1. Ensure --ephemeral-connections is enabled (default for read-only)
  2. Close other connections to the database
  3. Don’t use --read-write if you only need read access
{
  "mcpServers": {
    "DuckDB": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "/path/to/db.duckdb"
      ],
      "env": {
        "MCP_EPHEMERAL_CONNECTIONS": "true"
      }
    }
  }
}
You’re trying to use :memory: without the --read-write flag.Solution: Add --read-write flag:
{
  "mcpServers": {
    "DuckDB": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", ":memory:",
        "--read-write"
      ]
    }
  }
}
Invalid or missing MotherDuck token.Solutions:
  1. Verify your token is correct
  2. For read-only mode, use a read-scaling token
  3. For read-write mode, use a regular access token
{
  "mcpServers": {
    "MotherDuck": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck",
        "--db-path", "md:",
        "--read-write"
      ],
      "env": {
        "motherduck_token": "<VALID_TOKEN>"
      }
    }
  }
}
The client hasn’t detected the configuration changes.Solution: Restart the client application completely (not just reload window).

Next Steps

Additional Resources

Build docs developers (and LLMs) love