ClickHouse MCP
by ClickHouse
Query ClickHouse databases with natural language for real-time analytics and OLAP
database Python Intermediate Self-hostable Verified
β 200 stars π
Updated: 1mo ago
Description
Official ClickHouse MCP server that gives LLMs direct access to ClickHouse databases for real-time analytics and OLAP queries. Connect your AI assistant to one of the fastest columnar databases in the world and explore billions of rows through natural language. Supports listing databases and tables, describing schemas, and executing read-only SQL queries β all through a secure, controlled interface. Ideal for data exploration, ad-hoc analytics, and building AI-powered dashboards that query ClickHouse in real time.
β Best for
Teams using ClickHouse for analytics who want AI-assisted data exploration
βοΈ Skip if
You need write access to the database or use a different DBMS
π‘ Use cases
- Exploring large analytical datasets through conversational queries
- Running ad-hoc OLAP queries on ClickHouse without writing SQL manually
- Building AI-driven dashboards that pull real-time metrics from ClickHouse
- Investigating data quality issues by inspecting schemas and sample data
π Pros
- β Official project maintained by the ClickHouse team
- β Optimized for ClickHouse's columnar engine β fast queries on billions of rows
- β Simple setup via pip install or uvx with environment variable configuration
- β Read-only query execution ensures safe data exploration
π Cons
- β Requires a running ClickHouse instance with network access
- β Limited to read operations β no data insertion or schema modifications
- β Complex analytical queries may produce large result sets that consume context
π§ Exposed tools (4 tools)
| Tool | Category | Description |
|---|---|---|
| list_databases | discovery | List all available databases in the ClickHouse instance |
| list_tables | discovery | List all tables in a specific database |
| describe_table | discovery | Get the schema and column details of a table |
| execute_query | query | Execute a read-only SQL query against ClickHouse |
β‘ Installation
Prerequisites:
- β’ python v3.10+
- β’ ClickHouse instance credentials (host, user, password)
- β’ API key required
Check Claude Code documentation to configure this MCP server.
π‘ Tips & tricks
Set CLICKHOUSE_HOST, CLICKHOUSE_USER, and CLICKHOUSE_PASSWORD as environment variables. For ClickHouse Cloud, use the secure connection string provided in your cloud console. Start with list_databases and list_tables to orient the LLM before running queries.
π Alternatives
Quick info
- Author
- ClickHouse
- License
- Apache-2.0
- Runtime
- Python 3.10+
- Transport
- stdio
- Category
- database
- Difficulty
- Intermediate
- Self-hostable
- β
- Auth
- β
- Docker
- β
- Version
- latest
- Updated
- Feb 28, 2026
Client compatibility
- β Claude Code
- β Cursor
- β VS Code Copilot
- β Gemini CLI
- β Windsurf
- β Cline
- β JetBrains AI
- β Warp
Platforms
π macOS π§ Linux πͺ Windows