Skip to main content
Glama
chdb-io

chdb-mcp

Official
by chdb-io

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CHDB_MCP_WRITENoIf '1', allows INSERT/CREATE/DROP/ALTERunset
CHDB_MCP_SESSION_PATHNoPersistent session directory (default: ephemeral)empty
CHDB_MCP_FILE_ALLOWLISTNo:-separated path prefixes for opt-in isolationempty (unrestricted)
CHDB_MCP_MAX_RESULT_BYTESNoPer-tool result cap1048576
CHDB_MCP_QUERY_TIMEOUT_SECNoWall-clock cap per query30

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
queryA

Execute an arbitrary SQL statement against the chDB session.

Use ClickHouse SQL dialect. Common formats: JSONCompact (default), CSVWithNames, TabSeparatedWithNames, Pretty. The result is truncated at CHDB_MCP_MAX_RESULT_BYTES (default 1 MiB) and the query is aborted after CHDB_MCP_QUERY_TIMEOUT_SEC seconds (default 30).

Args: sql: Any read-only SQL (SELECT/SHOW/DESCRIBE/EXPLAIN). Writes require CHDB_MCP_WRITE=1. When CHDB_MCP_FILE_ALLOWLIST is set, any table function that isn't on the safe-by-construction list (numbers/values/view/merge/dictionary/etc.) is rejected — that includes file/url/s3/remote/executable/python and every other external-reach function chDB exposes. Use query_file() for files instead. format: Output format passed to chDB. Defaults to JSONCompact.

list_databasesA

List databases visible to the chDB session.

Returns one database name per line (TabSeparated format).

list_tablesA

List tables in a given database.

Args: database: Database name. Must be a plain SQL identifier (letters, digits, underscore — no quotes, dots, or spaces).

describe_tableA

Return column types for a table.

Args: database: Database name (plain identifier). table: Table name (plain identifier).

query_fileA

Query a local file (Parquet/CSV/JSON/…) as if it were a table.

The literal token {file} in sql is substituted with a file('path', 'format') table-function call before execution.

Example::

query_file(
    path="/data/sales.parquet",
    sql="SELECT region, sum(revenue) FROM {file} GROUP BY region",
    format="Parquet",
)

Args: path: Filesystem path. If CHDB_MCP_FILE_ALLOWLIST is set, the resolved path must sit under one of its prefixes. sql: Query body. Must contain the literal placeholder {file}. When CHDB_MCP_FILE_ALLOWLIST is set, the SQL is scanned before substitution; any extra table function call other than the placeholder (e.g. a UNION with file('/etc/passwd', ...) or a stray url()/executable()) is rejected. format: chDB file format hint. Common values: Parquet, CSV, CSVWithNames, JSONEachRow, Arrow.

get_sample_dataA

Return the first N rows of a table.

Args: database: Database name (plain identifier). table: Table name (plain identifier). limit: Maximum rows. Clamped to [1, 1000].

list_functionsA

List SQL functions available in the chDB engine.

Returns name, is_aggregate, case_insensitive, alias_to for each entry in system.functions — useful for agents discovering ClickHouse's 1000+ function library (windowFunnel, quantilesTDigest, -If/-State/-Merge combinators, etc.) in one round trip.

Args: pattern: Optional case-insensitive substring filter on the function name. Plain text only; SQL wildcards and quotes are escaped.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chdb-io/chdb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server