DuckDB Local Analytics

v1.0.0Databasesstable

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.

duckdbmcpmcp-server
Share:
177
Stars
0
Downloads
0
Weekly
0/5

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

Local SQL analytics
Fast data analysis
Embedded database operations
ktanaka101

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 16, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y duckdb-mcp-server

Manual Installation

npx -y duckdb-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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.

2

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"]
    }
  }
}
3

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"]
    }
  }
}
4

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.

5

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.

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.

Quick Config Preview

{ "mcpServers": { "duckdb": { "command": "npx", "args": ["-y", "duckdb-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides