Skip to main content

A DataOps-focused MCP server for ClickHouse with query optimization, pipeline latency analysis, and data quality monitoring

Project description

clickhouse-mcp-server

A DataOps-focused MCP server for ClickHouse with query optimization, pipeline latency analysis, and data quality monitoring.

Features

Unlike generic ClickHouse MCP servers that only run queries, this server acts as a query optimization advisor:

  • ch_query — Execute SELECT with automatic partition pruning warnings
  • ch_explain_query — EXPLAIN-based analysis with optimization suggestions
  • ch_table_schema — Comprehensive table metadata (columns, keys, partitions, samples)
  • ch_pipeline_latency — CDC pipeline per-segment latency (p50/p95/p99)
  • ch_data_quality — Null/duplicate/gap detection with market coverage checks
  • ch_slow_queries — Slow query detection with root cause diagnosis
  • ch_disk_usage — Disk analysis with TTL and optimization recommendations
  • ch_list_tables — Table catalog with built-in descriptions

Safety

All queries are read-only. DDL/DML operations are blocked at the SQL validation layer:

  • Blocked: DROP, TRUNCATE, DELETE, ALTER, INSERT, UPDATE, CREATE, etc.
  • Multi-statement queries blocked (; separator)
  • Comment-based bypass prevented (comments stripped before validation)
  • System tables restricted to allowlist
  • Query timeout: 30 seconds
  • Row limit enforcement

Installation

pip install clickhouse-mcp-server

Usage with Claude Code

Add to your .mcp.json:

{
  "mcpServers": {
    "clickhouse": {
      "command": "clickhouse-mcp-server",
      "env": {
        "CLICKHOUSE_HOST": "localhost",
        "CLICKHOUSE_PORT": "8123",
        "CLICKHOUSE_DATABASE": "cdc_pipeline"
      }
    }
  }
}

Environment Variables

Variable Default Description
CLICKHOUSE_HOST localhost ClickHouse HTTP host
CLICKHOUSE_PORT 8123 ClickHouse HTTP port
CLICKHOUSE_USER default ClickHouse username
CLICKHOUSE_PASSWORD (empty) ClickHouse password
CLICKHOUSE_DATABASE cdc_pipeline Default database
CLICKHOUSE_QUERY_TIMEOUT 30 Query timeout in seconds

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clickhouse_dataops_mcp-0.1.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clickhouse_dataops_mcp-0.1.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file clickhouse_dataops_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: clickhouse_dataops_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for clickhouse_dataops_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 33002de10d4f662b09eb69444131b409bb7bd222aa690e21fb2e62b2f3b67960
MD5 e0a59adcbf80cbc5226f85ca567385fe
BLAKE2b-256 5fad42367c406038cc7dac992b7ef32ab112d6b154599dc31cb499e526e156e4

See more details on using hashes here.

File details

Details for the file clickhouse_dataops_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: clickhouse_dataops_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for clickhouse_dataops_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8bd8a01e48892f29d9ee5bf4e4e0bc57b3dacb2ba55bb69043e0e172cf1a4f5b
MD5 cff2aa42a25514bc100bc0058088a418
BLAKE2b-256 829b638c33dddff3eb113918d44c5eaba552ae781a6d36e78a24c50c523f7e12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page