DuckDB MCP Server

DuckDB MCP Server

duckdb-mcp-server•bymustafahasankhan

An MCP server that gives AI assistants SQL access to DuckDB, including local CSV, Parquet, and JSON files, S3/GCS buckets, and in-memory data.

License: MIT•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Exposes DuckDB tools for running SQL queries, describing schemas, analyzing data statistics, suggesting visualizations, and managing sessions.
  • •Lets the assistant query S3 and GCS buckets directly or cache remote data as local tables.
  • •Provides built-in documentation resources for DuckDB SQL extensions, data import, and visualization patterns.
  • •Can open the database read-only when desired.

BEST FOR

  • •Analyzing local CSV, Parquet, and JSON files with SQL through an AI assistant.
  • •Querying or caching S3 and GCS data for analysis.
  • •Getting quick statistical summaries and chart suggestions for tables.

ABOUT DUCKDB-MCP-SERVER

DuckDB MCP Server is cataloged as an MCP server attributed to mustafahasankhan. An MCP server that gives AI assistants SQL access to DuckDB, including local CSV, Parquet, and JSON files, S3/GCS buckets, and in-memory data. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for DuckDB MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can the database be opened read-only?

Yes, the server has a read-only option that errors if the DuckDB file does not exist.

How are AWS credentials resolved for S3 access?

Credentials can come from environment variables, a named profile, or the default credential chain.

Upstream README

View this exact version on GitHub

README.md · 1bf986977173 · Fetched 2026-11-13 10:03:10 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

DuckDB MCP Server

PyPI - Version PyPI - Python Version PyPI - License

A Model Context Protocol (MCP) server that gives AI assistants full access to DuckDB — query local files, S3 buckets, and in-memory data using plain SQL.

DuckDB Server MCP server

🌟 What is DuckDB MCP Server?


What it does

This server exposes DuckDB to any MCP-compatible client (Claude Desktop, Cursor, VS Code, etc.). The assistant can:

  • Run arbitrary SQL against local CSV, Parquet, and JSON files
  • Query S3 / GCS buckets directly or cache them as local tables
  • Inspect schemas, compute statistics, and suggest visualizations
  • Use DuckDB's analytical SQL extensions (window functions, GROUP BY ALL, SELECT * EXCLUDE, etc.)

Tools

ToolDescription
queryExecute any SQL query. Results capped at 10 000 rows.
analyze_schemaDescribe the columns and types of a file or table.
analyze_dataRow count, numeric stats (min/max/avg/median), date ranges, top categorical values.
suggest_visualizationsSuggest chart types and ready-to-run SQL queries based on column types.
create_sessionCreate or reset a session for cross-call context tracking.

Resources

Three built-in XML documentation resources are always available to the assistant:

Resource URIContent
duckdb-ref://friendly-sqlDuckDB SQL extensions (GROUP BY ALL, SELECT * EXCLUDE/REPLACE, FROM-first syntax, …)
duckdb-ref://data-importLoading CSV, Parquet, JSON, and S3/GCS data; glob patterns; multi-file reads
duckdb-ref://visualizationChart patterns and query templates for time series, bar, scatter, and heatmap

Requirements

  • Python 3.10+
  • An MCP-compatible client

Installation

pip install duckdb-mcp-server

From source:

git clone https://github.com/mustafahasankhan/duckdb-mcp-server.git
cd duckdb-mcp-server
pip install -e .

Configuration

duckdb-mcp-server --db-path <path> [options]
FlagRequiredDescription
--db-pathYesPath to the DuckDB file. Created automatically if it does not exist.
--readonlyNoOpen the database read-only. Errors if the file does not exist.
--s3-regionNoAWS region. Defaults to AWS_DEFAULT_REGION env var, then us-east-1.
--s3-profileNoAWS profile name. Defaults to AWS_PROFILE env var, then default.
--creds-from-envNoRead AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY from environment.

Client setup

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "duckdb": {
      "command": "duckdb-mcp-server",
      "args": ["--db-path", "~/claude-duckdb/data.db"]
    }
  }
}

With S3 access

{
  "mcpServers": {
    "duckdb": {
      "command": "duckdb-mcp-server",
      "args": [
        "--db-path", "~/claude-duckdb/data.db",
        "--s3-region", "us-east-1",
        "--creds-from-env"
      ],
      "env": {
        "AWS_ACCESS_KEY_ID": "YOUR_KEY",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET"
      }
    }
  }
}

Read-only mode

Useful when the database is shared or managed separately:

{
  "mcpServers": {
    "duckdb": {
      "command": "duckdb-mcp-server",
      "args": ["--db-path", "/shared/analytics.db", "--readonly"]
    }
  }
}

Example conversations

Querying a local file

"Load sales.csv and show me the top 5 products by revenue."

SELECT
    product_name,
    SUM(quantity * price) AS revenue
FROM read_csv('sales.csv')
GROUP BY ALL
ORDER BY revenue DESC
LIMIT 5;

Working with S3 data

"Cache this month's signups from S3 and show me a daily breakdown."

-- Step 1: cache the remote data locally
CREATE TABLE signups AS
  SELECT * FROM read_parquet('s3://my-bucket/signups/2026-03/*.parquet',
                             union_by_name = true);

-- Step 2: query the cached table
SELECT
    date_trunc('day', signup_at) AS day,
    COUNT(*)                     AS signups
FROM signups
GROUP BY ALL
ORDER BY day DESC;

Statistical analysis

"Give me a statistical summary of the orders table."

The assistant calls analyze_data("orders") which returns row count, numeric stats per column, date ranges, and top categorical values — no SQL required from you.


AWS credential resolution order

  1. Environment variables (--creds-from-env): AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY
  2. Named profile (--s3-profile): reads ~/.aws/credentials
  3. Credential chain: environment → shared credentials file → instance profile (EC2/ECS)

Development

git clone https://github.com/mustafahasankhan/duckdb-mcp-server.git
cd duckdb-mcp-server

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

pytest

License

Contributions are welcome! Please feel free to submit a Pull Request. MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for DuckDB MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/duckdb-mcp-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage