The database side is safe by default: readonly filtering blocks anything that is not a SELECT, SHOW, DESCRIBE or EXPLAIN. The cloud side is not — `CLICKHOUSE_CLOUD_READONLY` defaults to false, so create and delete are live unless you say otherwise, 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.
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.
- 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
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` — note it defaults to false, meaning writes are allowed unless you set it true. The Python package is `chmcp`, version 0.1.2, requiring Python 3.12+ and launched through uv.
One command plus a key — uv add chmcp, then supply credentials
