mcp-clickhousex
JSON →A read-only MCP server for ClickHouse that supports metadata discovery, parameterized queries, and query analysis.
Install
npx -y @modelcontextprotocol/inspector Tools · 8
- list_profiles List configured profiles. Each entry includes name and optional description.
- get_cluster_properties Get cluster properties and execution limits. Returns ClickHouse server version plus enforced limits (max rows, timeouts) for the profile.
- run_query Execute read-only SELECT or WITH … SELECT. One statement; DML, DDL, SET, SYSTEM, and similar are rejected. Returns {data, row_count} where data is an RFC 4180 CSV string. Pass snapshot=true to persist the result to disk and receive {snapshot_uri, row_count} instead; fetch the CSV via the snapshot resource URI. Max-rows cap; overflow sets truncated and row_limit. Same SQL validation as analyze_query.
- run_show Execute SHOW introspection statement. One statement per call; INTO OUTFILE rejected. Interactive row limits apply (default 500, hard ceiling 1 000). Same timeout as run_query.
- analyze_query Explain read-only SELECT or WITH … SELECT. Returns plan, pipeline, and/or syntax text. Default types plan and pipeline. Uses query timeout and optional database; no max-rows cap unlike run_query.
- list_databases List databases. Rows from system.databases visible to the connection.
- list_tables List tables and views in a database. Rows from system.tables: name, engine, primary_key, sorting_key, partition_key, total_rows, total_bytes for query planning.
- list_columns List columns for a table or view. Rows from system.columns for the resolved database and table.