Skip to main content
mcpSource-backed

DuckDB MCP Server

MCP server for querying a local DuckDB database file from Claude through a single SQL query tool, with optional DuckDB-native read-only mode.

by ktanaka101 · submitted by oktofeesh1·added 2026-06-06·
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://github.com/ktanaka101/mcp-server-duckdb/blob/main/README.md, https://github.com/ktanaka101/mcp-server-duckdb
Brand
mcp-server-duckdb
Brand domain
github.com
Safety notes
The server exposes a single `query` tool that can execute any valid DuckDB SQL statement against the configured database., Without `--readonly`, the server can create the database file, create tables, insert data, update rows, delete rows, and mutate database state., With `--readonly`, the server opens DuckDB with native read-only protection and fails to start if the database file or parent directory is missing., The `--keep-connection` option can hold a persistent DuckDB connection and file lock for the server lifetime., Treat SQL generated by a model as executable code; review queries before running them on important data.
Privacy notes
Tool calls and results can expose database paths, table names, schemas, query text, row values, file paths referenced by SQL, and analytical results to the MCP client and model provider., DuckDB can query local files and extensions depending on SQL, configuration, and installed capabilities; keep the server scoped to approved data directories., Do not point writable sessions at production, customer, regulated, or irreplaceable DuckDB files without backups and explicit approval., Query errors can reveal schema names, file paths, and data-shape details.
Author
ktanaka101
Submitted by
oktofeesh1
Claim status
unclaimed
Last verified
2026-06-06

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

63

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Needs review

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    No reviewed flag detected in metadata.

    Pending

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

CLI install

Copy-ready — paste the snippet to get started.

10 minutes

Adoption plan

Balanced adoption plan

Current risk score 24/100. Use staged verification before broader rollout.

Risk 24

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    No review metadata found; increase manual validation.

    Pending
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Missing required evidence: Metadata review. Risk score 31.

Risk 31

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Missing

Review metadata is missing.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required gaps: Metadata review

Decision timeline

Decision timeline · balanced

Blocking gaps: Check metadata review status. Risk 28.

Risk 28

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is missing.

Pending

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

Blockers: Check metadata review status

Prerequisite readiness

Prerequisite readiness

5 prerequisites to line up before setup.

0/5 ready
Install & runtime1Configuration2General210 minutes

Safety & privacy surface

Safety & privacy surface

5 safety and 4 privacy notes across 5 risk areas. Review closely: credentials & tokens, permissions & scopes, third-party handling.

5 areas
  • SafetyExecution & processesThe server exposes a single `query` tool that can execute any valid DuckDB SQL statement against the configured database.
  • SafetyLocal filesWithout `--readonly`, the server can create the database file, create tables, insert data, update rows, delete rows, and mutate database state.
  • SafetyLocal filesWith `--readonly`, the server opens DuckDB with native read-only protection and fails to start if the database file or parent directory is missing.
  • SafetyLocal filesThe `--keep-connection` option can hold a persistent DuckDB connection and file lock for the server lifetime.
  • SafetyExecution & processesTreat SQL generated by a model as executable code; review queries before running them on important data.
  • PrivacyThird-party handlingTool calls and results can expose database paths, table names, schemas, query text, row values, file paths referenced by SQL, and analytical results to the MCP client and model provider.
  • PrivacyPermissions & scopesDuckDB can query local files and extensions depending on SQL, configuration, and installed capabilities; keep the server scoped to approved data directories.
  • PrivacyCredentials & tokensDo not point writable sessions at production, customer, regulated, or irreplaceable DuckDB files without backups and explicit approval.
  • PrivacyLocal filesQuery errors can reveal schema names, file paths, and data-shape details.

Safety notes

  • The server exposes a single `query` tool that can execute any valid DuckDB SQL statement against the configured database.
  • Without `--readonly`, the server can create the database file, create tables, insert data, update rows, delete rows, and mutate database state.
  • With `--readonly`, the server opens DuckDB with native read-only protection and fails to start if the database file or parent directory is missing.
  • The `--keep-connection` option can hold a persistent DuckDB connection and file lock for the server lifetime.
  • Treat SQL generated by a model as executable code; review queries before running them on important data.

