Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
MCP server for DuckDB enabling database interaction via Model Context Protocol tools, ideal for local data analysis with LLMs.
GitHub MCP Server enables advanced automation and interaction capabilities for developers and tools using Model Context Protocol.
A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities through MCP tools. It allows Language Models (LLMs) to analyze local data stored in DuckDB.
This server enables interaction with a DuckDB database through the Model Context Protocol, allowing for database operations like querying, table creation, and schema inspection. It's designed to facilitate local data analysis using LLMs.
The server implements the following database interaction tool:
query
(string) - Any valid DuckDB SQL statementThe server provides a single unified query
function rather than separate specialized functions, as modern LLMs can generate appropriate SQL for any database operation (SELECT, CREATE TABLE, JOIN, etc.) without requiring separate endpoints.
When the server is running in readonly
mode, DuckDB's native readonly protection is enforced. This ensures that the Language Model (LLM) cannot perform any write operations (CREATE, INSERT, UPDATE, DELETE), maintaining data integrity and preventing unintended changes.
--readonly
is specified and the database file doesn't exist, the server will fail to start with an errorread_only=True
, preventing any write operations.uv
package managerDebugging MCP servers can be challenging due to their stdio-based communication. We recommend using the MCP Inspector for the best debugging experience.
Install the inspector using npm:
npx @modelcontextprotocol/inspector uv --directory ~/codes/mcp-server-duckdb run mcp-server-duckdb --db-path ~/mcp-server-duckdb/data/data.db
Open the provided URL in your browser to access the debugging interface
The inspector provides visibility into: