ClickHouse
io.github.ClickHouse/mcp-clickhouse
About ClickHouse
ClickHouse is an MCP server published by the GitHub account ClickHouse. Official ClickHouse MCP server for querying and exploring ClickHouse clusters and chDB.
It runs on your own machine: your AI client starts it from the PyPI package mcp-clickhouse at version 0.7.0.
It asks for one secret: CLICKHOUSE_PASSWORD. Give it a key with the least access that still works.
It also needs CLICKHOUSE_HOST and CLICKHOUSE_USER set before it starts.
Version 0.7.0 was published on 21 September 2026, and the source code is public, so you can read it before installing.
Written from the registry entry. 9 automated checks on the registry entry and the package code: 7 pass, 0 warn, 0 fail, 2 info. How we check.
What it asks for
| Variable | Required | Secret | Description |
|---|---|---|---|
CLICKHOUSE_HOST | Yes | No | Hostname of the ClickHouse server |
CLICKHOUSE_USER | Yes | No | Username for ClickHouse authentication |
CLICKHOUSE_PASSWORD | No | Yes | Password for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode |
CLICKHOUSE_PORT | No | No | ClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise |
CLICKHOUSE_SECURE | No | No | Use HTTPS to connect to ClickHouse |
CLICKHOUSE_VERIFY | No | No | Verify SSL certificates |
CLICKHOUSE_CA_CERT | No | No | Path to a PEM CA bundle for ClickHouse server certificate verification |
CLICKHOUSE_CLIENT_CERT | No | No | Path to a PEM client certificate for the ClickHouse HTTPS connection |
CLICKHOUSE_CLIENT_CERT_KEY | No | No | Path to the PEM private key for CLICKHOUSE_CLIENT_CERT |
CLICKHOUSE_TLS_MODE | No | No | Client certificate mode: mutual, proxy, or strict |
CLICKHOUSE_DATABASE | No | No | Default database to use |
CLICKHOUSE_ROLE | No | No | ClickHouse role to activate for the session |
CLICKHOUSE_ALLOW_WRITE_ACCESS | No | No | Allow write operations (DDL and DML). Queries run read-only by default |
CLICKHOUSE_ALLOW_DROP | No | No | Allow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, and DETACH PERMANENTLY) when write access is also enabled |
CLICKHOUSE_MCP_QUERY_TIMEOUT | No | No | Query tool timeout in seconds |
CLICKHOUSE_MCP_MAX_WORKERS | No | No | Maximum query worker thread pool size |
Checks
| Check | Result | Detail |
|---|---|---|
| Source repository linked | Pass | https://github.com/ClickHouse/mcp-clickhouse |
| Version pinned | Pass | Every package has an explicit version |
| Secrets requested | Info | Asks for 1 secret: CLICKHOUSE_PASSWORD |
| Known package registry | Pass | All packages come from npm, PyPI, OCI, NuGet or MCPB |
| Namespace ownership | Info | Name verified via GitHub account ClickHouse |
| Registry text aimed at the AI | Pass | Description and settings contain no hidden characters or instructions to the AI |
| Install scripts | Pass | mcp-clickhouse 0.7.0 has no setup.py; nothing runs at install |
| Code red flags | Pass | Read 59 files in mcp-clickhouse 0.7.0: no obfuscation, encoded execution, credential reads or data-collection endpoints found |
| Text aimed at the AI | Pass | No hidden characters or instructions to the AI in 59 files, including comments and the README |
Code review: Pass, with notes
We read all 4,092 lines in 17 files of mcp-clickhouse 0.7.0 on 2026-10-31, without running it.
Lets an AI list and query your ClickHouse databases. It only talks to the ClickHouse server you configure, has no telemetry, and is read-only by default with the database itself enforcing it. Its startup instructions suggest the AI install ClickHouse's 'agent skills' with an npx command, which you may not want an agent to run on its own. The optional chDB engine can read files and websites from your computer, so enable it only if you need it.
What we found
- Note Server instructions sent to every client suggest the AI run 'npx -y skills add clickhouse/agent-skills --all', which downloads and executes code from GitHub. It is phrased as 'consider' and points at the vendor's own repo, but an agent with shell access might act on it without asking the user.
mcp_clickhouse/skills_advisor.py:3-10 - Note Opt-in chDB tool (CHDB_ENABLED=true) runs any SQL in-process with no read-only setting. Its table functions (file, url, s3, postgresql, mysql) can read/write local files and reach any network host from the user's machine.
mcp_clickhouse/chdb_backend.py:46-66 - Note run_query runs arbitrary SQL by design. Read-only is the default and is properly enforced server-side by sending readonly=1 with every query unless CLICKHOUSE_ALLOW_WRITE_ACCESS=true. With writes on, the DROP/DELETE gate is a regex that the code itself calls best-effort; real protection is the ClickHouse user's grants.
mcp_clickhouse/clients.py:418-470; queries.py:106-136 - Info Full query text is logged at INFO to stderr (bound parameter values are kept out of these log lines).
mcp_clickhouse/queries.py:316,364; chdb_backend.py:70 - Info truststore.inject_into_ssl() switches all Python TLS in the process to the OS certificate store (disable with MCP_CLICKHOUSE_TRUSTSTORE_DISABLE=1). CLICKHOUSE_VERIFY=false can turn off certificate verification (opt-in only).
mcp_clickhouse/__init__.py:18-23; mcp_env.py:261-266 - Info HTTP/SSE mode is well protected: it refuses to start without an auth mode, binds 127.0.0.1 by default, and validates Host and Origin headers. /health is intentionally unauthenticated and returns only OK/error.
mcp_clickhouse/auth.py:420-477; http_security.py; transport.py - Info MCP_MIDDLEWARE_MODULE lets the operator load arbitrary Python into the server. Expected for an extension hook, but anyone who controls the env controls the process.
mcp_clickhouse/mcp_middleware_hook.py:10-17 - Info pyproject.toml was not among the reviewed files; dependencies listed come from imports. Line counts use the manifest convention (newline count + 1 per file, i.e. the empty segment after a final newline is counted); every line of every file was read with the Read tool.
(package)
| Talks to | the configured ClickHouse server (CLICKHOUSE_HOST:CLICKHOUSE_PORT over HTTP/HTTPS): SQL queries and bound params, username/password or client certificate, client_name mcp_clickhouse, plus SHOW GRANTS once when writes are enabled and drops are not (lazily on tool calls (list_databases, list_tables, run_query) and on the /health route in HTTP mode; client cached afterwards) OAuth/OIDC provider configured via FASTMCP_SERVER_AUTH (Auth0, Azure, GitHub, Google, WorkOS, etc.): provider client ID/secret and token verification requests (FastMCP dependency behaviour) (only in HTTP/SSE mode with that auth option, when clients authenticate) any URL/S3/database named in chDB SQL: requests chosen by the query, made from the user's machine (only if CHDB_ENABLED=true and the model's SQL uses url()/s3()/postgresql()/mysql() table functions) |
|---|---|
| Keys and settings | CLICKHOUSE_HOST, CLICKHOUSE_PORT, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, CLICKHOUSE_ROLE, CLICKHOUSE_DATABASE, CLICKHOUSE_PROXY_PATH, CLICKHOUSE_SERVER_HOST_NAME: the configured ClickHouse serverCLICKHOUSE_SECURE, CLICKHOUSE_VERIFY, CLICKHOUSE_CA_CERT, CLICKHOUSE_CLIENT_CERT, CLICKHOUSE_CLIENT_CERT_KEY, CLICKHOUSE_TLS_MODE: local TLS settings (client cert presented to ClickHouse)CLICKHOUSE_ALLOW_WRITE_ACCESS, CLICKHOUSE_ALLOW_DROP, CLICKHOUSE_ENABLED, CLICKHOUSE_CONNECT_TIMEOUT, CLICKHOUSE_SEND_RECEIVE_TIMEOUT: not sent; local switchesCLICKHOUSE_MCP_AUTH_TOKEN: not sent; used locally to verify bearer tokens on the HTTP transportFASTMCP_SERVER_AUTH and FASTMCP_SERVER_AUTH_<PROVIDER>_* (client secrets): the chosen OAuth providerCLICKHOUSE_MCP_SERVER_TRANSPORT, CLICKHOUSE_MCP_BIND_HOST/PORT, CLICKHOUSE_MCP_ALLOWED_HOSTS/ORIGINS, CLICKHOUSE_MCP_TRUSTED_PROXIES, CLICKHOUSE_MCP_AUTH_DISABLED, CLICKHOUSE_MCP_QUERY_TIMEOUT, CLICKHOUSE_MCP_MAX_WORKERS, CHDB_ENABLED, CHDB_DATA_PATH, MCP_CLICKHOUSE_TRUSTSTORE_DISABLE, MCP_MIDDLEWARE_MODULE: not sent; local settings |
| Files on your machine | Loads .env from the package directory upward (auth.py:213-248) and from the working directory (auth.py:266). Reads the TLS certificate files configured by the user. With chDB enabled, keeps chDB data at CHDB_DATA_PATH (default in-memory), and chDB SQL can read and write local files via file() and sqlite(). No other file access. |
| Runs programs | No shell or eval. Operator-controlled dynamic imports: MCP_MIDDLEWARE_MODULE imports any named Python module (mcp_middleware_hook.py:10-17), and FASTMCP_SERVER_AUTH imports a class path (auth.py:358). Neither is reachable from tool input. |
| Telemetry | None. The client identifies itself to the user's ClickHouse server as client_name=mcp_clickhouse. |
| Tools | list_databases, list_tables, run_query, run_chdb_select_query (only with CHDB_ENABLED=true) |
| Tool descriptions | Tool descriptions are clean and unusually candid (they say the drop gate is 'not a security boundary'). Server instructions (skills_advisor.py:3-10) recommend the AI install ClickHouse Agent Skills by running 'npx -y skills add clickhouse/agent-skills --all'. That nudges the agent to download and run third-party code, though the text is visible and points at ClickHouse's own GitHub repo. The opt-in chdb_initial_prompt tells the AI to fall back to downloading data with Python and to show only key results. No hidden or invisible text. |
This covers the package's own code only, not the 11 packages it depends on (fastmcp, mcp, clickhouse-connect, python-dotenv, pydantic, cachetools, simplejson, starlette, uvicorn, truststore, chdb (optional extra)). A new version drops this review until we read it again.
Popularity & health: 90 / 100
Worked out from public numbers and our own checks, not from user reviews or ratings. It says how used and how looked-after a server is, not whether it is safe.
210 forks, 94 merged pull requests. Sources: GitHub, npm, PyPI (pypistats.org) and Hacker News (Algolia), fetched 2026-10-31.
What people say
3 Hacker News threads linking to the source code. We link to them and copy nothing.
- ClickHouse MCP 2 points, 0 comments, 2025-06-18
- ClickHouse MCP 1 points, 0 comments, 2025-08-10
- Show HN: Model Context Protocol (MCP) Server for ClickHouse 1 points, 0 comments, 2025-01-09
Look further: search Reddit, search Hacker News, read its GitHub issues. These are not reviews we checked.
Facts
| Registry name | io.github.ClickHouse/mcp-clickhouse |
|---|---|
| Publisher | GitHub account ClickHouse |
| How the name is verified | Name verified via GitHub account ClickHouse. The registry ties the name prefix to that account or domain; it does not check the code. |
| Type | Local: runs on your machine from a package |
| Packages | pypi mcp-clickhouse 0.7.0 (stdio)oci ghcr.io/clickhouse/mcp-clickhouse:0.7.0 no version given (stdio) |
| Version | 0.7.0 |
| Published | |
| Last updated | |
| Source repository | https://github.com/ClickHouse/mcp-clickhouse |
| Website | https://clickhouse.com |
| Category | Databases & data (assigned by keyword rule, not by hand) |
Related servers in Databases & data
- nifi-clickhouse-kafka-mcp7/7Read-only Apache NiFi, ClickHouse and Kafka access with OIDC, audit…
- Universal DB (read-only)4/4Read-only, guarded SQL access for AI agents: PostgreSQL, MySQL,…
- mcp-clickhouse7/7ClickHouse query & management for AI agents — SQL-classified…
- ClickHouse7/7Read-only MCP server for ClickHouse metadata, parameterized…
- LightShip3/3Governed access to production AI-agent traces in an existing…
- DB Connect MCP6/7Multi-database MCP server for PostgreSQL, MySQL, and ClickHouse