ClickHouse
v0.8.0Official ClickHouse MCP server for querying and exploring ClickHouse clusters and chDB.
Values you need
| Variable | What it is | |
|---|---|---|
CLICKHOUSE_HOST | required | Hostname of the ClickHouse server |
CLICKHOUSE_USER | required | Username for ClickHouse authentication |
CLICKHOUSE_PASSWORD | optional secret | Password for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode |
CLICKHOUSE_PORT | optional | ClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise |
CLICKHOUSE_SECURE | optional | Use HTTPS to connect to ClickHouse Default: true |
CLICKHOUSE_VERIFY | optional | Verify SSL certificates Default: true |
CLICKHOUSE_CA_CERT | optional | Path to a PEM CA bundle for ClickHouse server certificate verification |
CLICKHOUSE_CLIENT_CERT | optional | Path to a PEM client certificate for the ClickHouse HTTPS connection |
CLICKHOUSE_CLIENT_CERT_KEY | optional | Path to the PEM private key for CLICKHOUSE_CLIENT_CERT |
CLICKHOUSE_TLS_MODE | optional | Client certificate mode: mutual, proxy, or strict |
CLICKHOUSE_DATABASE | optional | Default database to use |
CLICKHOUSE_ROLE | optional | ClickHouse role to activate for the session |
CLICKHOUSE_ALLOW_WRITE_ACCESS | optional | Allow write operations (DDL and DML). Queries run read-only by default Default: false |
CLICKHOUSE_ALLOW_DROP | optional | Allow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, OPTIMIZE DEDUPLICATE, MODIFY/MATERIALIZE TTL, MODIFY/ALTER COLUMN with TTL, and DETACH PERMANENTLY) when write access is also enabled Default: false |
CLICKHOUSE_MCP_QUERY_TIMEOUT | optional | Query tool timeout in seconds Default: 30 |
CLICKHOUSE_MCP_MAX_WORKERS | optional | Maximum query worker thread pool size Default: 10 |
PyPI (uvx) discovery passed
Requires uv (https://docs.astral.sh/uv/)
Run in a terminal
claude mcp add mcp-clickhouse -e 'CLICKHOUSE_HOST=<CLICKHOUSE_HOST>' -e 'CLICKHOUSE_USER=<CLICKHOUSE_USER>' -- uvx mcp-clickhouse==0.8.0Add to
claude_desktop_config.json{
"mcpServers": {
"mcp-clickhouse": {
"args": [
"mcp-clickhouse==0.8.0"
],
"command": "uvx",
"env": {
"CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
"CLICKHOUSE_USER": "<CLICKHOUSE_USER>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"mcp-clickhouse": {
"args": [
"mcp-clickhouse==0.8.0"
],
"command": "uvx",
"env": {
"CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
"CLICKHOUSE_USER": "<CLICKHOUSE_USER>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "CLICKHOUSE_HOST",
"id": "clickhouse-host",
"password": true,
"type": "promptString"
},
{
"description": "CLICKHOUSE_USER",
"id": "clickhouse-user",
"password": true,
"type": "promptString"
}
],
"servers": {
"mcp-clickhouse": {
"args": [
"mcp-clickhouse==0.8.0"
],
"command": "uvx",
"env": {
"CLICKHOUSE_HOST": "${input:clickhouse-host}",
"CLICKHOUSE_USER": "${input:clickhouse-user}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.mcp-clickhouse]
command = "uvx"
args = ["mcp-clickhouse==0.8.0"]
env = { "CLICKHOUSE_HOST" = "<CLICKHOUSE_HOST>", "CLICKHOUSE_USER" = "<CLICKHOUSE_USER>" }Docker
Requires Docker
Run in a terminal
claude mcp add mcp-clickhouse -e 'CLICKHOUSE_HOST=<CLICKHOUSE_HOST>' -e 'CLICKHOUSE_USER=<CLICKHOUSE_USER>' -- docker run -i --rm -e CLICKHOUSE_HOST -e CLICKHOUSE_USER ghcr.io/clickhouse/mcp-clickhouse:0.8.0Add to
claude_desktop_config.json{
"mcpServers": {
"mcp-clickhouse": {
"args": [
"run",
"-i",
"--rm",
"-e",
"CLICKHOUSE_HOST",
"-e",
"CLICKHOUSE_USER",
"ghcr.io/clickhouse/mcp-clickhouse:0.8.0"
],
"command": "docker",
"env": {
"CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
"CLICKHOUSE_USER": "<CLICKHOUSE_USER>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"mcp-clickhouse": {
"args": [
"run",
"-i",
"--rm",
"-e",
"CLICKHOUSE_HOST",
"-e",
"CLICKHOUSE_USER",
"ghcr.io/clickhouse/mcp-clickhouse:0.8.0"
],
"command": "docker",
"env": {
"CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
"CLICKHOUSE_USER": "<CLICKHOUSE_USER>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "CLICKHOUSE_HOST",
"id": "clickhouse-host",
"password": true,
"type": "promptString"
},
{
"description": "CLICKHOUSE_USER",
"id": "clickhouse-user",
"password": true,
"type": "promptString"
}
],
"servers": {
"mcp-clickhouse": {
"args": [
"run",
"-i",
"--rm",
"-e",
"CLICKHOUSE_HOST",
"-e",
"CLICKHOUSE_USER",
"ghcr.io/clickhouse/mcp-clickhouse:0.8.0"
],
"command": "docker",
"env": {
"CLICKHOUSE_HOST": "${input:clickhouse-host}",
"CLICKHOUSE_USER": "${input:clickhouse-user}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.mcp-clickhouse]
command = "docker"
args = ["run", "-i", "--rm", "-e", "CLICKHOUSE_HOST", "-e", "CLICKHOUSE_USER", "ghcr.io/clickhouse/mcp-clickhouse:0.8.0"]
env = { "CLICKHOUSE_HOST" = "<CLICKHOUSE_HOST>", "CLICKHOUSE_USER" = "<CLICKHOUSE_USER>" }For AI agents
- Ask the user for: CLICKHOUSE_HOST, CLICKHOUSE_USER. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: list_databases, list_tables, run_query.
- If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.
Machine-readable: install.md · manifest.json