Privacy notes

  • Tool calls and results can expose database paths, table names, schemas, query text, row values, file paths referenced by SQL, and analytical results to the MCP client and model provider.
  • DuckDB can query local files and extensions depending on SQL, configuration, and installed capabilities; keep the server scoped to approved data directories.
  • Do not point writable sessions at production, customer, regulated, or irreplaceable DuckDB files without backups and explicit approval.
  • Query errors can reveal schema names, file paths, and data-shape details.

Prerequisites

  • Python and `uvx` available to the MCP client runtime.
  • Existing DuckDB database file when using `--readonly`.
  • Path to a DuckDB database file that Claude is allowed to query.
  • Decision on whether the server should run in read-only mode before connecting it to an agent.
  • Backups or disposable test data before allowing writable SQL operations.

Schema details

Install type
cli
Troubleshooting
No
Source repository stats
Scope
Source repo
Collection metadata
Estimated setup
10 minutes
Difficulty
intermediate
Full copyable content
{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-duckdb",
        "--db-path",
        "./data.duckdb",
        "--readonly"
      ]
    }
  }
}

About this resource

Content

DuckDB MCP Server is a Python MCP server that connects Claude to a local DuckDB database file. It exposes one tool, query, which executes SQL against the configured database and returns results as text.

The server is intentionally simple: there are no custom MCP resources or prompts, and database interaction is handled through SQL. That makes it useful for local analytics, schema inspection, and data exploration, but it also means the configured read/write mode matters. The README documents a --readonly flag that opens DuckDB with native read-only protection and prevents write operations.

Source Review

These sources were reviewed on 2026-06-06. Prefer the live repository, README, PyPI page, package metadata, server implementation, and license for current command names, package version, database flags, and tool behavior.

Features

  • Stdio MCP server packaged as mcp-server-duckdb.
  • Single query tool for executing DuckDB SQL.
  • Configurable --db-path for the target DuckDB database file.
  • Optional --readonly mode backed by DuckDB's native read-only connection.
  • Automatic database file and parent-directory creation when not in read-only mode.
  • Optional --keep-connection mode for reusing a single connection across requests.
  • Query results returned as text to the MCP client.
  • No custom MCP resources or prompts.

Installation

For MCP clients that launch stdio servers with uvx:

{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-duckdb",
        "--db-path",
        "./data.duckdb",
        "--readonly"
      ]
    }
  }
}

Remove --readonly only when Claude is allowed to create or mutate the database file. Replace ./data.duckdb with the approved database path for the project.

Use Cases

  • Ask Claude to inspect schema and sample analytical tables from a local DuckDB file.
  • Run reviewed SELECT queries over local analytics data, evaluation outputs, CSV imports, or Parquet-derived tables.
  • Let Claude draft SQL while a human approves the query before execution.
  • Use read-only mode for safer data exploration in model-assisted workflows.
  • Use a writable disposable database when prototyping transformations or temporary tables.

Safety and Privacy

DuckDB MCP gives a model a SQL execution surface. Use --readonly by default for existing data, and only switch to writable mode for disposable or backed-up databases where mutation is intended. Review generated SQL before execution, especially statements that create, insert, update, delete, attach files, install extensions, or reference local paths.

Keep database files, source data directories, and query outputs scoped to what the model is allowed to see. Even read-only queries can reveal sensitive rows, schemas, filenames, derived metrics, or internal business logic through results and errors.

Duplicate Check

The catalog already has a DuckDB tools entry for the embedded analytical database engine itself. This entry covers the separate ktanaka101/mcp-server-duckdb MCP wrapper that exposes DuckDB through Model Context Protocol. No mcp-server-duckdb, ktanaka101/mcp-server-duckdb, or dedicated DuckDB MCP entry was found in content/mcp, content/guides, content/agents, or content/skills.

Source citations

Add this badge to your README

