mcp-server-duckdb
@ktanaka101
About mcp-server-duckdb
A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-server-duckdb": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"mcp-server-duckdb",
"--client",
"claude"
]
}
}
}Tools
1Execute any SQL query on the DuckDB database
Overview
What is mcp-server-duckdb?
A Model Context Protocol (MCP) server that enables interaction with a DuckDB database through MCP tools, allowing LLMs to execute SQL queries, manage tables, and inspect schemas. It is designed for local data analysis.
How to use mcp-server-duckdb?
Install via Smithery or configure in Claude Desktop’s JSON file using uvx mcp-server-duckdb --db-path <path>. Optionally add --readonly or --keep-connection flags. The server accepts a single required parameter db-path and two optional flags.
Key features of mcp-server-duckdb
- Execute any SQL query via a single unified
querytool. - Optional read‑only mode using DuckDB’s native protection.
- Optional persistent connection for TEMP objects and faster queries.
- Auto‑creates database file and parent directories (unless readonly).
- Integrates with MCP for LLM‑driven database interaction.
Use cases of mcp-server-duckdb
- LLM‑powered exploratory analysis on local DuckDB files.
- Automated table creation, schema inspection, and data insertion.
- Read‑only query access for security‑sensitive environments.
- Seamless integration with AI assistants for database operations.
FAQ from mcp-server-duckdb
How does read‑only mode differ from read‑write?
In read‑only mode the DuckDB database is opened with read_only=True, preventing any write operations (CREATE, INSERT, UPDATE, DELETE) and refusing to create missing database files. Read‑write mode allows full SQL and auto‑creates missing files.
What are the runtime requirements?
Python with the uv package manager, the DuckDB Python package, and MCP server dependencies.
Where is the database file stored?
The path is specified by the user via the --db-path argument. The server creates the file and any needed parent directories unless --readonly is used and the file does not exist.
Does the server offer separate tools for different operations?
No, it provides a single unified query tool. The LLM generates appropriate SQL for any operation (SELECT, CREATE, INSERT, etc.) without requiring separate endpoints.
What transport does the server use?
It uses stdio-based communication, typical of MCP servers. Debugging is recommended with the MCP Inspector, which can be launched via npx @modelcontextprotocol/inspector.
Frequently asked questions
How does read‑only mode differ from read‑write?
In read‑only mode the DuckDB database is opened with `read_only=True`, preventing any write operations (CREATE, INSERT, UPDATE, DELETE) and refusing to create missing database files. Read‑write mode allows full SQL and auto‑creates missing files.
What are the runtime requirements?
Python with the `uv` package manager, the DuckDB Python package, and MCP server dependencies.
Where is the database file stored?
The path is specified by the user via the `--db-path` argument. The server creates the file and any needed parent directories unless `--readonly` is used and the file does not exist.
Does the server offer separate tools for different operations?
No, it provides a single unified `query` tool. The LLM generates appropriate SQL for any operation (SELECT, CREATE, INSERT, etc.) without requiring separate endpoints.
What transport does the server use?
It uses stdio-based communication, typical of MCP servers. Debugging is recommended with the MCP Inspector, which can be launched via `npx @modelcontextprotocol/inspector`.
Basic information
More Databases MCP servers
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
MCP Server for Milvus
zilliztechModel Context Protocol Servers for Milvus
mcp_mysql_server
xwb602625136Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展

nuzur
nuzur is a model-first database platform for MySQL and PostgreSQL. The MCP server lets any AI assistant or agent (Claude, Cursor, Gemini, or anything else that speaks MCP) design your schema, query your data, generate mi
Elasticsearch/OpenSearch MCP Server
cr7258A Model Context Protocol (MCP) server implementation that provides Elasticsearch and OpenSearch interaction.
Comments