mcp-clickhouse
mcp-clickhouse
ClickHouse용 Model Context Protocol 서버입니다. MCP를 지원하는 클라이언트(Claude Desktop, Claude Code 등)에서 스키마를 탐색하고, 분석 쿼리를 실행하고, 데이터베이스를 관리할 수 있게 해주며, 그 동작은 전적으로 플래그로 제어됩니다.
보안 모델은 문(statement) 인식 방식입니다. 모든 SQL문은 읽기, 쓰기, 파괴적(destructive)으로 분류되며, 현재 액세스 모드와 대응해 제어됩니다. 읽기 전용 모드에서는 추가로 ClickHouse의 readonly=1 설정으로 쿼리를 실행합니다.
기능
탐색 및 모니터링 — 데이터베이스, 테이블, 컬럼,
SHOW CREATE, 테이블 통계(파트/행/바이트), 실행 중인 쿼리, 서버 메트릭, 클러스터 토폴로지.읽기 쿼리 — 읽기 문만 허용하는
query도구이며,CLICKHOUSE_MAX_ROWS로 제한됩니다.관리 — INSERT/CREATE/ALTER(read-write) 및 DROP/TRUNCATE/DELETE(admin)용
execute도구로, 각각 분류에 따라 제어됩니다.액세스 모드 —
read-only→read-write→admin순으로 계층화되어 있어, 어떤 모드도 바로 위 단계의 문을 노출하지 않습니다.보안 플래그 — 데이터베이스 허용 목록, 보호 데이터베이스, 파괴적 문 제어, 행 제한, dry-run, 그리고 JSON 감사 로깅(아래 참조).
Related MCP server: clickhouse-mcp-server
보안 모델
Concern | Flag | Default | Effect |
서버가 수행할 수 있는 작업은 무엇인가요? |
|
|
|
어떤 데이터베이스를 범위로 하나요? |
| (전체) | 설정하면 다른 데이터베이스에서 작업을 거부합니다. |
어떤 데이터베이스가 영구적으로 읽기 전용인가요? |
|
| 읽을 수 있지만, 변경할 수 없습니다. |
파괴적 SQL을 실행할 수 있나요? |
|
| DROP/TRUNCATE/DELETE/… 는 이 플래그 및 admin 모드를 요구합니다. |
결과 크기 제한 |
|
| 모델에 반환되는 최대 행 수의 상한입니다. |
실행 없이 미리보기 |
|
| 쓰기/파괴적 문을 검증하고 의도만 기록한 뒤 반환합니다. |
감사 추적 |
|
| 보호된 각 작업에 대해 JSON 라인을 stderr 로 출력합니다. |
문 분류는 src/sql.ts에 있으며 안전에 안전을 기하는 방식입니다: ALTER … DELETE/UPDATE는 파괴적인 것으로 간주하고, 파싱할 수 없는 모든 것은 파괴적인 것으로 취급합니다.
도구
읽기 (read-only+): list_databases, list_tables, describe_table, show_create_table, table_stats, running_queries, server_metrics, cluster_info, query
쓰기/관리 (read-write+): execute — 분류 후 단일 문을 실행합니다. 쓰기에는 read-write 모드, 파괴적 문에는 admin 모드와 CLICKHOUSE_ALLOW_DELETE가 필요합니다.
MCP 클라이언트와 함께 사용하기
Claude Code, Claude Desktop, Cursor, OpenAI Codex CLI, Windsurf, VS Code(Copilot) 및 다른 모든 MCP 클라이언트와 함께 작동합니다. 클라이언트별 설정은 **docs/CLIENTS.md**를 참고하세요.
설치
npm install
npm run buildClaude Desktop / Claude Code로 실행하기
{
"mcpServers": {
"clickhouse": {
"command": "node",
"args": ["/absolute/path/to/mcp-clickhouse/dist/index.js"],
"env": {
"CLICKHOUSE_URL": "http://clickhouse:8123",
"CLICKHOUSE_USER": "readonly",
"CLICKHOUSE_PASSWORD": "…",
"CLICKHOUSE_MODE": "read-only",
"CLICKHOUSE_DATABASE_ALLOWLIST": "analytics"
}
}
}
}예시 프롬프트
"
analytics데이터베이스에서 가장 큰 테이블은 무엇인가요?""
events의 스키마를 보여주고, 이번 주 일간 카운트를 위한 쿼리를 실행해 주세요.""현재 실행 중인 쿼리 중 가장 많은 메모리를 사용하고 있는 쿼리는 무엇인가요?"
개발
npm run dev
npm test # SQL classification + security policy (30 tests)
npm run typecheck게시
이 서버는 공식 MCP 레지스트리를 위한 server.json과 npm 소유권 검증을 위한 mcpName을 포함합니다. npm에 게시하고 MCP 레지스트리, Smithery, Glama, Cursor, PulseMCP에 등록하는 방법은 **PUBLISHING.md**를 참고하세요.
라이선스
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityFmaintenanceAn 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.22MIT
- AlicenseNot gradedqualityCmaintenanceEnables interaction with ClickHouse databases via MCP, providing tools to list databases and tables and execute safe SELECT, SHOW, and DESCRIBE queries.32MIT
- FlicenseAqualityCmaintenanceRead-only MCP server for ClickHouse that allows listing databases and tables, describing schemas, and running SELECT queries.4
Related MCP Connectors
Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.
MCP server for managing Prisma Postgres.
Read-only Yandex Metrika MCP. Query visits, sources, geo, devices and more in plain language.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dockndevai/mcp-clickhouse'
If you have feedback or need assistance with the MCP directory API, please join our Discord server