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.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

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.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 5f6303b75d0e · 采集于 2026-11-13 11:34:07 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

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.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

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