DuckDB Local Analytics
A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities through MCP tools. It would be interesting to have LLM analyze it. DuckDB is suitable for local analysis.
What is DuckDB Local Analytics?
DuckDB Local Analytics is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server implementation for duckdb, providing database interaction capabilities through mcp tools. it would be interesting to have llm analyze it. duckdb is suitable for loc...
A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities through MCP tools. It would be interesting to have LLM analyze it. DuckDB is suitable for local analysis.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Model Context Protocol (MCP) server implementation for Duc
Use Cases
Maintainer
Works with
Installation
NPM
npx -y duckdb-mcp-serverManual Installation
npx -y duckdb-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use DuckDB Local Analytics
mcp-server-duckdb is an MCP server implementation for DuckDB, the fast in-process analytical database. It exposes a single unified query tool that accepts any valid DuckDB SQL statement, enabling AI models to read, analyze, and write to local .duckdb files without a separate database server. Data analysts and developers use it to let Claude run complex analytical SQL queries against local datasets, CSV files, or Parquet files with DuckDB's OLAP performance.
Prerequisites
- Node.js 18 or later installed (for npx runner)
- A DuckDB database file, or a path where one should be created
- An MCP-compatible client such as Claude Desktop or Claude Code
- Optional: read-only flag if you want to prevent write operations
Identify your database file path
Decide on the path to your DuckDB database file. The server will auto-create the file and any parent directories if they do not exist. Use an absolute path to avoid ambiguity.
Add to your Claude Desktop config
Edit claude_desktop_config.json and pass your database file path via the --db-path argument. This is the only required argument.
{
"mcpServers": {
"mcp-server-duckdb": {
"command": "npx",
"args": ["-y", "duckdb-mcp-server", "--db-path", "/absolute/path/to/your/database.duckdb"]
}
}
}Enable read-only mode (optional)
Add the --readonly flag to prevent write operations. This is useful when connecting Claude to a shared or production database file.
{
"mcpServers": {
"mcp-server-duckdb": {
"command": "npx",
"args": ["-y", "duckdb-mcp-server", "--db-path", "/path/to/db.duckdb", "--readonly"]
}
}
}Enable persistent connection (optional)
Add --keep-connection to reuse a single DuckDB connection across the session. This is required if you want to create and query TEMP tables within the same conversation.
Restart your MCP client
Restart Claude Desktop or reload Claude Code. Once connected, Claude can run any DuckDB SQL statement including SELECT, CREATE TABLE, JOIN, aggregations, and window functions.
DuckDB Local Analytics Examples
Client configuration
Register mcp-server-duckdb pointing at a local database file. Adjust the path to match your system.
{
"mcpServers": {
"mcp-server-duckdb": {
"command": "npx",
"args": [
"-y",
"duckdb-mcp-server",
"--db-path",
"/Users/you/data/analytics.duckdb"
]
}
}
}Prompts to try
Run analytical SQL queries against your local DuckDB database using natural language.
- "Show me the top 10 customers by total revenue from my sales table"
- "Create a summary table joining orders and products data and show monthly trends"
- "Load this CSV file into DuckDB and compute descriptive statistics for each column"
- "Find any rows in the transactions table where the amount is more than 3 standard deviations above the mean"
- "Write a SQL query to identify duplicate records in the users table"Troubleshooting DuckDB Local Analytics
Server fails to start with 'database file not found' in read-only mode
In --readonly mode the server will not create a new database file if it is missing. Ensure the file at --db-path already exists before starting, or remove --readonly to allow auto-creation.
TEMP tables disappear between queries
By default the server opens a new connection per query, which clears temporary objects. Add --keep-connection to the args array to reuse a single connection across the session.
Large query results are truncated
The MCP protocol has response size limits. For very large result sets, add a LIMIT clause to your SQL query, or ask Claude to aggregate the data first before returning it.
Frequently Asked Questions about DuckDB Local Analytics
What is DuckDB Local Analytics?
DuckDB Local Analytics is a Model Context Protocol (MCP) server that model context protocol (mcp) server implementation for duckdb, providing database interaction capabilities through mcp tools. it would be interesting to have llm analyze it. duckdb is suitable for local analysis. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install DuckDB Local Analytics?
Install via npm with the command: npx -y duckdb-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with DuckDB Local Analytics?
DuckDB Local Analytics works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is DuckDB Local Analytics free to use?
Yes, DuckDB Local Analytics is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
DuckDB Local Analytics Alternatives — Similar Databases Servers
Looking for alternatives to DuckDB Local Analytics? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up DuckDB Local Analytics in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use DuckDB Local Analytics?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.