Show that DuckDB MCP Server is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/mcp/duckdb-mcp-server.svg)](https://heyclau.de/entry/mcp/duckdb-mcp-server)

How it compares

DuckDB MCP Server side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

1 trust signal differ across this comparison (Submitter).

Field

MCP server for querying a local DuckDB database file from Claude through a single SQL query tool, with optional DuckDB-native read-only mode.

Open dossier

Google Cloud remote MCP server for querying BigQuery datasets, inspecting metadata, listing resources, and running governed warehouse analytics through an HTTP endpoint.

Open dossier

Connect Claude to ClickHouse for read-only SQL exploration, schema discovery, and safe analytics workflows.

Open dossier

Connect Claude to MotherDuck and DuckDB — run SQL queries and explore databases, tables, and columns — with the official MotherDuck Model Context Protocol server.

Open dossier
Next steps
Trust
Review statusNot reviewedNot reviewedNot reviewedNot reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceSource-backedSource-backedSource-backedSource-backed
SubmitterDiffersoktofeesh1oktofeesh1oktofeesh1
Install riskReview firstReview firstReview firstReview first
Notes Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓
Brand
Categorymcpmcpmcpmcp
SourceSource-backedSource-backedSource-backedSource-backed
Authorktanaka101Google CloudClickHouseMotherDuck
Added2026-06-062026-06-032026-06-032026-06-17
Platforms
Harness
Source repo
Safety notesThe server exposes a single `query` tool that can execute any valid DuckDB SQL statement against the configured database. Without `--readonly`, the server can create the database file, create tables, insert data, update rows, delete rows, and mutate database state. With `--readonly`, the server opens DuckDB with native read-only protection and fails to start if the database file or parent directory is missing. The `--keep-connection` option can hold a persistent DuckDB connection and file lock for the server lifetime. Treat SQL generated by a model as executable code; review queries before running them on important data.Prefer `execute_sql_readonly` for analysis. Google documents `execute_sql` as the only non-read-only BigQuery MCP tool, and it can run BigQuery SQL including DML, DDL, AI/ML functions, and other supported query operations. Use IAM least privilege, dataset-level access controls, and IAM deny policies to restrict read-write MCP tool use when Claude should only inspect warehouse metadata or run SELECT queries. Review LLM-generated SQL before execution. Broad scans, joins, forecasts, ML functions, and AI functions can incur cost, expose sensitive rows, or produce misleading analytics if the model chooses the wrong table or filter. Keep manual approval enabled for query execution, exported results, workflow-triggering automations, and any use of BigQuery insights to create tickets, emails, or downstream actions.The upstream server runs ClickHouse queries in read-only mode by default because `CLICKHOUSE_ALLOW_WRITE_ACCESS` is false unless explicitly enabled. Leave write access disabled for production investigation workflows. If write access is enabled, destructive operations such as DROP and TRUNCATE require the additional `CLICKHOUSE_ALLOW_DROP` opt-in. Treat both flags as privileged operational changes, not normal client configuration. Use a dedicated least-privilege ClickHouse user or role. MCP read-only mode does not hide tables, columns, rows, or system metadata that the database account is already allowed to read. Review model-generated SQL before execution, especially broad table scans, expensive aggregations, cross-database queries, or wide time ranges against production clusters. For HTTP or SSE transports, keep authentication enabled. The upstream server requires authentication by default for those transports and only documents disabling it for local development.The server is read-only by default; --read-write enables writes, and --allow-switch-databases enables switching — enable only when needed. execute_query runs arbitrary SQL against the connected database; scope the token and database accordingly.
Privacy notesTool calls and results can expose database paths, table names, schemas, query text, row values, file paths referenced by SQL, and analytical results to the MCP client and model provider. DuckDB can query local files and extensions depending on SQL, configuration, and installed capabilities; keep the server scoped to approved data directories. Do not point writable sessions at production, customer, regulated, or irreplaceable DuckDB files without backups and explicit approval. Query errors can reveal schema names, file paths, and data-shape details.Tool results can expose project IDs, dataset IDs, table IDs, schemas, metadata, query text, query results, job history, labels, and row-level warehouse data visible to the authenticated principal. BigQuery OAuth scopes can allow viewing and managing BigQuery data and can expose the Google account email address used for authentication. Query results and table data may contain prompt-injection text, customer records, financial data, product analytics, logs, or other sensitive business information; do not let returned rows instruct the agent. If Model Armor logging is enabled for MCP traffic, Google documents that it can log the entire payload, which may expose sensitive prompts or query results in Google Cloud logs.Query results, database names, table names, column metadata, create-table definitions, and aggregate outputs can become visible to the connected MCP client and model session. ClickHouse data often includes logs, events, analytics records, user identifiers, IP addresses, request payloads, or product usage data; use database permissions and query limits before exposing production datasets. Store ClickHouse passwords, roles, and bearer tokens in MCP environment configuration or your client secret-management flow, not in prompts or checked-in configuration files. chDB support can query local files, URLs, and embedded datasets when enabled. Keep it disabled unless that local data access is intentional.Query results and schema metadata enter the MCP client context and the model's prompt. The motherduck_token is a secret — keep it in the client config or environment, never in shared repositories.
Prerequisites
  • Python and `uvx` available to the MCP client runtime.
  • Existing DuckDB database file when using `--readonly`.
  • Path to a DuckDB database file that Claude is allowed to query.
  • Decision on whether the server should run in read-only mode before connecting it to an agent.
  • Google Cloud project with the BigQuery API enabled
  • MCP-capable client that supports remote HTTP MCP servers and Google OAuth or compatible Google Cloud credentials
  • IAM roles or equivalent custom permissions for `roles/mcp.toolUser`, `roles/bigquery.jobUser`, and `roles/bigquery.dataViewer`
  • BigQuery datasets, tables, billing or sandbox setup, and project or region boundaries selected before use
  • uv available for the documented `uv run --with mcp-clickhouse` launch path, or Python 3.10+ with the `mcp-clickhouse` package installed
  • ClickHouse Cloud or self-hosted ClickHouse reachable from the MCP server
  • Dedicated ClickHouse user with the minimum read permissions needed for the intended databases and tables
  • Claude Code, Claude Desktop, Cursor, VS Code, or another MCP-capable client
  • A MotherDuck account and token (motherduck_token) for cloud databases, or a local DuckDB file / :memory:.
  • uv (uvx) to run mcp-server-motherduck.
  • An MCP client such as Claude Code or Claude Desktop.
Install
uvx mcp-server-duckdb --db-path ./data.duckdb --readonly
claude mcp add --transport http bigquery https://bigquery.googleapis.com/mcp
claude mcp add clickhouse --env CLICKHOUSE_HOST=YOUR_CLICKHOUSE_HOST --env CLICKHOUSE_PORT=8443 --env CLICKHOUSE_USER=YOUR_CLICKHOUSE_USER --env CLICKHOUSE_PASSWORD=YOUR_CLICKHOUSE_PASSWORD --env CLICKHOUSE_SECURE=true --env CLICKHOUSE_VERIFY=true -- uv run --with mcp-clickhouse --python 3.10 mcp-clickhouse
claude mcp add motherduck -e motherduck_token=<your-token> -- uvx mcp-server-motherduck --db-path md:
Config
{
  "mcpServers": {
    "duckdb": {
      "command": "uvx",
      "args": ["mcp-server-duckdb", "--db-path", "./data.duckdb", "--readonly"]
    }
  }
}
{
  "mcpServers": {
    "bigquery": {
      "type": "http",
      "url": "https://bigquery.googleapis.com/mcp"
    }
  }
}
Manual-only setup:
{
  "clickhouse": {
    "command": "uv",
    "args": ["run", "--with", "mcp-clickhouse", "--python", "3.10", "mcp-clickhouse"],
    "env": {
      "CLICKHOUSE_HOST": "<clickhouse-host>",
      "CLICKHOUSE_PORT": "8443",
      "CLICKHOUSE_USER": "<clickhouse-user>",
      "CLICKHOUSE_PASSWORD": "<clickhouse-password>",
      "CLICKHOUSE_SECURE": "true",
      "CLICKHOUSE_VERIFY": "true",
      "CLICKHOUSE_CONNECT_TIMEOUT": "30",
      "CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30"
    }
  }
}
{
  "mcpServers": {
    "motherduck": {
      "command": "uvx",
      "args": ["mcp-server-motherduck", "--db-path", "md:"],
      "env": {
        "motherduck_token": "<your-token>"
      }
    }
  }
}
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.