An MCP server for ClickHouse.
-
run_query- Execute SQL queries on your ClickHouse cluster.
- Input:
query(string): The SQL query to execute. - Queries run in read-only mode by default (
CLICKHOUSE_ALLOW_WRITE_ACCESS=false), but writes can be enabled explicitly if needed.
-
list_databases- List all databases on your ClickHouse cluster.
-
list_tables- List tables in a database with pagination.
- Required input:
database(string). - Optional inputs:
like/not_like(string): ApplyLIKEorNOT LIKEfilters to table names.page_token(string): Token returned by a previous call for fetching the next page.page_size(int, default50): Number of tables returned per page.include_detailed_columns(bool, defaulttrue): Whenfalse, omits column metadata for lighter responses while keeping the fullcreate_table_query.
- Response shape:
tables: Array of table objects for the current page.next_page_token: Pass this value back to fetch the next page, ornullwhen there are no more tables.total_tables: Total count of tables that match the supplied filters.
run_chdb_select_query- Execute SQL queries using chDB's embedded ClickHouse engine.
- Input:
query(string): The SQL query to execute. - Query data directly from various sources (files, URLs, databases) without ETL processes.
- Requires the optional
chdbextra:pip install 'mcp-clickhouse[chdb]'
When running with HTTP or SSE transport, a health check endpoint is available at /health. This endpoint:
- Returns
200 OK(body:OK) if the server is healthy and can connect to ClickHouse - Returns
503 Service Unavailablewith a generic error message if the server cannot connect to ClickHouse