Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

ClickHouse

MCP server by ClickHouse Community

Official MCP server from ClickHouse for querying and exploring ClickHouse clusters and the embedded chDB engine. Aimed at developers and data teams who want an AI assistant to run SQL and browse schemas.

  • Score 87
  • 918 stars
  • Apache-2.0
  • Updated

Install ClickHouse

Built from the published package, never by AI.

claude mcp add clickhouse -e CLICKHOUSE_HOST=YOUR_CLICKHOUSE_HOST -e CLICKHOUSE_USER=YOUR_CLICKHOUSE_USER -- uvx mcp-clickhouse

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install ClickHouse in Claude Code

MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the clickhouse block.

About

The ClickHouse MCP server gives AI assistants tools to run SQL queries on a ClickHouse cluster, list databases, and list tables with pagination. Queries run in read-only mode by default, and writes can be enabled explicitly. The server also offers a chDB tool that runs queries through chDB's embedded ClickHouse engine, which can read data from files, URLs and databases without a separate ETL step.

The server supports MCP protocol versions from 2024-11-05 through 2026-07-28. It includes a health check endpoint for HTTP and SSE transports and requires authentication for those transports by default. The source describes it for developers and data teams who want an assistant to explore ClickHouse schemas, check queries before running them, and analyze data.

Written from the project's README and checked against it.

Tools it gives your assistant

  • run_queryExecutes SQL queries on the ClickHouse cluster, with optional named parameters.
  • list_databasesLists all databases on the ClickHouse cluster.
  • list_tablesLists tables in a database with pagination and LIKE filters on table names.
  • run_chdb_select_queryExecutes SQL queries using chDB's embedded ClickHouse engine.

What you need

  • A ClickHouse cluster
  • Python, with pip to install mcp-clickhouse
  • Optional chdb extra for the chDB tool
  • Bearer token or OAuth provider for HTTP or SSE transport
SettingNeededWhat it is
CLICKHOUSE_HOSTEnvironment variableRequiredHostname of the ClickHouse server
CLICKHOUSE_USEREnvironment variableRequiredUsername for ClickHouse authentication
CLICKHOUSE_PASSWORDEnvironment variable, secretOptionalPassword for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode
CLICKHOUSE_PORTEnvironment variableOptionalClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise
CLICKHOUSE_SECUREEnvironment variableOptionalUse HTTPS to connect to ClickHouse Default: true
CLICKHOUSE_VERIFYEnvironment variableOptionalVerify SSL certificates Default: true
CLICKHOUSE_CA_CERTEnvironment variableOptionalPath to a PEM CA bundle for ClickHouse server certificate verification
CLICKHOUSE_CLIENT_CERTEnvironment variableOptionalPath to a PEM client certificate for the ClickHouse HTTPS connection
CLICKHOUSE_CLIENT_CERT_KEYEnvironment variableOptionalPath to the PEM private key for CLICKHOUSE_CLIENT_CERT
CLICKHOUSE_TLS_MODEEnvironment variableOptionalClient certificate mode: mutual, proxy, or strict
CLICKHOUSE_DATABASEEnvironment variableOptionalDefault database to use
CLICKHOUSE_ROLEEnvironment variableOptionalClickHouse role to activate for the session
CLICKHOUSE_ALLOW_WRITE_ACCESSEnvironment variableOptionalAllow write operations (DDL and DML). Queries run read-only by default Default: false
CLICKHOUSE_ALLOW_DROPEnvironment variableOptionalAllow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, OPTIMIZE DEDUPLICATE, MODIFY/MATERIALIZE TTL, MODIFY/ALTER COLUMN with TTL, and DETACH PERMANENTLY) when write access is also enabled Default: false
CLICKHOUSE_MCP_QUERY_TIMEOUTEnvironment variableOptionalQuery tool timeout in seconds Default: 30
CLICKHOUSE_MCP_MAX_WORKERSEnvironment variableOptionalMaximum query worker thread pool size Default: 10

From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.

Try asking

  • List all databases on my ClickHouse cluster
  • Show the tables in the sales database that start with orders
  • Run a query that totals revenue by month from the events table

Good to know

  • Queries run in read-only mode by default, and writes must be enabled explicitly.
  • HTTP and SSE transports require authentication unless it is disabled.
  • EXPLAIN ESTIMATE covers only MergeTree family tables.
  • Parameter values can appear in ClickHouse system logs.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: README.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to ClickHouse

All alternatives →
Supabase supabase
97

Connects Supabase projects to AI assistants such as Cursor, Claude and Windsurf over the Model Context Protocol. It lets assistants manage tables, fetch config and query data in a Supabase project.

AAA Local and remote 172k/wk
ArcadeDB MCP Server ArcadeData
94

ArcadeDB MCP Server is the built-in Model Context Protocol server of the ArcadeDB multi-model database. It lets AI assistants and LLMs work with ArcadeDB's graph, document, time-series, vector and other data models. It suits people who already run ArcadeDB and want assistant access to it.

AAA Local 1.3k
DBHubbytebase
94

Connects MCP clients such as Claude Desktop, Cursor and VS Code to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It exposes two tools by default, with read-only mode and query timeouts available as guardrails.

AAA Local 343k/wk
MCP Toolbox for Databasesgoogleapis
94

MCP Toolbox for Databases is an open source MCP server that connects AI agents, IDEs and applications to enterprise databases. It provides prebuilt tools for exploring schemas and running queries, plus a framework for custom tools. It is aimed at developers building agents that need database access.

AAA Local 17k
MCP Toolbox for Databasesgoogleapis
94

Connects AI agents, IDEs and applications to enterprise databases through the Model Context Protocol. Offers prebuilt database tools for MCP clients and a framework for building custom tools for production agents.

AAA Local 17k
mongodb-mcp-servermongodb-js
94

MongoDB MCP Server lets AI assistants interact with MongoDB databases and MongoDB Atlas. It is an official server from mongodb-js, run locally with npx or Docker. It works with self-managed deployments and Atlas clusters.

AAA Local 203k/wk

Compare with Supabase, ArcadeDB MCP Server or DBHub

ClickHouse: common questions

Can the assistant change data with this server?

Queries run in read-only mode by default. The source says writes can be enabled explicitly through CLICKHOUSE_ALLOW_WRITE_ACCESS.

What authentication options does it support for HTTP or SSE?

The source lists a static bearer token, OAuth or OIDC through FastMCP providers, or disabling authentication for local development. Startup fails if none is configured for HTTP or SSE.

Does it work with chDB without a ClickHouse cluster?

The source describes run_chdb_select_query as using chDB's embedded engine, which queries files, URLs and databases directly. It requires the optional chdb extra to be installed.

How do I install ClickHouse?

In Claude Code run claude mcp add clickhouse -e CLICKHOUSE_HOST=YOUR_CLICKHOUSE_HOST -e CLICKHOUSE_USER=YOUR_CLICKHOUSE_USER -- uvx mcp-clickhouse. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is ClickHouse the official server?

ClickHouse is a community project by ClickHouse, not verified by a company domain.

Is ClickHouse free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is ClickHouse safe to use?

It scores 87 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to ClickHouse?

Similar MCP servers: Supabase, ArcadeDB MCP Server, DBHub, MCP Toolbox for Databases.

Does ClickHouse work with ChatGPT?

Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.

ClickHouse Install

Add to stack

Loading.