mcp-clickhouse
An MCP server for ClickHouse.
What it is and what it does
mcp-clickhouse is an MCP (Model Context Protocol) server that bridges AI assistants and MCP clients to ClickHouse databases. It exposes three main tool categories: ClickHouse tools for executing SQL queries (read-only by default), listing databases, and paginating through tables with optional filtering; chDB tools for running embedded SQL queries directly on files and URLs; and a health check endpoint for orchestrator probes. The server communicates via stdio by default (no auth required) or HTTP/SSE with configurable bearer-token, OAuth/OIDC, or disabled authentication.
The package is designed for integration with Claude Desktop and other MCP-compatible clients. It handles connection pooling via clickhouse-connect, caches responses with cachetools, and manages environment configuration through python-dotenv. Query execution defaults to read-only mode to prevent accidental writes, though write access can be explicitly enabled. The health endpoint returns minimal responses to avoid leaking backend details, with debugging delegated to server logs.
Use it for:
- Enable Claude or other AI assistants to query ClickHouse clusters interactively without direct database access.
- Build MCP-compatible tools that list and explore ClickHouse schemas, databases, and tables with pagination.
- Execute ad-hoc SQL queries against ClickHouse from AI-driven workflows while enforcing read-only mode by default.
- Query data directly from files and URLs using chDB's embedded engine without ETL pipelines.
- Deploy a health-check endpoint for Kubernetes liveness/readiness probes or load balancer monitoring.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
An MCP server that exposes ClickHouse database operations—query execution, database and table listing—as tools for AI assistants and MCP clients, with optional embedded chDB support.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a specific problem—exposing ClickHouse as an MCP tool for AI assistants. Install it if you need Claude or another MCP client to query ClickHouse databases. Ensure Python 3.10+ is available and configure authentication before exposing the server over HTTP/SSE.
Install
mcp-clickhouse on PyPI
pip
pip install mcp-clickhouseuv
uv add mcp-clickhousepoetry
poetry add mcp-clickhouseInstalling mcp-clickhouse
Before you install
Low install friction; pure Python wheel with five runtime dependencies. Actively maintained with recent releases and 851 repository stars. Requires Python 3.10 or later.
License in practice
Apache-2.0 permissive license allows commercial and private use without restriction.
Quickstart
pip install mcp-clickhouse
# Set environment variables
export CLICKHOUSE_HOST="your-host"
export CLICKHOUSE_USER="your-user"
export CLICKHOUSE_PASSWORD="your-password"
# Run the server
mcp-clickhouse
# Or with chDB support:
pip install 'mcp-clickhouse[chdb]'
export CHDB_ENABLED="true"
mcp-clickhouse
Requires Python 3.10 or later. For HTTP/SSE transport, authentication must be configured via CLICKHOUSE_MCP_AUTH_TOKEN, FASTMCP_SERVER_AUTH, or CLICKHOUSE_MCP_AUTH_DISABLED (development only).
Verify before relying
- Whether chDB queries can access remote data sources (files, URLs, databases) without additional setup beyond the optional chdb extra.
- Performance characteristics when listing tables with large page sizes or detailed column metadata enabled.
- Specific ClickHouse cluster versions and configurations tested or supported.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — cachetools, clickhouse-connect, fastmcp, python-dotenv, truststore |
| Maintenance | actively maintained — 28 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 160,029/month — #10,678 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mcp_clickhouse-0.4.1-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
chdbchDB is an in-process SQL OLAP engine powered…
permissive · top 5,000 on PyPI
clickhouse-connectA Python database driver for ClickHouse that…
permissive · top 1,000 on PyPI
chdb-corechdb-core is an in-process SQL OLAP engine…
permissive · top 15,000 on PyPI
postgres-mcpA Model Context Protocol server that connects…
permissive · top 15,000 on PyPI
excel-mcp-serverProvides a Model Context Protocol server that…
unclear · top 15,000 on PyPI
mcp-server-odooAn MCP server that bridges AI assistants like…
copyleft · top 5,000 on PyPI
airflow-clickhouse-pluginProvides Apache Airflow operators and hooks to…
permissive · top 15,000 on PyPI
astro-airflow-mcpProvides AI assistants with programmatic access…
unclear · top 15,000 on PyPI
tilt-mcpTilt MCP Server exposes Tilt development…
permissive · top 15,000 on PyPI
logtail-pythonA Python client library for sending structured…
permissive · top 5,000 on PyPI