ClickHouse/mcp-clickhouse
Connect ClickHouse to your AI assistants.
What it solves
AI assistants need a structured, secure way to query ClickHouse databases without writing custom integrations. This server exposes standard MCP tools so any MCP client (e.g., Claude Desktop) can run SQL, list databases and tables, and inspect query plans directly—while keeping writes disabled by default.
How it works
It implements the MCP protocol (versions 2026-07-28 and legacy 2024-11-05 through 2025-11-25) and offers three core tools: run_query (execute SQL, with optional named parameters), list_databases, and list_tables (with pagination and filters). It also runs DESCRIBE and EXPLAIN ESTIMATE to check result schemas and estimated reads before running a query. For embedded analytics, an optional chDB tool (run_chdb_select_query) works without an external server. HTTP/SSE transports require authentication (static bearer token or OAuth/OIDC), and a /health endpoint supports orchestrator probes.
Who it’s for
Developers and teams who want to give AI assistants safe, governed access to ClickHouse clusters, or who need a lightweight embedded SQL option via chDB. It is particularly suited for setups using Claude Desktop or other MCP-compatible clients.
Highlights
- Read-only SQL by default (
CLICKHOUSE_ALLOW_WRITE_ACCESS=false), with explicit opt-in for writes. - Parameterized queries using ClickHouse
{name:Type}placeholders, with safe handling of large integers as strings. - Optional
DESCRIBEandEXPLAIN ESTIMATEto preview result schemas and estimated reads before execution. - Paginated table listing with
LIKE/NOT LIKEfilters and up to 1-hour page tokens. - Built-in chDB support for querying files, URLs, and databases without ETL.
- Health check endpoint (
/health) that is unauthenticated and fast, for liveness/readiness probes. - Authentication options: static bearer token, OAuth/OIDC via FastMCP, or disabled for local dev only.
Related
- Project
- Project
- Project
- Project
- Project