io.github.0xmortuex/duckdb-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DUCKDB_MCP_DIRS | No | A 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
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| 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 |
| describe_fileA | Show a file's schema (column names and types), its row count and a few sample rows.
|
| 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. |
| 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. |
| 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 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 6 tools
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).
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.
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.
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.