Skip to main content
Glama
io.github.0xmortuex/duckdb-mcp

io.github.0xmortuex/duckdb-mcp

by 0xmortuex

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DUCKDB_MCP_DIRSNoA folder whose data files may be queried, separated by ';' on Windows and ':' elsewhere. Same as --dir. Used when no --dir is given; defaults to the server's current working directory.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Query local CSV, TSV, Parquet, JSON and NDJSON files with SQL (DuckDB). Access is read-only and limited to the folders this server was started with. Start with list_files, then describe_file to see a file's columns and sample rows, then query. In SQL, name a file like SELECT * FROM 'sales.csv' or read_csv('data/sales.csv') (paths are relative to the allowed folders). Results are capped; aggregate in SQL (GROUP BY, COUNT, AVG) instead of pulling raw rows.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_filesA

List the data files you can query (CSV, TSV, Parquet, JSON, NDJSON, optionally .gz).

Shows each file's path relative to its allowed folder, its type and size. Use this first: those paths can be used directly in SQL, e.g. SELECT * FROM 'sales.csv'. Optional pattern is a case-insensitive glob on the path, e.g. '2024' or 'logs/*.json'. At most 500 files are shown.

describe_fileA

Show a file's schema (column names and types), its row count and a few sample rows.

path is relative to an allowed folder (as list_files shows it) or absolute inside one. Column types are DuckDB's auto-detected types, which is what SQL will see. The row count of a CSV/JSON file needs a full scan; Parquet answers from metadata. Use this before writing a query, to get exact column names.

profile_fileA

Profile each column of a file in one pass: type, null %, approximate distinct count, min, max, average, median and the three most common values.

Use it to spot data-quality problems (many nulls, constant columns, odd ranges) before analysing. columns limits it to named columns; otherwise the first 50 columns are profiled. On a very large file this scans everything and can hit the time limit - then profile fewer columns.

sample_fileA

Show a few rows of a file: the first rows (mode='head') or a random sample (mode='random', scans the whole file). Cheaper than describe_file when you only want to see the data. rows is 1 to 100.

queryA

Run one read-only SQL statement (DuckDB dialect) over the data files.

Reference files by name: SELECT * FROM 'sales.csv', or read_csv('sales.csv'), read_parquet('dir/*.parquet'), read_json_auto('events.ndjson'). Paths are relative to the allowed folders (see list_files) or absolute inside them. Allowed: SELECT, WITH, VALUES, FROM-first queries, DESCRIBE, SUMMARIZE, SHOW and EXPLAIN. Anything that writes or reaches outside the allowed folders (INSERT, CREATE, COPY, ATTACH, INSTALL, SET, PRAGMA, files elsewhere on disk, URLs) is rejected.

Output is a markdown table by default; format='csv' or 'json' is more compact for big results. Results stop at the server's row cap (default 1000) with a TRUNCATED notice; pass a smaller max_rows to see less. Queries have a time limit. Prefer aggregation (GROUP BY, COUNT, SUM) over fetching raw rows. Use describe_file first for column names.

explain_queryA

Show DuckDB's execution plan for a SELECT query without returning its rows.

Useful to check whether a filter is pushed down into a Parquet scan, or why a query is slow. With analyze=true the query is actually executed and per-operator timings and row counts are included (still read-only, still time-limited). Same SQL rules and file naming as query.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.3/5.0

Scored across 6 tools

Disambiguation4/5

Each tool has a distinct role: list_files (discovery), describe_file (schema), profile_file (column statistics), sample_file (row preview), query (SQL), explain_query (plan). The main overlap is that describe_file also returns sample rows and profile_file touches type metadata, but descriptions draw clear boundaries (cheaper sampling, stats vs. schema).

Naming Consistency4/5

Five of six names follow a clean verb_noun pattern (list_files, describe_file, profile_file, sample_file, explain_query). The bare 'query' is the sole deviation but is unambiguous in context.

Tool Count5/5

Six tools is well-scoped for a read-only DuckDB query server, each mapping to a distinct step in the analysis workflow. Nothing feels padded or missing.

Completeness5/5

The read-only analytical lifecycle is fully covered: discover files, inspect schema, sample rows, profile columns, run SQL, and explain plans. No write operations exist, consistent with the explicit read-only design, so there are no dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues