ClickHouse MCP Server
The ClickHouse MCP Server allows interaction with a ClickHouse cluster to execute SQL queries and manage database objects.
Execute SQL Queries: Run
run_select_queryto execute read-only SQL queries on the ClickHouse cluster.List Databases: Use
list_databasesto fetch all databases in the cluster.List Tables: Use
list_tablesto retrieve tables within a specific database, with optional filtering.
Allows querying and interacting with ClickHouse databases, providing tools for executing SQL select queries, listing databases, and viewing tables within a database.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ClickHouse MCP Server show me the top 10 customers by total sales"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ClickHouse MCP Server
Migrated to https://github.com/ClickHouse/mcp-clickhouse
An MCP server for ClickHouse.
Features
Tools
run_select_queryExecute SQL queries on your ClickHouse cluster.
Input:
sql(string): The SQL query to execute.All ClickHouse queries are run with
readonly = 1to ensure they are safe.
list_databasesList all databases on your ClickHouse cluster.
list_tablesList all tables in a database.
Input:
database(string): The name of the database.
Related MCP server: Altinity MCP
Configuration
Note: This is a temporary configuration process that will be significantly improved once the package is published.
Run
uv syncto install the dependencies. To installuvfollow the instructions here. Then dosource .venv/bin/activate.Setup the
.env.productionfile with the ClickHouse credentials.
CLICKHOUSE_HOST=<CLICKHOUSE_HOST>
CLICKHOUSE_PORT=<CLICKHOUSE_PORT>
CLICKHOUSE_USER=<CLICKHOUSE_USER>
CLICKHOUSE_PASSWORD=<CLICKHOUSE_PASSWORD>Run
fastmcp install mcp_clickhouse/mcp_server.py -f .env.productionto install the server.Restart Claude Desktop.
Development
In
test-servicesdirectory rundocker compose up -dto start the ClickHouse cluster.Add the following variables to a
.envfile in the root of the repository.
CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=clickhouseRun
uv syncto install the dependencies. To installuvfollow the instructions here. Then dosource .venv/bin/activate.For easy testing, you can run
fastmcp dev mcp_clickhouse/mcp_server.pyto start the MCP server.
Available Tools
3 toolslist_databasesD
Inputs: no named parameters.
list_tablesD
Inputs: database (required), like.
run_select_queryD
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: list_databases retrieves database names, list_tables retrieves table names within a database, and run_select_query executes SQL queries. There is no overlap or ambiguity between these operations.
All tools follow a consistent verb_noun pattern with snake_case naming: list_databases, list_tables, run_select_query. The naming is predictable and readable throughout the set.
With only 3 tools, the set feels thin for a database server like ClickHouse, lacking operations for data manipulation (e.g., insert, update, delete), schema management (e.g., create_table), or advanced query features. However, it covers basic listing and querying.
The tool surface is significantly incomplete for a database server. It provides read-only operations (list and select) but lacks essential CRUD functionality (create, update, delete), schema modifications, or administrative tasks, which will limit agent capabilities in managing ClickHouse effectively.
Maintenance
Related MCP Connectors
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server implementation that enables Claude AI to interact with Clickhouse databases. Features include secure database connections, query execution, read-only mode support, and multi-query capabilities.223 PyPI2MIT

Altinity MCPofficial
FlicenseNot gradedqualityBmaintenanceProduction-ready MCP server designed to empower AI agents and LLMs to interact seamlessly with ClickHouse. It exposes your ClickHouse database as a set of standardized tools and resources that adhere to the MCP protocol, making it easy for agents built on OpenAI, Claude, or other platforms to query, explore, and analyse your data.39-- AlicenseAqualityDmaintenanceAn MCP server for ClickHouse with enhanced filtering for database and table discovery, supporting LIKE/NOT LIKE patterns and both ClickHouse and chDB tools.3Apache 2.0
- FlicenseAqualityDmaintenanceRead-only MCP server for ClickHouse that allows listing databases and tables, describing schemas, and running SELECT queries.4-
Appeared in Searches
- A server for finding information about ClickHouse, the open-source column-oriented database management system
- Information about ClickHouse database
- Information or tools related to databases
- A platform or tool for smart home automation and management
- ClickHouse: A fast open-source columnar database management system