ClickHouse Readonly MCP

ClickHouse Readonly MCP

clickhouse-mcp•bythe-nine-nation

A FastMCP server that executes read-only ClickHouse SQL queries via MCP tools.

License: Not specified•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Executes read-only SQL queries through MCP tools.
  • •Validates input to allow only read-only operations such as SELECT, SHOW, DESCRIBE and EXPLAIN.
  • •Supports both HTTP and native ClickHouse connection methods with automatic failover.
  • •Supports parameterized queries.

BEST FOR

  • •Running read-only exploratory or analytical queries against a ClickHouse database through an MCP client.
  • •Environments that need safe, SELECT-only access enforced by input validation.

ABOUT CLICKHOUSE-MCP

ClickHouse Readonly MCP is cataloged as an MCP server attributed to the-nine-nation. A FastMCP server that executes read-only ClickHouse SQL queries via MCP tools. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for ClickHouse Readonly MCP are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can this server execute write or DDL operations on ClickHouse?

No; input validation restricts execution to read-only operations such as SELECT, SHOW, DESCRIBE and EXPLAIN.

What connection methods are supported?

Both HTTP and native ClickHouse connections are supported, with automatic failover between them.

Upstream README

View this exact version on GitHub

README.md · 5f6303b75d0e · Fetched 2026-11-13 11:34:07 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

ClickHouse Readonly MCP

一个用于执行只读ClickHouse查询的FastMCP服务器,支持本地Python API集成和作为独立服务运行。

更新

20250509:添加了对官方的clickhouse mcp的代码,并进行了优化,避免多次调用的思路回环.

功能特点

  • 支持通过MCP工具执行只读SQL查询
  • 输入验证确保只能执行SELECT、SHOW、DESCRIBE、EXPLAIN等只读操作
  • 支持HTTP和原生ClickHouse连接方式,自动故障切换
  • 简洁的表格格式输出结果
  • 支持参数化查询
  • 高性能查询执行和结果处理

安装

通过pip安装

pip install clickhouse-readonly-mcp

从源码安装

git clone https://github.com/the-nine-nation/clickhouse-mcp.git
cd clickhouse-readonly-mcp
pip install -e .

使用方法

以cursor为例,将如下字典放入config.json: 其中 sys.executable为python虚拟环境的执行文件,通常名字为python,conda或uv下皆可以 clickhouse_mcp_py为main.py的绝对路径

    "clickhouse": {
        "command": sys.executable,
        "args": [clickhouse_mcp_py],
        "env": {
            "CLICKHOUSE_ENABLED": "true",
            "CLICKHOUSE_HOST": "ClickHouse database IP",
            "CLICKHOUSE_PORT": "ClickHouse database port",
            "CLICKHOUSE_HTTP_PORT":"",
            "CLICKHOUSE_DATABASE": "ClickHouse database name",
            "CLICKHOUSE_USERNAME": "ClickHouse database username",
            "CLICKHOUSE_PASSWORD": "ClickHouse database password",
            "CLICKHOUSE_RESOURCE_DESC_FILE": "Path to ClickHouse database resource description file"
            }
    }

或者使用经过我们优化的官方实现:

    "clickhouse": {
        "command": sys.executable,
        "args": [clickhouse_mcp_py],
    "env": {
        "CLICKHOUSE_HOST": "<clickhouse-host>",
        "CLICKHOUSE_PORT": "<clickhouse-port>",
        "CLICKHOUSE_USER": "<clickhouse-user>",
        "CLICKHOUSE_PASSWORD": "<clickhouse-password>",
        "CLICKHOUSE_SECURE": "true",
        "CLICKHOUSE_VERIFY": "true",
        "CLICKHOUSE_CONNECT_TIMEOUT": "30",
        "CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30"
      }

请注意: 1.CLICKHOUSE_PORT为原生连接的端口,CLICKHOUSE_HTTP_PORT为http协议端口,该mcp会自动切换,不一定需要全部填写; 2.CLICKHOUSE_RESOURCE_DESC_FILE是一个说明,可以将数据库中一些信息放入其中,例如什么表是做什么用的,能够提升模型理解能力. 3.CLICKHOUSE_ENABLED默认可以不用填

许可证

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for ClickHouse Readonly MCP from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/clickhouse-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage