Query your ClickHouse database server.
Clickhouse mcp server connects ClickHouse to AI assistants that speak the Model Context Protocol. Query your ClickHouse database server.
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 Unavailable with a generic error message if the server cannot connect to ClickHouse
Once connected, the assistant can call these 4 tools directly:
Input — query (string): The SQL query to executetables — Array of table objects for the current pagenext_page_token — Pass this value back to fetch the next page, or null when there are no more tablestotal_tables — Total count of tables that match the supplied filtersThe server is distributed via PyPI as mcp-clickhouse, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.
The server reads 8 environment variables: CLICKHOUSE_HOST, CLICKHOUSE_PORT, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, CLICKHOUSE_ROLE, CLICKHOUSE_SECURE, CLICKHOUSE_VERIFY, CLICKHOUSE_CONNECT_TIMEOUT. Keep credentials in your client's env block or a secrets manager rather than committing them.
Database servers turn schema archaeology and ad-hoc reporting into conversation, which is why they tend to be the second or third server people install. ClickHouse sits in that group, and the shape of its toolset — Input, tables, next_page_token among others — tells you what it is really for. Worth comparing against the other databases servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.
| Tool | What it does |
|---|---|
| Input | query (string): The SQL query to execute. |
| tables | Array of table objects for the current page. |
| next_page_token | Pass this value back to fetch the next page, or null when there are no more tables. |
| total_tables | Total count of tables that match the supplied filters. |
{
"mcpServers": {
"clickhouse": {
"command": "uvx",
"args": ["mcp-clickhouse"],
"env": {
"CLICKHOUSE_HOST": "your-value",
"CLICKHOUSE_PORT": "your-value",
"CLICKHOUSE_USER": "your-value",
"CLICKHOUSE_PASSWORD": "your-value",
"CLICKHOUSE_ROLE": "your-value",
"CLICKHOUSE_SECURE": "your-value",
"CLICKHOUSE_VERIFY": "your-value",
"CLICKHOUSE_CONNECT_TIMEOUT": "your-value"
}
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
| Variable | Description | Required |
|---|---|---|
| CLICKHOUSE_HOST | Endpoint or connection string the server talks to. | Optional |
| CLICKHOUSE_PORT | Configuration value read at startup. | Optional |
| CLICKHOUSE_USER | Configuration value read at startup. | Optional |
| CLICKHOUSE_PASSWORD | Configuration value read at startup. | Optional |
| CLICKHOUSE_ROLE | Configuration value read at startup. | Optional |
| CLICKHOUSE_SECURE | Configuration value read at startup. | Optional |
| CLICKHOUSE_VERIFY | Configuration value read at startup. | Optional |
| CLICKHOUSE_CONNECT_TIMEOUT | Configuration value read at startup. | Optional |
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.