
Mcp Clickhouse
io.github.dockndevai由 GitHub 帳號 dockndevai 發布v0.3.0更新於 Oct 24, 2026
ClickHouse query & management for AI agents — SQL-classified read/write/destructive gating.
概覽
針對 ClickHouse 的本機 MCP 伺服器,讓助理瀏覽資料庫與資料表結構、執行唯讀查詢,並在開啟對應模式後寫入或管理資料庫,語句依讀取、寫入、破壞性分級攔阻。
- 可以做什麼
- 瀏覽資料庫、資料表、欄位、資料表統計、執行中的查詢、伺服器指標與叢集拓撲,並檢視建表語句。執行唯讀 SQL 查詢,回傳列數受可設定上限限制。在讀寫模式下執行單一 INSERT、CREATE 或 ALTER 語句。僅在管理員模式並額外開啟刪除許可時執行 DROP、TRUNCATE、DELETE 等破壞性語句。可用試執行預覽寫入與破壞性語句,並將受控操作以 JSON 稽核列記錄。
- 適用情境
- 適合讓助理檢視或查詢 ClickHouse 分析資料庫、回答資料表結構與大小等問題,或檢查執行中的查詢與伺服器指標。也適合需要分級權限與破壞性語句攔阻的受控資料庫管理情境。
- 執行需求
- 透過 npx 從 npm 套件在本機執行,需要 Node.js。需要 ClickHouse HTTP 位址、使用者與密碼,分別以 CLICKHOUSE_URL、CLICKHOUSE_USER、CLICKHOUSE_PASSWORD 設定,並設定 CLICKHOUSE_MODE(預設唯讀)。選用設定包括資料庫允許清單、受保護資料庫、刪除許可、列數上限、試執行與稽核記錄。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Clickhouse,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-clickhouse
A Model Context Protocol server for ClickHouse. It lets an MCP-capable client (Claude Desktop, Claude Code, etc.) explore schemas, run analytical queries, and manage the database — with behaviour controlled entirely by flags.
The security model is statement-aware: every SQL statement is classified as read, write, or destructive, and gated against the current access mode. Read-only mode additionally runs queries under ClickHouse's own readonly=1 setting.
Features
- Exploration & monitoring — databases, tables, columns,
SHOW CREATE, table stats (parts/rows/bytes), running queries, server metrics, cluster topology. - Read queries — a
querytool that only accepts read statements, capped atCLICKHOUSE_MAX_ROWS. - Management — an
executetool for INSERT/CREATE/ALTER (read-write) and DROP/TRUNCATE/DELETE (admin), each gated by classification. - Access modes —
read-only→read-write→admin, layered so a mode never exposes statements above its level. - Security flags — database allowlist, protected databases, destructive gating, row cap, dry-run, and JSON audit logging (see below).
Security model
Statement classification lives in src/sql.ts and is fail-safe: ALTER … DELETE/UPDATE counts as destructive, and anything unparseable is treated as destructive.
Tools
Read (read-only+): list_databases, list_tables, describe_table, show_create_table, table_stats, running_queries, server_metrics, cluster_info, query
Write/Admin (read-write+): execute — runs a single statement after classifying it; writes need read-write mode, destructive statements need admin mode + CLICKHOUSE_ALLOW_DELETE.
Quickstart — add to your agent
Published on npm as @dockndevai/mcp-clickhouse. No clone or build needed — your MCP client runs it on demand with npx. Start in read-only mode; see .env.example for every variable and docs/CLIENTS.md for the full per-client guide.
Claude Code (CLI)
Claude Desktop · Cursor · Windsurf — same block in claude_desktop_config.json, .cursor/mcp.json, or ~/.codeium/windsurf/mcp_config.json:
OpenAI Codex CLI — in ~/.codex/config.toml:
VS Code (GitHub Copilot, Agent mode) — in .vscode/mcp.json:
Example prompts
- "What are the biggest tables in the
analyticsdatabase?" - "Show me the schema for
eventsand run a query for daily counts this week." - "Which queries are currently running and using the most memory?"
Run from source (development)
Prefer the published package above. To run from a clone:
Develop
Publishing
This server ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md for publishing to npm and listing on the MCP registry, Smithery, Glama, Cursor, and PulseMCP.
License
MIT
來源:README.md,提交 6940892
工具
0版本歷史
2- v0.3.0最新Sep 29, 2026
- v0.2.2Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分