ClickHouse

ClickHouse

Query your ClickHouse database server.

599
Stars
137
Forks
0
Releases

Overview

ClickHouse MCP Server exposes management and query capabilities for ClickHouse (and optionally chDB) over the MCP protocol. It provides a set of ClickHouse Tools: run_select_query to execute safe, read-only SQL on a ClickHouse cluster; list_databases to enumerate databases; and list_tables to enumerate tables with pagination and optional filters (like/not_like), with defaults for page size and including detailed column metadata. For data sources beyond a standard ClickHouse cluster, it offers chDB Tools via run_chdb_select_query, which executes SQL using an embedded chDB engine and can pull data directly from files, URLs, or databases without ETL. A health check endpoint at /health is available over HTTP/SSE transport, returning 200 OK with the ClickHouse version if healthy or 503 if unreachable. The server supports both ClickHouse and chDB backends, which can be enabled individually or together through environment configuration. The README also documents configuration, environment variables, and development/testing steps for local setup and MCP Inspector integration.

Details

Owner
ClickHouse
Language
Python
License
Apache License 2.0
Updated
2025-12-07

Features

run_select_query

Execute SQL queries on your ClickHouse cluster. Input: sql (string). All queries are executed with readonly = 1 to ensure safety.

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) to filter table names; page_token (string) for fetching next page; page_size (int, default 50); include_detailed_columns (bool, default true). Response includes tables, next_page_token, total_tables.

run_chdb_select_query

Execute SQL queries using chDB's embedded ClickHouse engine. Input: sql (string). Query data directly from files, URLs, or databases without ETL.

Health Check Endpoint

Health check available at /health for HTTP/SSE transports. Returns 200 OK with the ClickHouse version if healthy, or 503 if unable to connect.

Dual Engine Support

Supports both ClickHouse and chDB backends, and can be enabled individually or together via environment configuration.

Audience

DevelopersDevelop and test MCP integrations for ClickHouse using the server's SQL and health tools.
Database AdministratorsQuery and monitor databases and tables via MCP tools with safety.
Integrations EngineersConfigure and deploy MCP server in environments with ClickHouse and/or chDB.

Tags

ClickHouseMCPClickHouse ToolschDBhealth-checkSQLdatabasestablespagination