跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 ClickHouse Cloud,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
在 AI 智能体中管理 ClickHouse Cloud 组织:列出服务及其状态、端点和扩缩容设置,启动、停止或唤醒服务,修改 IP 访问、标签和自动扩缩容,查看备份和 ClickPipes,读取以 ClickHouse Credits 计的使用成本和剩余额度,并查看通知、配额、成员、角色、API 密钥和审计日志。
试试这样问
ClickHouse Cloud 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → ClickHouse Cloud、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
ClickHouse Cloud + Cursor
在 AI 智能体中管理 ClickHouse Cloud 组织:列出服务及其状态、端点和扩缩容设置,启动、停止或唤醒服务,修改 IP 访问、标签和自动扩缩容,查看备份和 ClickPipes,读取以 ClickHouse Credits 计的使用成本和剩余额度,并查看通知、配额、成员、角色、API 密钥和审计日志。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
CLICKHOUSE_CLOUD_KEY_ID, CLICKHOUSE_CLOUD_KEY_SECRET
步骤 1 — 获取凭证
设置大约需要 3 分钟。你需要能访问该组织的 ClickHouse Cloud 控制台。
- 在 ClickHouse Cloud 控制台(https://console.clickhouse.cloud)打开 Organization、API keys,点击 New API key。
- 填写名称、有效期,可选 IP 允许列表,并选择所需角色:只读取时 read-only 或 developer 角色就够了;启动、停止、扩缩容和修改服务需要 admin,或带有服务管理权限的自定义角色。
- 把 Key ID 复制到
CLICKHOUSE_CLOUD_KEY_ID,把 Key secret 复制到CLICKHOUSE_CLOUD_KEY_SECRET。密钥只显示一次;丢失后请新建一个。API 以 HTTP Basic 认证接收两者(Key ID 作为用户名,密钥作为密码)。 - 安装连接器并运行
clickhouse_cloud_list_organizations:它会返回其他所有工具都需要的organization_id,同时确认密钥可用。
该连接器调用 Cloud 控制平面(https://api.clickhouse.cloud/v1),不执行 SQL。如需查询表数据,请安装 ClickHouse 连接器,它使用服务的 HTTPS 接口。
可以读取:
- 组织和密钥:
clickhouse_cloud_list_organizations、clickhouse_cloud_get_organization(私有端点、BYOC 设置)和clickhouse_cloud_whoami(密钥、所属组织和角色;ClickHouse 的 beta 端点)。 - 服务:
clickhouse_cloud_list_services(可按标签筛选,例如tag:Environment=Production)和clickhouse_cloud_get_service,包含状态、云厂商和区域、ClickHouse 版本、层级、端点、副本内存和数量、空闲缩容、IP 访问列表、发布通道和标签。clickhouse_cloud_get_service_settings显示与默认值不同的服务器设置,clickhouse_cloud_get_service_metrics以文本形式返回当前的 Prometheus 指标(filtered_metrics返回精选的简短列表)。 - 备份:
clickhouse_cloud_list_backups、clickhouse_cloud_get_backup(状态、开始和结束时间、大小、耗时、全量或增量)和clickhouse_cloud_get_backup_configuration(备份周期、保留时长和每日开始时间)。 - 数据接入:
clickhouse_cloud_list_clickpipes和clickhouse_cloud_get_clickpipe,查看来自 Kafka、S3、Postgres、MySQL 等来源的 ClickPipes。需要具有 ClickPipes 管理权限的密钥。 - 成本和健康状况:
clickhouse_cloud_get_usage_cost按天、按实体(数据仓库、服务、ClickPipe)给出成本及其构成指标(计算、存储、备份、数据传输),clickhouse_cloud_get_credit_balances(需要查看账单的权限),clickhouse_cloud_list_notifications(账单、服务健康、ClickPipe 故障、升级;可按严重程度、类型、资源或日期筛选)以及clickhouse_cloud_list_quotas。 - 人员和访问:
clickhouse_cloud_list_members、clickhouse_cloud_list_invitations、clickhouse_cloud_list_roles、clickhouse_cloud_list_api_keys(从不返回密钥本身),以及审计日志clickhouse_cloud_list_activities,包含操作者、IP 地址和目标 id。
可以修改:
clickhouse_cloud_change_service_state启动、停止或唤醒(awake)服务。停止会关闭计算资源:数据保留,计算计费停止,但在重新启动之前查询都会失败,因此 AI 会先征得你的同意。clickhouse_cloud_update_service重命名服务、设置发布通道(slow、default或fast),并添加或删除 IP 访问列表条目和标签。只有传入的字段会变化;删除先于添加执行。clickhouse_cloud_update_replica_scaling修改每个副本的内存(最小和最大值,单位 GB,须为 4 的倍数;内存上限仅适用于 Production 层级)、自动扩缩容模式、副本数量、空闲缩容和空闲超时(至少 5 分钟)。clickhouse_cloud_change_clickpipe_state启动、停止或重新同步 ClickPipe。重新同步会再次复制源表,因此 AI 会先和你确认。clickhouse_cloud_create_invitation通过电子邮件邀请成员,角色 id 来自clickhouse_cloud_list_roles。
安装后 26 个工具全部启用,没有被关闭的工具。如果只想让 AI 查看,请给密钥分配 read-only 角色。
数据格式:每个响应都是 {status, requestId, result},数据在 result 中。id 为 UUID,时间为 UTC 的 ISO 8601。成本以 ClickHouse Credits(CHC)计:grandTotalCHC 为整个时段,totalCHC 为单条记录。内存单位为 GB,备份大小为字节,耗时为秒。服务的 state 会先经过 starting 或 stopping,再变为 running 或 stopped;idle 表示已缩容到零,下一次查询会将其唤醒。
分页:clickhouse_cloud_list_organizations、clickhouse_cloud_list_api_keys 和 clickhouse_cloud_list_notifications 接受 limit(最多 250),还有更多条目时返回 nextCursor;AI 会把它作为 cursor 传入,直到不再出现。其他列表一次返回全部内容。
限制:一次使用成本报告最多覆盖 31 天(to_date 最多在 from_date 之后 30 天);更长的时段由 AI 分多次调用。API 按密钥限流。
常见错误:401 表示 Key ID 或密钥错误,或密钥已过期、已停用。403 表示密钥的角色缺少该调用所需的权限(账单、ClickPipes 和服务管理是彼此独立的权限),或调用方 IP 不在密钥的允许列表中:在 AnythingMCP Cloud 上添加服务器的出站 IP,自托管时添加你自己服务器的 IP。404 表示组织、服务或备份 id 错误。429 表示触发限流,请等待几秒后重试。
连接器不执行 SQL,不创建或删除服务,不恢复或删除备份,不创建或吊销 API 密钥,也不移除成员。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Cursor 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Cursor 从 ~/.cursor/mcp.json 读取 MCP 服务器。添加以下条目:
{
"mcpServers": {
"anythingmcp": {
"url": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启 Cursor。
- 打开 Cursor → Settings → MCP,确认
anythingmcp已列出并处于已连接状态。 - 开始对话,智能体现在可以调用
ClickHouse Cloud的工具。
可用工具
| Tool | What it does |
|---|---|
clickhouse_cloud_whoami | Who the API key is: key id, name, organization and assigned roles (actorType tells a key from a user) |
clickhouse_cloud_list_organizations | Organizations the API key belongs to (an organization key sees exactly one): id, name, creation date, private endpoints, BYOC configuration |
clickhouse_cloud_get_organization | Details of one organization: name, creation date, private endpoints and BYOC settings |
clickhouse_cloud_list_services | All ClickHouse services of the organization: id, name, cloud provider and region, state (running, idle, stopped, starting, stopping… |
clickhouse_cloud_get_service | One service with its current state, endpoints, ClickHouse version, scaling settings (min and max replica memory in GB, replicas, idle… |
clickhouse_cloud_get_service_settings | ClickHouse server settings changed on the service (the values that differ from the defaults) |
clickhouse_cloud_get_service_metrics | Current Prometheus metrics of a service as Prometheus text exposition (queries, inserts, memory, storage, merges, ...) |
clickhouse_cloud_list_backups | Backups of a service, newest first: id, status (done, error, in_progress), start and finish time, size in bytes, duration in seconds, type… |
clickhouse_cloud_get_backup | One backup of a service: status, start and finish time, size in bytes, duration and type |
clickhouse_cloud_get_backup_configuration | Backup schedule of a service: backup period in hours, retention period in hours and the daily start time (UTC) when set |
clickhouse_cloud_list_clickpipes | ClickPipes (managed ingestion from Kafka, S3, Postgres, MySQL, ...) of a service: id, name, state, source, destination table and scaling |
clickhouse_cloud_get_clickpipe | One ClickPipe with its state, source, destination, field mappings and settings |
clickhouse_cloud_get_usage_cost | Usage cost of the organization per day and per entity (data warehouse, service, ClickPipe) in ClickHouse Credits (CHC), with the metrics… |
clickhouse_cloud_get_credit_balances | Remaining prepaid credits of the organization, in total and per credit balance |
clickhouse_cloud_list_activities | Audit log of the organization: who did what and when (service created, stopped, scaled, key created, member invited, ...), with actor, IP… |
clickhouse_cloud_list_notifications | Notifications of the organization (billing, service health, ClickPipe failures, upgrades, ...), newest first, with severity, resource and… |
clickhouse_cloud_list_quotas | Quotas of the organization (for example the maximum number of services) with the current usage and whether they can be raised |
clickhouse_cloud_list_members | Members of the organization: user id, name, e-mail, role and assigned roles, join date |
clickhouse_cloud_list_invitations | Open invitations to the organization: e-mail, role, creation and expiry date |
clickhouse_cloud_list_roles | Roles defined in the organization (built-in and custom) with their permissions; the role ids are used by clickhouse_cloud_create_invitation |
clickhouse_cloud_list_api_keys | API keys of the organization: id, name, state, roles, key suffix, creation, expiry and last use |
clickhouse_cloud_change_service_state | Start, stop or wake a service. stop shuts the compute down (data is kept, billing for compute stops); start brings a stopped service back… |
clickhouse_cloud_update_service | Rename a service, change its release channel, add or remove IP access list entries or tags |
clickhouse_cloud_update_replica_scaling | Change the autoscaling of a service: memory per replica (min and max in GB, multiples of 4), number of replicas, idle scaling and idle… |
clickhouse_cloud_change_clickpipe_state | Start or stop a ClickPipe, or resync it (a database CDC pipe copies the source tables again) |
clickhouse_cloud_create_invitation | Invite a person to the organization by e-mail |
示例提示
- “我们的 ClickHouse Cloud 服务中,哪些正在运行,哪些处于空闲或已停止?”
- “我们 10 月按服务分别用了多少 ClickHouse Credits?哪一天花费最高?”
- “生产服务昨晚的备份完成了吗?给我看它的大小和耗时。”
- “把 203.0.113.0/24 加入 staging 服务的 IP 访问列表,描述为‘办公室’。”
- “最近 7 天谁停止或扩缩过服务?给我看审计日志里的相关条目。”
FAQ
Cursor 免费套餐支持自定义 MCP 服务器吗? 支持,Hobby、Pro 和 Business 套餐均可使用 MCP。
下一步
这份指南对你有帮助吗?