clickhouse-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOG_LEVEL | No | Log level (debug, info, warn, error) | info |
| MCP_API_KEY | No | API key for auth scoping | |
| CACHE_TTL_MS | No | Query cache TTL in milliseconds | 60000 |
| CLICKHOUSE_URL | Yes | ClickHouse server URL | http://localhost:8123 |
| CLICKHOUSE_USER | Yes | ClickHouse username | default |
| MCP_AUTH_SCOPES | No | JSON object defining per-key permission scopes | |
| CLICKHOUSE_DATABASE | Yes | ClickHouse database name | default |
| CLICKHOUSE_PASSWORD | Yes | ClickHouse password |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_tablesA | List all tables in the connected ClickHouse database with their engine type and row count. |
| run_queryA | Execute a read-only SQL query against ClickHouse. Only SELECT, WITH (CTE), SHOW, DESCRIBE, EXISTS, and EXPLAIN statements are allowed. Results are cached for 60s. A maximum row limit of 1000 is enforced (or lower if scoped). |
| describe_tableA | Get the schema of a specific ClickHouse table: column names, types, default expressions, and a sample of up to 3 rows. |
| aggregateA | Build and run a time-windowed aggregation query without writing raw SQL. Specify a table, metric column, aggregation function, and optional time column with interval for grouping. |
| cache_statsA | Show query cache statistics: entry count, max entries, and TTL. |
| clear_cacheA | Clear all cached query results. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
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/sepfazeli/clickhouse-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server