MCP server · Databases
ClickHouse MCP server
The ClickHouse MCP server is ClickHouse’s official MCP server. It lets an assistant list databases and tables and run SQL queries, plus optional embedded chDB queries. It runs locally with uv (Python 3.10 to 3.14) and needs ClickHouse credentials. Queries are read-only unless CLICKHOUSE_ALLOW_WRITE_ACCESS is set to true.
- Maintainer
- ClickHouse (official)
- Licence
- Apache-2.0
- Runs
- Locally (uv)
- Sign-in
- A token or API key
- Registry version
- 0.7.0 (updated 2026-09-21)
- Last activity
- 2026-10-06
Overview
What can the ClickHouse MCP server do?
ClickHouse’s MCP server is a Python package started with uv. You point it at a ClickHouse service with environment variables for host, port, user and password, and it exposes three tools: run a query, list databases and list tables with their columns. An optional chDB mode adds an embedded ClickHouse engine that can query files, URLs and other sources without loading them first.
It is read-only by default. Writes need CLICKHOUSE_ALLOW_WRITE_ACCESS=true, and destructive statements such as DROP, TRUNCATE, DELETE and UPDATE need CLICKHOUSE_ALLOW_DROP=true as well. Queries can take named parameters, so values stay separate from the SQL text. Pick it for analytics work where an assistant explores large tables and answers questions in SQL. You can try it against the public ClickHouse SQL Playground using the demo settings in the README.
Tools
Tools it gives the assistant
- run_query for SQL, with named query parameters
- list_databases
- list_tables with paging, filters and column details
- run_chdb_select_query on the embedded chDB engine
- Optional HTTP transport with bearer token or OAuth
Install
How do I install ClickHouse MCP in Claude Code, Cursor or VS Code?
You need:
- uv
- Python 3.10 to 3.14 (3.12 recommended)
- A ClickHouse service and user credentials
Run in your project. --scope local keeps the servers private to you in this project; use user for every project.
claude mcp add --env CLICKHOUSE_HOST="${CLICKHOUSE_HOST}" --env CLICKHOUSE_PORT=8443 --env CLICKHOUSE_USER="${CLICKHOUSE_USER}" --env CLICKHOUSE_PASSWORD="${CLICKHOUSE_PASSWORD}" --env CLICKHOUSE_SECURE=true --env CLICKHOUSE_VERIFY=true --scope local clickhouse -- uv run --with mcp-clickhouse --python 3.12 mcp-clickhouse
claude mcp add --env CLICKHOUSE_HOST="$env:CLICKHOUSE_HOST" --env CLICKHOUSE_PORT=8443 --env CLICKHOUSE_USER="$env:CLICKHOUSE_USER" --env CLICKHOUSE_PASSWORD="$env:CLICKHOUSE_PASSWORD" --env CLICKHOUSE_SECURE=true --env CLICKHOUSE_VERIFY=true --scope local clickhouse -- uv run --with mcp-clickhouse --python 3.12 mcp-clickhouse
- Set CLICKHOUSE_HOST, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD first, e.g. export CLICKHOUSE_HOST=… in your shell. The command saves the value, not the variable.
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json · Windows: %APPDATA%\Claude\claude_desktop_config.json (Settings → Developer → Edit Config). Restart Claude after saving.
{
"mcpServers": {
"clickhouse": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.12",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_USER": "<CLICKHOUSE_USER>",
"CLICKHOUSE_PASSWORD": "<CLICKHOUSE_PASSWORD>",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}
- Claude Desktop doesn’t read variables in this file: replace <CLICKHOUSE_HOST>, <CLICKHOUSE_USER>, <CLICKHOUSE_PASSWORD> with the real values.
- This file contains your keys once filled in. It lives in your user folder; never commit or share it.
In your project, or ~/.cursor/mcp.json for every project.
{
"mcpServers": {
"clickhouse": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.12",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_HOST": "${env:CLICKHOUSE_HOST}",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_USER": "${env:CLICKHOUSE_USER}",
"CLICKHOUSE_PASSWORD": "${env:CLICKHOUSE_PASSWORD}",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}
In your workspace. VS Code asks for each secret the first time a server starts and stores it securely.
{
"inputs": [
{
"type": "promptString",
"id": "clickhouse-host",
"description": "CLICKHOUSE_HOST",
"password": true
},
{
"type": "promptString",
"id": "clickhouse-user",
"description": "CLICKHOUSE_USER",
"password": true
},
{
"type": "promptString",
"id": "clickhouse-password",
"description": "CLICKHOUSE_PASSWORD",
"password": true
}
],
"servers": {
"clickhouse": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.12",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_HOST": "${input:clickhouse-host}",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_USER": "${input:clickhouse-user}",
"CLICKHOUSE_PASSWORD": "${input:clickhouse-password}",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}
Need another app? Open ClickHouse MCP Server in the MCP config generator for a shared project .mcp.json, Devin, or several servers at once; it writes one file per app. The snippets follow the setup in the server’s README, checked on 2026-10-14.
Is the ClickHouse MCP server safe? Check before you install
- Queries run read-only (readonly=1) unless CLICKHOUSE_ALLOW_WRITE_ACCESS is set to true.
- The extra CLICKHOUSE_ALLOW_DROP gate is a best-effort check, not a security boundary; give the server a ClickHouse user with only the grants it needs.
- chDB mode can read local files and URLs the process can reach.
- A local MCP server runs with your user account’s permissions. Install it only from the source linked above. See how to choose a safe server.
FAQ
ClickHouse MCP questions
Is the ClickHouse MCP server official?
Yes. ClickHouse publishes and maintains it, under the Apache-2.0 licence. Install it only from the source linked on this page, not from a copy in another directory.
Is ClickHouse MCP server remote or local?
Local. Your MCP app starts it on your machine with uv, and it runs with your user account’s permissions.
Does ClickHouse MCP server need an API key or account?
Yes. It needs an API key or token from the service, which you pass as an environment variable or header rather than writing it into the config file. You also need: uv; Python 3.10 to 3.14 (3.12 recommended); A ClickHouse service and user credentials.
Why it’s listed
Why we list it
Official, safe by default and well documented, with steady releases.
Related
Alternatives and related servers: databases
- DuckDB / MotherDuck Local MCP Server
- mcp-server-qdrant
- Pinecone Developer MCP Server
- MCP Toolbox for Databases
- Neon MCP Server
- Prisma MCP server
All MCP serversMCP config generatorGuide: MCP servers in Claude CodeGuide: what is MCP?