MCP Server Duckdb logo

MCP Server Duckdb

by ktanaka101

Query and modify a DuckDB file through one MCP SQL tool, with optional schema inspection and read-only protection.

Install MCP Server Duckdb

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ktanaka101-mcp-server-duckdb": {
      "command": "uvx",
      "args": [
        "mcp-server-duckdb"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio ktanaka101-mcp-server-duckdb -- uvx mcp-server-duckdb

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

uvx mcp-server-duckdb

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The ktanaka101/mcp-server-duckdb MCP server connects an MCP client to a DuckDB database file through a single SQL query tool. It accepts valid DuckDB statements and returns query results as text or a success message for operations such as creating tables and inserting data. SQL can also be used for schema inspection, joins, and other database operations. Choose it for local DuckDB analysis or when an agent needs controlled database access, including a read-only mode.

Use cases

  • Query local DuckDB datasets with an MCP client
  • Inspect tables and schema through SQL
  • Create tables and insert data when writes are enabled
  • Protect a DuckDB file with read-only mode

Key features

  • Unified SQL query tool
  • DuckDB schema inspection through SQL
  • Optional native read-only protection
  • Optional persistent connection reuse
  • Automatic database path creation in normal mode

Tools3

What MCP Server Duckdb lets your agent do. Expand a tool for its parameters.

Self-reported~46 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

35/35 checks healthy over the last 115d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · mcp-server-duckdb (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars178Stargazers on the source repository.
Last commit1y agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Tools exposed3Callable tools this server registers over MCP.
Directory activity6 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Server Duckdb works

What ktanaka101/mcp-server-duckdb MCP server does

The ktanaka101/mcp-server-duckdb MCP server exposes a DuckDB database through the Model Context Protocol. Its main capability is executing SQL against a database file selected at startup. The same interface supports reading data, creating tables, inserting rows, updating or deleting records, and inspecting database structure through appropriate DuckDB SQL statements.

The package is suited to local analysis workflows where an MCP-compatible client needs access to DuckDB. It does not provide separate tools for individual operations. Instead, the agent sends a SQL string to one unified query tool, and the server returns result rows as text or a success message when the statement does not produce rows.

How it works

The server receives a query argument containing a valid DuckDB SQL statement. Queries can include ordinary selections, joins, table definitions, data modification, and schema-related statements supported by DuckDB. No custom MCP resources or prompts are implemented.

By default, the database connection permits writes. Passing the read-only option opens DuckDB with native read-only protection, blocking operations such as CREATE, INSERT, UPDATE, and DELETE. The server can also reuse one connection for its full lifetime. This enables temporary objects and may make queries slightly faster, but it can keep an exclusive lock on the database file.

Setup and configuration

Install the ktanaka101/mcp-server-duckdb MCP server through Smithery or run it with uvx. Startup requires a --db-path value identifying the DuckDB file. If the path and its parent directories do not exist, the server creates them in normal mode. With read-only mode enabled, a missing database file causes startup to fail rather than creating a new file.

A Claude Desktop configuration can launch the server with uvx, the package name, and the database path. Replace the example path with the location of the database you want to expose. The repository documents configuration locations for both macOS and Windows.

Optional startup flags include:

  • --readonly to prevent database writes.
  • --keep-connection to reuse one connection and support temporary objects.

For development, the project lists Python, uv, the DuckDB Python package, and MCP dependencies as prerequisites. The MCP Inspector can be used to view requests, responses, tool execution, server state, and errors.

Tools and capabilities

The ktanaka101/mcp-server-duckdb MCP server provides one tool:

  • query: accepts query as a string containing any valid DuckDB SQL statement and returns result text or an operation-success message.

This single tool can support data retrieval, table creation, data changes when writes are enabled, joins, and schema inspection through SQL.

Limitations and notes

There are no custom resources or prompts. All database interaction goes through the SQL query tool, so the client or agent must produce valid DuckDB SQL. Read-only protection applies only when the server is started with the corresponding option. The keep-connection mode may hold an exclusive file lock, which matters when other processes need access to the database.

The ktanaka101/mcp-server-duckdb MCP server requires a database path at startup. A nonexistent path is created only in normal write-enabled mode.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Server Duckdb

The documented options are Smithery installation or launching the package with `uvx`. The server requires a `--db-path` argument.

Yes. The README provides Claude Desktop setup instructions using `uvx` and a configured DuckDB path.

Start it with the `--readonly` flag. DuckDB then opens the file with read-only protection and write statements are prevented.

It provides one `query` tool that accepts a DuckDB SQL string and returns query results as text or a success message.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Server Duckdb AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ktanaka101-mcp-server-duckdb?style=directory)](https://allmcps.com/mcp/ktanaka101-mcp-server-duckdb)
HTML Embed
<a href="https://allmcps.com/mcp/ktanaka101-mcp-server-duckdb"><img src="https://allmcps.com/api/badge/ktanaka101-mcp-server-duckdb?style=directory" alt="MCP Server Duckdb on AllMCPs" /></a>