Skip to content
← All MCP servers

Is the ClickHouse MCP server safe? What it can reach

What the ClickHouse MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.

Official serverChecked

ClickHouse maintains this MCP server, which runs locally and logs in with a ClickHouse user and password. It runs SQL in read-only mode by default, enforced by the database. Writes need CLICKHOUSE_ALLOW_WRITE_ACCESS, and drops and deletes need CLICKHOUSE_ALLOW_DROP too. Use a dedicated low-privilege user as the real boundary.

Who maintains it

ImplementationKindStatus
ClickHouse/mcp-clickhouseOfficialactive

It runs as a local process on your machine or as a hosted remote server.

How it signs in

A ClickHouse user and password, or a client certificate. The server runs queries as that user. Streamable HTTP or SSE mode requires its own auth, a bearer token or OAuth, by default.

What its tools can do

KindTools
Readrun_query, list_databases, list_tables, run_chdb_select_query
Writenone documented
Can’t be undonenone documented

run_query is read-only unless CLICKHOUSE_ALLOW_WRITE_ACCESS is true. With that flag it can create tables and insert, and with CLICKHOUSE_ALLOW_DROP it can drop, truncate, delete and update. run_chdb_select_query needs the optional chdb extra.

Built-in limits

OptionWhat it does
CLICKHOUSE_ALLOW_WRITE_ACCESSDefault false. Read-only mode is enforced with readonly=1 on the server side.
CLICKHOUSE_ALLOW_DROPNeeded on top of write access for DROP, TRUNCATE, DELETE and UPDATE. The README calls this a best-effort guard, not a security boundary.
Dedicated ClickHouse user and grantsThe README says the grants are the real boundary and warns against default or admin users. It also notes read-only mode still lets the user cancel its own queries.
CLICKHOUSE_ENABLED and CHDB_ENABLEDTurn the database tools or the chDB tool on or off.
CLICKHOUSE_MCP_AUTH_TOKENBearer token for HTTP or SSE mode. Startup fails without auth unless CLICKHOUSE_MCP_AUTH_DISABLED is set, which is for local development only.

The risks

  • A SELECT can read every table the ClickHouse user can reach, so an injected instruction can pull customer rows into the conversation.
  • With write and drop flags set, an injected instruction could truncate or delete tables, and ClickHouse mutations can’t be rolled back.
  • The README says the destructive-operation check is only a guard that runs in the MCP server, so the user’s grants are what actually stop a drop.
  • The chDB tool can query files and URLs directly, which adds file and network reach beyond your database.

Limit it in Claude Code

Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:

claude mcp add --env CLICKHOUSE_HOST=... --env CLICKHOUSE_USER=... --env CLICKHOUSE_PASSWORD=... clickhouse -- uv run --with mcp-clickhouse --python 3.12 mcp-clickhouse

Claude Code names MCP tools mcp__clickhouse__<tool>. Once you know the tool names, deny the ones you won’t use and set the rest to ask in .claude/settings.json.

Limit it in Codex

Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:

[mcp_servers.clickhouse]
command = "uv"
args = ["run", "--with", "mcp-clickhouse", "--python", "3.12", "mcp-clickhouse"]
env_vars = ["CLICKHOUSE_HOST", "CLICKHOUSE_USER", "CLICKHOUSE_PASSWORD"]

Checklist

  • Create a dedicated ClickHouse user with SELECT on only the databases the agent needs.
  • Leave CLICKHOUSE_ALLOW_WRITE_ACCESS and CLICKHOUSE_ALLOW_DROP unset.
  • Keep CLICKHOUSE_SECURE and CLICKHOUSE_VERIFY at their true defaults.
  • Disable the chDB tool with CHDB_ENABLED=false if you don’t need it.
  • Use a bearer token or OAuth if you run it over HTTP.

Checked against the vendor documentation on November 25, 2026. ClickHouse/mcp-clickhouse README · README (raw)

What Excellent covers

Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing