Skip to content
Skillpedia
βœ“ Official Β· ClickHouse● Free and open sourceπŸ’» LocalπŸ”‘ Needs an API keyData and databases

ClickHouse

Lets your AI agent run SQL queries, list databases and tables on ClickHouse, and query data with chDB.

903 stars on GitHubby ClickHouseLicense Apache-2.0Updated 19 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add clickhouse -e CLICKHOUSE_HOST="<your value>" -e CLICKHOUSE_USER="<your value>" -- uvx mcp-clickhouse

What to fill in

NameWhat it isRequired
CLICKHOUSE_HOSTHostname of the ClickHouse serverYes
CLICKHOUSE_USERUsername for ClickHouse authenticationYes
CLICKHOUSE_PASSWORDPassword for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS modeNo
CLICKHOUSE_PORTClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwiseNo
CLICKHOUSE_SECUREUse HTTPS to connect to ClickHouseNo
CLICKHOUSE_VERIFYVerify SSL certificatesNo
CLICKHOUSE_CA_CERTPath to a PEM CA bundle for ClickHouse server certificate verificationNo
CLICKHOUSE_CLIENT_CERTPath to a PEM client certificate for the ClickHouse HTTPS connectionNo
CLICKHOUSE_CLIENT_CERT_KEYPath to the PEM private key for CLICKHOUSE_CLIENT_CERTNo
CLICKHOUSE_TLS_MODEClient certificate mode: mutual, proxy, or strictNo
CLICKHOUSE_DATABASEDefault database to useNo
CLICKHOUSE_ROLEClickHouse role to activate for the sessionNo
CLICKHOUSE_ALLOW_WRITE_ACCESSAllow write operations (DDL and DML). Queries run read-only by defaultNo
CLICKHOUSE_ALLOW_DROPAllow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, and DETACH PERMANENTLY) when write access is also enabledNo
CLICKHOUSE_MCP_QUERY_TIMEOUTQuery tool timeout in secondsNo
CLICKHOUSE_MCP_MAX_WORKERSMaximum query worker thread pool sizeNo

Ready! Now test it

Restart the app and paste one of these requests in the chat:

List the databases and tables on my ClickHouse cluster.
How many events per day did we get in the last 30 days?

What it is

This is the official MCP server for ClickHouse. It lets your agent explore a ClickHouse cluster and run queries, in read-only mode by default. It can also use chDB, an embedded ClickHouse engine, to query files and URLs directly.

What it can do

  • run_query: run SQL on your ClickHouse cluster, with optional parameters
  • list_databases: list all databases
  • list_tables: list tables in a database, with filters and paging
  • run_chdb_select_query: run SQL with chDB on files, URLs or databases
  • DESCRIBE and EXPLAIN ESTIMATE can be run through run_query to check a query first

When to use

  • β€ΊWhen you want your agent to explore a ClickHouse database and write queries
  • β€ΊWhen you want to estimate how much data a query would read before running it
  • β€ΊWhen you want to query a file or URL directly without loading it first

What you need

A ClickHouse server you can reach and its connection details, plus Python. chDB needs the extra pip install 'mcp-clickhouse[chdb]'. HTTP or SSE mode needs an auth token or OAuth setup.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

The readme does not state a license or price. The project is on PyPI and GitHub.

Can it write to my database?

Not by default. Queries run read-only unless you set CLICKHOUSE_ALLOW_WRITE_ACCESS to true.

Does it need authentication?

Over stdio no. For HTTP or SSE you must set a static bearer token, OAuth through FastMCP, or explicitly disable auth for local development.

What is chDB?

An embedded ClickHouse engine. It lets you query files, URLs and databases without an ETL step.

Is there a health check?

Yes. With HTTP or SSE transport, /health returns 200 OK if the server can connect to ClickHouse.

Are big numbers handled safely?

Integers outside the safe JavaScript range come back as decimal strings to keep exact values.

If it does not work

  • β€ΊCheck your ClickHouse host and credentials in the server settings.
  • β€ΊIf HTTP or SSE startup fails, set CLICKHOUSE_MCP_AUTH_TOKEN (or another auth mode).
  • β€ΊFor chDB tools, install the extra with pip install 'mcp-clickhouse[chdb]'.

5 new skills a week. 1 minute to read.