LabscoMCP early access ↗
oualibMCP SERVER

ClickHouse Cloud & On-Prem

Query any ClickHouse database read-only, and manage ClickHouse Cloud infrastructure — two capabilities, either one on its own.

by oualib ↗Relational SQL DatabasesCommunity

LABSCO SUMMARY

Both halves start read-only. Turning the cloud flag off is what makes create and delete live.

The database side is safe by default: readonly filtering blocks anything that is not a SELECT, SHOW, DESCRIBE or EXPLAIN. The cloud side is read-only by default too, because the code treats an unset CLICKHOUSE_CLOUD_READONLY as on. Setting it to false makes create and delete live, and creating a service costs money. The two halves are independent, so the cautious setup is database credentials only until you actually need infrastructure control.

What it is

A ClickHouse server with two independent halves. The database half queries any instance — local, self-hosted, Cloud, or the free SQL Playground. The cloud half covers the ClickHouse Cloud API. You configure one, the other, or both; each half activates only when its credentials are present.

What you get

  • Database, 3 tools: list_databases, list_tables with schema, row counts and column metadata, and run_query
  • Query safety: with CLICKHOUSE_READONLY=true every query runs with readonly = 1 and only SELECT, SHOW, DESCRIBE and EXPLAIN are permitted
  • Cloud monitoring: cloud_list_organizations, cloud_list_services, cloud_get_service_metrics, cloud_get_usage_cost, cloud_list_activities for audit logs, and backup and ClickPipe inspection
  • Cloud management, when writes are enabled: cloud_create_service, cloud_update_service_state to start and stop, replica scaling, cloud_delete_service, API key CRUD, member and invitation management, backup configuration and ClickPipe control
  • Over 50 cloud tools in total, split by whether the readonly flag admits them

Requirements

For the database half: CLICKHOUSE_HOST, CLICKHOUSE_USER and CLICKHOUSE_PASSWORD, with CLICKHOUSE_READONLY recommended true; CLICKHOUSE_PORT defaults to 8443 for HTTPS or 8123 for HTTP, and CLICKHOUSE_SECURE, CLICKHOUSE_VERIFY, CLICKHOUSE_CONNECT_TIMEOUT and CLICKHOUSE_SEND_RECEIVE_TIMEOUT cover the rest. For the cloud half: CLICKHOUSE_CLOUD_KEY_ID and CLICKHOUSE_CLOUD_KEY_SECRET from the Cloud console, with CLICKHOUSE_CLOUD_READONLY, which defaults to true, so the cloud tools only read until you set it to false. The Python package is chmcp, version 0.1.2, requiring Python 3.12+ and launched through uv.

Setup effort

One command — uv add chmcp