> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up ClickHouse in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/clickhouse
Last updated: 2026-11-24

Share ClickHouse with your team in Claude, ChatGPT and Cursor through Metorial: API key sign-in, 67 tools (33 read-only).

---

To give your team ClickHouse in Claude, ChatGPT, Cursor and other AI clients, an admin shares the ClickHouse integration in a Metorial portal, and each person connects with an API key. Agents can manage ClickHouse Cloud organizations, services, and infrastructure via the REST API. The integration has 67 tools, 33 read-only, 23 write and 11 destructive, plus 1 trigger.

**What you will learn**

- How an admin shares ClickHouse in a portal and how each person connects
- What ClickHouse asks for when you connect, and where to find it
- How to keep the 33 read-only tools and reject the other 34

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An API key from ClickHouse for each person, or one for a shared connection
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in method

| Method | Type | What a person provides |
| --- | --- | --- |
| **API Key** | Custom credentials | `keyId` and `keySecret` |

### API Key

To connect, a person enters these values:

- `keyId`: The API Key ID (used as the username for HTTP Basic Auth)
- `keySecret`: The API Key Secret (used as the password for HTTP Basic Auth)

### Setup settings

Setup also asks for:

- `organizationId`: The ClickHouse Cloud organization ID. All API operations are scoped to this organization.

## Admin: share ClickHouse in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose ClickHouse. For how members connect, choose **Each person connects** so everyone enters their own API key, or **Shared connection** to enter one API key for everyone.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from ClickHouse.

4. **Choose who gets it**

   Add the access groups that should see ClickHouse. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user ClickHouse integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search clickhouse
```

## Employee: connect ClickHouse

### In the portal

1. **Open ClickHouse in the catalog**

   Sign in to your portal and open ClickHouse. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your API key (keyId and keySecret).

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search clickhouse
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. 

### Add it to your AI client

`metorial install` adds your ClickHouse connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list clickhouse
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 33 read-only tools, such as `get_role` and `get_usage`, and lose the 23 write tools, such as `update_member` or `create_api_key`, and the 11 destructive tools, such as `insert_rows` or `remove_member`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list clickhouse
metorial tools <integration-id>
metorial call <integration-id> list_roles -d '{}'
```

`metorial tools` lists the 67 tools, minus any you rejected. `list_roles` takes no input. It lists organization roles available for assignment to members and API keys.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (33)

- `list_backups`: List all backups for a ClickHouse service, with the most recent backups listed first. Needs `serviceId`.
- `get_backup_configuration`: Retrieve the current backup configuration for a service, including backup schedule and retention settings. Needs `serviceId`.
- `get_clickpipe_settings`: Retrieve tunable settings for a ClickPipe. Needs `serviceId` and `clickpipeId`.
- `list_clickstack_sources`: List ClickStack data sources for a service. Needs `serviceId`.
- `list_invitations`: List all pending invitations for the organization.
- `get_usage`: Retrieve usage and cost information for the organization over a date range. Needs `fromDate` and `toDate`.
- `get_clickpipe`: Retrieve detailed information about a specific ClickPipe, including its source configuration, destination, state, and scaling settings. Needs `serviceId` and `clickpipeId`.
- `get_clickstack_dashboard`: Retrieve a ClickStack dashboard, including tiles, tags, filters, and saved query defaults. Needs `serviceId` and `dashboardId`.
- `get_organization`: Retrieve the details of the ClickHouse Cloud organization, including its name, creation date, private endpoints, and BYOC configuration.
- `list_clickstack_alerts`: List all ClickStack alerts configured for a service. Needs `serviceId`.
- `list_reverse_private_endpoints`: List all reverse private endpoints for a service. Needs `serviceId`.
- `get_service`: Retrieve detailed information about a specific ClickHouse service, including its state, scaling configuration, endpoints, IP access list, tags, and encryption settings. Needs `serviceId`.
- `list_api_keys`: List all API keys in the organization.
- `list_activities`: Retrieve the audit log of organization activities.
- `get_private_endpoint_config`: Retrieve the private endpoint configuration for a specific service. Needs `serviceId`.
- `get_api_key`: Retrieve details for a ClickHouse Cloud API key. Needs `keyId`.
- `run_query_endpoint`: Execute a saved ClickHouse Cloud Query API endpoint using OpenAPI key Basic Auth. Needs `endpointId`.
- `get_cdc_clickpipes_scaling`: Retrieve shared scaling configuration for database CDC ClickPipes on a service. Needs `serviceId`.
- `list_tables`: List tables visible to the supplied ClickHouse database user, optionally scoped to one database. Needs `endpoint`, `username` and `password`.
- `get_clickstack_alert`: Retrieve a ClickStack alert, including state, schedule, threshold, and notification channel details. Needs `serviceId` and `alertId`.
- `list_clickpipes`: List all ClickPipes (data ingestion pipelines) for a service. Needs `serviceId`.
- `describe_table`: Describe a ClickHouse table and return column metadata. Needs `endpoint`, `username`, `password` and `table`.
- `get_prometheus_metrics`: Retrieve Prometheus-format metrics for all services or a specific service.
- `list_clickstack_dashboards`: List all ClickStack observability dashboards for a service. Needs `serviceId`.
- `list_services`: List all ClickHouse services in the organization.
- `execute_query`: Execute a read-only SQL query against a ClickHouse service over the HTTP interface. Needs `endpoint`, `username`, `password` and `sql`.
- `list_databases`: List databases available to the supplied ClickHouse database user via the HTTP interface. Needs `endpoint`, `username` and `password`.
- `list_members`: List all members in the organization.
- `get_backup`: Retrieve details for a specific ClickHouse service backup. Needs `serviceId` and `backupId`.
- `list_clickstack_webhooks`: List ClickStack webhook destinations for a service. Needs `serviceId`.
- `get_query_endpoint`: Retrieve the query endpoint configuration for a service. Needs `serviceId`.
- `get_role`: Retrieve a ClickHouse Cloud organization role by ID. Needs `roleId`.
- `list_roles`: List organization roles available for assignment to members and API keys.

