# ktanaka101/mcp-server-duckdb [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/ktanaka101/mcp-server-duckdb  
**GitHub Stars:** 178  
**Views:** 6  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ktanaka101-mcp-server-duckdb

## Description
DuckDB database integration with schema inspection and query capabilities

## Tools
Capabilities this server exposes over MCP:

- **query** — Execute any SQL query on the DuckDB database
- **Input** — `query` (string) - Any valid DuckDB SQL statement
- **Output** — Query results as text (or success message for operations like CREATE/INSERT)

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

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

## Documentation

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

_Full upstream README: https://allmcps.com/mcp/ktanaka101-mcp-server-duckdb/readme_

