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.
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.
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.
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:
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.
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.
[](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).
Google Cloud remote MCP server for querying BigQuery datasets, inspecting metadata, listing resources, and running governed warehouse analytics through an HTTP endpoint.
Connect Claude to MotherDuck and DuckDB — run SQL queries and explore databases, tables, and columns — with the official MotherDuck Model Context Protocol server.
✓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.
✓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 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.
✓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.