# DuckDB

> In-process analytical SQL over files and Parquet from an AI agent.

[Canonical HTML page](https://top-mcps.com/mcp/duckdb) · [server.json](https://top-mcps.com/mcp/duckdb.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

```json
{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "${motherduck_token}"
      }
    }
  }
}
```

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

```shell
# export motherduck_token=optional-for-cloud-mode
claude mcp add duckdb -- uvx mcp-server-motherduck
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

```json
{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "${motherduck_token}"
      }
    }
  }
}
```

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

```jsonc
{
  "servers": {
    "duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "${motherduck_token}"
      }
    }
  }
}
```

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

```json
{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "${motherduck_token}"
      }
    }
  }
}
```

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

```json
{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-motherduck"
      ],
      "env": {
        "motherduck_token": "${motherduck_token}"
      }
    }
  }
}
```

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "uvx",
          "args": [
            "mcp-server-motherduck"
          ],
          "env": {
            "motherduck_token": "${motherduck_token}"
          }
        }
      }
    ]
  }
}
```

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.duckdb]
command = "uvx"
args = [
  "mcp-server-motherduck",
]
env = { motherduck_token = "${motherduck_token}" }
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

```jsonc
{
  "context_servers": {
    "duckdb": {
      "command": {
        "path": "uvx",
        "args": [
          "mcp-server-motherduck"
        ]
      },
      "env": {
        "motherduck_token": "${motherduck_token}"
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Apps directory`

DuckDB doesn't ship a hosted HTTPS endpoint today. ChatGPT supports remote MCP servers only — to use this server in ChatGPT you'll need to deploy it to a public HTTPS URL first (e.g. via Cloudflare Workers or Vercel) or wait for an official remote build.

```none

```

## At a glance

- **Maintainer:** MotherDuck
- **Transport:** stdio
- **Auth model:** None
- **Required secrets:** motherduck_token
- **Supported clients:** Claude, Cursor, VS Code, Windsurf, Any MCP-compatible client, DuckDB 0.10+
- **License:** MIT
- **Language:** Python
- **Latest version:** latest
- **Last verified:** 2026-05-27
- **GitHub stars:** 484 (fetched 2026-06-02T11:55:52.277Z)
- **Score:** 82/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/motherduckdb/mcp-server-motherduck

## Tools & permissions

| Tool | Description | Args | Side effects |
|------|-------------|------|--------------|
| `query` | Run a DuckDB SQL statement. | `sql: string` | read |
| `attach_file` | Read a CSV / Parquet / JSON file as a queryable view. | `path: string, name?: string` | read |

## Security & scope

- **Access scope:** read-write
- **Sandbox:** Spawns a local DuckDB process. Filesystem reads scoped to the working directory unless you pass absolute paths. Remote reads use whatever AWS / GCS credentials are in the environment — the MCP forwards them, it does not store them.
- **Gotchas:**
  - COPY TO can write files anywhere the process can reach. Run the MCP under a dedicated user if you care about scoping writes.
  - httpfs follows redirects — be aware when querying URLs the model has discovered.
  - MotherDuck mode sends queries to a remote service; the token is in env, so treat it like any other API key.

## Quick answer

**What it does.** Spawns an in-process DuckDB instance and exposes SQL execution against local files, Parquet, CSV, JSON, and (optionally) S3/GCS object storage.

**Best for:**
- Local CSV / Parquet analysis
- Ad-hoc data exploration
- S3 dataset queries
- Quick joins across files
- Data quality checks

**Not for:**
- Multi-user concurrent writes
- Transactional OLTP
- Streaming ingestion

## Description

A community-maintained MCP that wraps DuckDB — the in-process OLAP engine — so an AI agent can run analytical SQL over local files, Parquet, CSV, and remote object storage. No server to set up, no connection string, no auth. Point it at a directory or an S3 bucket and the agent can query terabytes without leaving the conversation.

## Why it matters

DuckDB is the fastest way to put an analytical query engine on a developer machine. As an MCP, it removes the "spin up a warehouse to look at a CSV" workflow entirely.

## Key features

- In-process — no server
- Parquet, CSV, JSON, Arrow native
- S3 / GCS object-store reads
- Window functions and joins
- httpfs extension for remote files

## FAQ

### Do I need a server?

No. DuckDB is in-process — the MCP spawns an instance per session. Files are read directly; no daemon, no port.

### Can it read Parquet on S3?

Yes. Use the httpfs / s3 extension and pass standard AWS env vars. The MCP forwards them. The same works for GCS and Azure Blob with the appropriate extensions.

### Can it write?

Yes — INSERT, CREATE TABLE, COPY TO are all exposed. Because DuckDB is in-process and ephemeral by default, "writes" affect a single conversation's state unless you save to a .duckdb file.

### How does it compare to MotherDuck?

Local DuckDB is the default. Pass a MotherDuck token to query the cloud-attached database from the same session — useful for hybrid workflows where some data is local and some is in the warehouse.

## Changelog

- **2026-05-27** — Refreshed install snippets and fact sheet; verified for 2026.
- **2025-02-20** — Initial directory listing.
