MCP Hub β€Ί Databases & Data β€Ί ClickHouse

ClickHouse MCP server

by ClickHouse Β· io.github.ClickHouse/mcp-clickhouse

Official ClickHouse MCP server for querying and exploring ClickHouse clusters and chDB.

πŸ—„ Databases & DataDockerPythonv0.7.0
Open in MCP HubGitHub repository β†—Website β†—

How to install ClickHouse

Python (uvx)

claude mcp add -e CLICKHOUSE_HOST=<your-clickhouse-host> -e CLICKHOUSE_USER=<your-clickhouse-user> mcp-clickhouse -- uvx mcp-clickhouse==0.7.0

Or add it to your MCP config (Claude Desktop, Cursor, VS Code):

{
  "mcpServers": {
    "mcp-clickhouse": {
      "command": "uvx",
      "args": [
        "mcp-clickhouse==0.7.0"
      ],
      "env": {
        "CLICKHOUSE_HOST": "<your-clickhouse-host>",
        "CLICKHOUSE_USER": "<your-clickhouse-user>"
      }
    }
  }
}

Environment variables:
CLICKHOUSE_HOST (required) – Hostname of the ClickHouse server
CLICKHOUSE_USER (required) – Username for ClickHouse authentication
CLICKHOUSE_PASSWORD – Password for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode
CLICKHOUSE_PORT – ClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise
CLICKHOUSE_SECURE – Use HTTPS to connect to ClickHouse
CLICKHOUSE_VERIFY – Verify SSL certificates
CLICKHOUSE_CA_CERT – Path to a PEM CA bundle for ClickHouse server certificate verification
CLICKHOUSE_CLIENT_CERT – Path to a PEM client certificate for the ClickHouse HTTPS connection
CLICKHOUSE_CLIENT_CERT_KEY – Path to the PEM private key for CLICKHOUSE_CLIENT_CERT
CLICKHOUSE_TLS_MODE – Client certificate mode: mutual, proxy, or strict
CLICKHOUSE_DATABASE – Default database to use
CLICKHOUSE_ROLE – ClickHouse role to activate for the session
CLICKHOUSE_ALLOW_WRITE_ACCESS – Allow write operations (DDL and DML). Queries run read-only by default
CLICKHOUSE_ALLOW_DROP – Allow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, and DETACH PERMANENTLY) when write access is also enabled
CLICKHOUSE_MCP_QUERY_TIMEOUT – Query tool timeout in seconds
CLICKHOUSE_MCP_MAX_WORKERS – Maximum query worker thread pool size

Docker

claude mcp add -e CLICKHOUSE_HOST=<your-clickhouse-host> -e CLICKHOUSE_USER=<your-clickhouse-user> mcp-clickhouse -- docker run -i --rm ghcr.io/clickhouse/mcp-clickhouse:0.7.0

Or add it to your MCP config (Claude Desktop, Cursor, VS Code):

{
  "mcpServers": {
    "mcp-clickhouse": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/clickhouse/mcp-clickhouse:0.7.0"
      ],
      "env": {
        "CLICKHOUSE_HOST": "<your-clickhouse-host>",
        "CLICKHOUSE_USER": "<your-clickhouse-user>"
      }
    }
  }
}

Environment variables:
CLICKHOUSE_HOST (required) – Hostname of the ClickHouse server
CLICKHOUSE_USER (required) – Username for ClickHouse authentication
CLICKHOUSE_PASSWORD – Password for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode
CLICKHOUSE_PORT – ClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise
CLICKHOUSE_SECURE – Use HTTPS to connect to ClickHouse
CLICKHOUSE_VERIFY – Verify SSL certificates
CLICKHOUSE_CA_CERT – Path to a PEM CA bundle for ClickHouse server certificate verification
CLICKHOUSE_CLIENT_CERT – Path to a PEM client certificate for the ClickHouse HTTPS connection
CLICKHOUSE_CLIENT_CERT_KEY – Path to the PEM private key for CLICKHOUSE_CLIENT_CERT
CLICKHOUSE_TLS_MODE – Client certificate mode: mutual, proxy, or strict
CLICKHOUSE_DATABASE – Default database to use
CLICKHOUSE_ROLE – ClickHouse role to activate for the session
CLICKHOUSE_ALLOW_WRITE_ACCESS – Allow write operations (DDL and DML). Queries run read-only by default
CLICKHOUSE_ALLOW_DROP – Allow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, and DETACH PERMANENTLY) when write access is also enabled
CLICKHOUSE_MCP_QUERY_TIMEOUT – Query tool timeout in seconds
CLICKHOUSE_MCP_MAX_WORKERS – Maximum query worker thread pool size

Replace placeholders in <angle brackets> with your own values. Review what a server can access before you enable it.

Details

Version
0.7.0
Published
2026-09-21
Updated
2026-09-21
Namespace
io.github.ClickHouse
Source
ClickHouse/mcp-clickhouse

Similar databases & data servers