mcp-clickhouse
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CLICKHOUSE_HOST | Yes | The host address of the ClickHouse server | |
| CLICKHOUSE_PORT | Yes | The port number of the ClickHouse server | |
| CLICKHOUSE_USER | Yes | The username to connect to the ClickHouse server | |
| CLICKHOUSE_PASSWORD | Yes | The password to connect to the ClickHouse server |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_databasesA | List available ClickHouse databases |
| list_tablesA | List available ClickHouse tables in a database, including schema, comment, row count, and column count. Integers outside [-9007199254740991, 9007199254740991] in table metadata are returned as decimal strings. Pagination tokens are single-use and retained for up to one hour. |
| run_queryA | Execute SQL queries in ClickHouse. Queries run in read-only mode by default. Bind optional params by name with {name:Type} placeholders, such as {name:String} or {vector:Array(Float32)}. Values may be JSON scalars, nulls, or arrays. Pass exact large integers as decimal strings. JSON lists and objects cannot bind to Tuple and Map types. Python percent formatting and $name$ raw binary parameters are not supported. Parameter values stay out of the MCP server's normal SQL log lines, but may appear in errors and backend logs. Set CLICKHOUSE_ALLOW_WRITE_ACCESS=true to allow DDL and DML operations. Set CLICKHOUSE_ALLOW_DROP=true to additionally allow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE TABLE/PARTITION, CREATE OR REPLACE, CLEAR COLUMN/INDEX/PROJECTION, DETACH PERMANENTLY). That gate is a best-effort accident guard, not a security boundary. Integers outside [-9007199254740991, 9007199254740991] are returned as decimal strings. Two optional checks also run through this tool. Use DESCRIBE () when you need a query's output columns and types; it inspects the result schema and surfaces analysis errors such as an unknown column, but a query that describes cleanly can still fail at runtime. Consider EXPLAIN ESTIMATE before a SELECT that could be expensive; it returns the estimated parts, rows and marks read from MergeTree family tables, which is not run time and not result size. Neither runs the query body, though analysis can execute scalar subqueries. |
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 3 tools
The three tools have clearly distinct purposes: listing databases, listing tables with metadata, and executing SQL queries. There is no realistic ambiguity about which tool an agent should choose for a given operation.
All tool names follow a consistent verb_noun snake_case pattern: list_databases, list_tables, and run_query. This makes the tool surface predictable and easy to navigate.
Three tools is a compact but well-scoped set for a database MCP server: discovery of databases, discovery of tables, and execution of SQL. Each tool earns its place and there is no redundancy.
The set covers the full workflow of exploring and querying a ClickHouse instance: list databases, inspect table schemas, then run queries. Advanced operations such as EXPLAIN and DESCRIBE are accessible through run_query, with write operations config-gated, so there are no obvious dead ends.