clickhouse
Provides tools for querying and managing ClickHouse databases, including listing databases, tables, describing schemas, executing SELECT queries, and DDL/DML operations.
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 List all databases on the ClickHouse server"
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
一个用于 ClickHouse 的 Model Context Protocol (MCP) 服务器,让 Claude 等 AI 助手能够直接查询和管理 ClickHouse 数据库。
功能
提供 5 个工具:
工具 | 描述 |
| 列出所有数据库 |
| 列出指定数据库的所有表 |
| 查看表的列信息和建表语句 |
| 执行 SELECT 查询,返回 JSON 结果 |
| 执行 DDL / DML 语句(CREATE、ALTER、DROP、INSERT 等) |
Related MCP server: ClickHouse MCP Server
快速开始
安装依赖
npm install配置环境变量
复制 .env.example 并填写你的 ClickHouse 连接信息:
cp .env.example .envCLICKHOUSE_HOST=http://your-clickhouse-host:8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=your_password
CLICKHOUSE_DATABASE=default构建
npm run build在 Claude Desktop 中使用
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS):
{
"mcpServers": {
"clickhouse": {
"command": "node",
"args": ["/path/to/clickhouse/dist/index.js"],
"env": {
"CLICKHOUSE_HOST": "http://your-clickhouse-host:8123",
"CLICKHOUSE_USER": "default",
"CLICKHOUSE_PASSWORD": "your_password",
"CLICKHOUSE_DATABASE": "default"
}
}
}
}在 Claude Code 中使用
claude mcp add clickhouse node /path/to/clickhouse/dist/index.js \
-e CLICKHOUSE_HOST=http://your-clickhouse-host:8123 \
-e CLICKHOUSE_USER=default \
-e CLICKHOUSE_PASSWORD=your_password \
-e CLICKHOUSE_DATABASE=default开发
# 直接运行(无需构建)
npm run dev技术栈
License
MIT
Available Tools
5 toolsdescribe_tableARead-only
Show column names, types, and default expressions for a table. Also returns the CREATE TABLE statement for full schema details.
Inputs: table (required), database (required).
executeADestructive
Execute a DDL or DML statement: CREATE TABLE, ALTER TABLE, DROP TABLE, INSERT, UPDATE, DELETE. Returns success/error only — no row results. Use query for SELECT.
Inputs: sql (required), database.
list_databasesARead-only
List all databases in ClickHouse.
Inputs: no named parameters.
list_tablesARead-only
List all tables in a database.
Inputs: database (required).
queryARead-only
Execute a SELECT query and return results as JSON rows. Use for read-only operations only. For DDL or DML use execute instead.
Inputs: sql (required), database.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool serves a distinct purpose: list_databases and list_tables handle exploration, describe_table provides schema details, query is for read-only SELECTs, and execute handles DDL/DML. There is no overlap or ambiguity between them.
All tool names use consistent snake_case with a clear verb-noun pattern (list_*, describe_*, query, execute). The naming is uniform and predictable.
Five tools is well-scoped for a database server covering exploration, schema inspection, and data manipulation. Each tool is necessary and there is no bloat.
The tool surface covers the essential lifecycle of a ClickHouse database: listing databases and tables, inspecting schema, running SELECT queries, and executing all DDL/DML statements. No critical operations appear missing.
Maintenance
Related MCP Connectors
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Governed access to production AI-agent traces in an existing ClickHouse store.
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
AlicenseAqualityAmaintenanceClickHouse database integration with schema inspection and query capabilities3911Apache 2.0- AlicenseNot gradedqualityDmaintenanceEnables executing SQL queries, listing databases, and listing tables on a ClickHouse cluster through natural language.Apache 2.0
- AlicenseAqualityNot gradedmaintenanceProvides AI agents safe, read-only access to a ClickHouse database, enabling table listing, query execution, schema inspection, and caching.66MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI to execute SQL queries against MySQL and ClickHouse connections, retrieve and manage results, and inject them into the aiQueryLab VSCode IDE.Apache 2.0