### Write tools (23)

- `update_member`: Update an organization member's role or assigned roles. Needs `userId`.
- `control_service_state`: Start, stop, or wake an idle ClickHouse service. Needs `serviceId` and `command`.
- `update_clickstack_dashboard`: Update a ClickStack dashboard. Needs `serviceId`, `dashboardId`, `name` and `tiles`.
- `update_clickpipe`: Update a ClickPipe's name, source, destination, field mappings, or settings. Needs `serviceId` and `clickpipeId`.
- `update_api_key`: Update a ClickHouse Cloud API key's name, state, role assignments, expiration, or IP allow list. Needs `keyId`.
- `configure_clickpipe_scaling`: Configure scaling for a Kafka, object storage, or streaming ClickPipe. Needs `serviceId`, `clickpipeId` and `scaling`.
- `create_invitation`: Invite a new member to the organization by email. Needs `email`.
- `upsert_query_endpoint`: Create or update a query endpoint for a service. Needs `serviceId` and `endpointSettings`.
- `update_clickstack_alert`: Update a ClickStack alert. Needs `serviceId`, `alertId` and `alertSettings`.
- `create_api_key`: Create a new API key for the organization. Needs `name`.
- `create_clickstack_dashboard`: Create a new ClickStack observability dashboard for a service. Needs `serviceId`, `name` and `tiles`.
- `create_service`: Create a new ClickHouse Cloud service. Needs `name`, `provider` and `region`.
- `configure_scaling`: Update the scaling configuration for a ClickHouse service. Needs `serviceId`.
- `create_reverse_private_endpoint`: Create a new reverse private endpoint for a service, enabling ClickHouse Cloud to securely connect to your private resources. Needs `serviceId` and `type`.
- `configure_cdc_clickpipes_scaling`: Configure shared CPU and memory scaling for database CDC ClickPipes on a service. Needs `serviceId` and `scaling`.
- `update_service`: Update a ClickHouse service's configuration, including its name, IP access list, tags, release channel, and endpoint settings. Needs `serviceId`.
- `create_byoc_infrastructure`: Create new Bring Your Own Cloud (BYOC) infrastructure in the organization. Needs `regionId`, `accountId` and `displayName`.
- `update_backup_configuration`: Update the backup configuration for a service. Needs `serviceId` and `settings`.
- `update_byoc_infrastructure`: Update an existing BYOC infrastructure configuration, such as its display name. Needs `byocId`.
- `create_clickpipe`: Create a new ClickPipe data ingestion pipeline for a service. Needs `serviceId`, `name`, `source` and `destination`.
- `control_clickpipe_state`: Change the state of a ClickPipe. Needs `serviceId`, `clickpipeId` and `command`.
- `update_clickpipe_settings`: Replace tunable settings for a ClickPipe. Needs `serviceId`, `clickpipeId` and `settings`.
- `create_clickstack_alert`: Create a new ClickStack alert for a service. Needs `serviceId`, `name`, `threshold`, `thresholdType` and `interval`.

### Destructive tools (11)

- `delete_query_endpoint`: Delete the query endpoint configuration for a service. Needs `serviceId`.
- `delete_service`: Delete a ClickHouse service. Needs `serviceId`.
- `delete_invitation`: Revoke a pending invitation. Needs `invitationId`.
- `delete_api_key`: Permanently delete an API key. Needs `keyId`.
- `delete_byoc_infrastructure`: Delete a BYOC infrastructure from the organization. Needs `byocId`.
- `insert_rows`: Insert JSON object rows into a ClickHouse table over the HTTP interface using FORMAT JSONEachRow. Needs `endpoint`, `username`, `password`, `table` and `rows`.
- `delete_clickstack_alert`: Delete a ClickStack alert from a service. Needs `serviceId` and `alertId`.
- `remove_member`: Remove a member from the organization. Needs `userId`.
- `delete_clickstack_dashboard`: Delete a ClickStack dashboard from a service. Needs `serviceId` and `dashboardId`.
- `delete_reverse_private_endpoint`: Delete a reverse private endpoint from a service. Needs `serviceId` and `reversePrivateEndpointId`.
- `delete_clickpipe`: Delete a ClickPipe data ingestion pipeline from a service. Needs `serviceId` and `clickpipeId`.

## Triggers

ClickHouse has 1 trigger, which fire on events in ClickHouse:

- `inbound_webhook`

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use ClickHouse there
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [ClickHouse on metorial.com](https://metorial.com/integrations/clickhouse): the integration overview