# MCP Server Motherduck

> MCP Server Motherduck is an MCP server for databases. Run DuckDB and MotherDuck SQL, browse catalogs and switch databases from an agent. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/motherduckdb/mcp-server-motherduck
- **MCP Registry name:** io.github.motherduckdb/mcp-server-motherduck
- **Categories:** [databases](https://ai-powered.com/categories/databases), [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-11-23

## About

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.

## Features

- **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

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
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.

### Claude Code: Or share it with your project (.mcp.json)

```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 Desktop (claude_desktop_config.json)

```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.

### Cursor (~/.cursor/mcp.json)

```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.

### VS Code (~/.copilot/mcp-config.json)

```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.

### Codex: Add with the CLI (Terminal)

```sh
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
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```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>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```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

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```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.

### Devin Desktop (~/.config/devin/mcp_config.json)

```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.

### Cline (cline_mcp_settings.json)

```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.

### Zed (Zed settings.json)

```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.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```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>"
      }
    }
  }
}
```

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```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.

### Kiro (~/.kiro/settings/mcp.json)

```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.

### Other clients (your client's MCP settings (most use this shape))

```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>"
      }
    }
  }
}
```

## Tools

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_query` (name suggests: changes): Execute SQL in the DuckDB dialect
- `list_databases` (name suggests: reads): List all databases
- `list_tables` (name suggests: reads): List tables and views
- `list_columns` (name suggests: reads): List columns of a table or view
- `switch_database_connection`: Switch to a different database (needs --allow-switch-databases)

## 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.

## Alternatives

- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [dashboard-icons](https://ai-powered.com/mcp/dashboard-icons): dashboard-icons is an open-source MCP server for analytics and data.
- [Google Ads + Meta Ads + SEO/GEO MCP](https://ai-powered.com/mcp/google-ads-meta-ads-seo-geo-mcp): Google Ads + Meta Ads + SEO/GEO MCP is a freemium MCP server for marketing and seo.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [Pitot](https://ai-powered.com/mcp/pitot): Pitot is an open-source MCP server for cloud and infrastructure.
- [World Monitor](https://ai-powered.com/mcp/world-monitor): World Monitor is a freemium MCP server for analytics and data.
- [Australian Economic Data (ABS, RBA & APRA)](https://ai-powered.com/mcp/australian-economic-data-abs-rba-and-apra): Australian Economic Data (ABS, RBA & APRA) is an open-source MCP server for analytics and data.
- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/mcp-server-motherduck
