Set up ClickHouse in Metorial for Claude, ChatGPT and Cursor
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'll 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 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, 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
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
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.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from ClickHouse.
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:
Employee: connect ClickHouse
In the portal
Open ClickHouse in the catalog
Sign in to your portal and open ClickHouse. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. In the setup window, enter your API key (keyId and keySecret).
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
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.
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.
Check it worked
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)
Show all 33 read-only tools
list_backups: List all backups for a ClickHouse service, with the most recent backups listed first. NeedsserviceId.get_backup_configuration: Retrieve the current backup configuration for a service, including backup schedule and retention settings. NeedsserviceId.get_clickpipe_settings: Retrieve tunable settings for a ClickPipe. NeedsserviceIdandclickpipeId.list_clickstack_sources: List ClickStack data sources for a service. NeedsserviceId.list_invitations: List all pending invitations for the organization.get_usage: Retrieve usage and cost information for the organization over a date range. NeedsfromDateandtoDate.get_clickpipe: Retrieve detailed information about a specific ClickPipe, including its source configuration, destination, state, and scaling settings. NeedsserviceIdandclickpipeId.get_clickstack_dashboard: Retrieve a ClickStack dashboard, including tiles, tags, filters, and saved query defaults. NeedsserviceIdanddashboardId.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. NeedsserviceId.list_reverse_private_endpoints: List all reverse private endpoints for a service. NeedsserviceId.get_service: Retrieve detailed information about a specific ClickHouse service, including its state, scaling configuration, endpoints, IP access list, tags, and encryption settings. NeedsserviceId.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. NeedsserviceId.get_api_key: Retrieve details for a ClickHouse Cloud API key. NeedskeyId.run_query_endpoint: Execute a saved ClickHouse Cloud Query API endpoint using OpenAPI key Basic Auth. NeedsendpointId.get_cdc_clickpipes_scaling: Retrieve shared scaling configuration for database CDC ClickPipes on a service. NeedsserviceId.list_tables: List tables visible to the supplied ClickHouse database user, optionally scoped to one database. Needsendpoint,usernameandpassword.get_clickstack_alert: Retrieve a ClickStack alert, including state, schedule, threshold, and notification channel details. NeedsserviceIdandalertId.list_clickpipes: List all ClickPipes (data ingestion pipelines) for a service. NeedsserviceId.describe_table: Describe a ClickHouse table and return column metadata. Needsendpoint,username,passwordandtable.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. NeedsserviceId.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. Needsendpoint,username,passwordandsql.list_databases: List databases available to the supplied ClickHouse database user via the HTTP interface. Needsendpoint,usernameandpassword.list_members: List all members in the organization.get_backup: Retrieve details for a specific ClickHouse service backup. NeedsserviceIdandbackupId.list_clickstack_webhooks: List ClickStack webhook destinations for a service. NeedsserviceId.get_query_endpoint: Retrieve the query endpoint configuration for a service. NeedsserviceId.get_role: Retrieve a ClickHouse Cloud organization role by ID. NeedsroleId.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. NeedsuserId.control_service_state: Start, stop, or wake an idle ClickHouse service. NeedsserviceIdandcommand.update_clickstack_dashboard: Update a ClickStack dashboard. NeedsserviceId,dashboardId,nameandtiles.update_clickpipe: Update a ClickPipe's name, source, destination, field mappings, or settings. NeedsserviceIdandclickpipeId.update_api_key: Update a ClickHouse Cloud API key's name, state, role assignments, expiration, or IP allow list. NeedskeyId.configure_clickpipe_scaling: Configure scaling for a Kafka, object storage, or streaming ClickPipe. NeedsserviceId,clickpipeIdandscaling.create_invitation: Invite a new member to the organization by email. Needsemail.upsert_query_endpoint: Create or update a query endpoint for a service. NeedsserviceIdandendpointSettings.update_clickstack_alert: Update a ClickStack alert. NeedsserviceId,alertIdandalertSettings.create_api_key: Create a new API key for the organization. Needsname.create_clickstack_dashboard: Create a new ClickStack observability dashboard for a service. NeedsserviceId,nameandtiles.create_service: Create a new ClickHouse Cloud service. Needsname,providerandregion.configure_scaling: Update the scaling configuration for a ClickHouse service. NeedsserviceId.create_reverse_private_endpoint: Create a new reverse private endpoint for a service, enabling ClickHouse Cloud to securely connect to your private resources. NeedsserviceIdandtype.configure_cdc_clickpipes_scaling: Configure shared CPU and memory scaling for database CDC ClickPipes on a service. NeedsserviceIdandscaling.update_service: Update a ClickHouse service's configuration, including its name, IP access list, tags, release channel, and endpoint settings. NeedsserviceId.create_byoc_infrastructure: Create new Bring Your Own Cloud (BYOC) infrastructure in the organization. NeedsregionId,accountIdanddisplayName.update_backup_configuration: Update the backup configuration for a service. NeedsserviceIdandsettings.update_byoc_infrastructure: Update an existing BYOC infrastructure configuration, such as its display name. NeedsbyocId.create_clickpipe: Create a new ClickPipe data ingestion pipeline for a service. NeedsserviceId,name,sourceanddestination.control_clickpipe_state: Change the state of a ClickPipe. NeedsserviceId,clickpipeIdandcommand.update_clickpipe_settings: Replace tunable settings for a ClickPipe. NeedsserviceId,clickpipeIdandsettings.create_clickstack_alert: Create a new ClickStack alert for a service. NeedsserviceId,name,threshold,thresholdTypeandinterval.
Destructive tools (11)
delete_query_endpoint: Delete the query endpoint configuration for a service. NeedsserviceId.delete_service: Delete a ClickHouse service. NeedsserviceId.delete_invitation: Revoke a pending invitation. NeedsinvitationId.delete_api_key: Permanently delete an API key. NeedskeyId.delete_byoc_infrastructure: Delete a BYOC infrastructure from the organization. NeedsbyocId.insert_rows: Insert JSON object rows into a ClickHouse table over the HTTP interface using FORMAT JSONEachRow. Needsendpoint,username,password,tableandrows.delete_clickstack_alert: Delete a ClickStack alert from a service. NeedsserviceIdandalertId.remove_member: Remove a member from the organization. NeedsuserId.delete_clickstack_dashboard: Delete a ClickStack dashboard from a service. NeedsserviceIdanddashboardId.delete_reverse_private_endpoint: Delete a reverse private endpoint from a service. NeedsserviceIdandreversePrivateEndpointId.delete_clickpipe: Delete a ClickPipe data ingestion pipeline from a service. NeedsserviceIdandclickpipeId.
Triggers
ClickHouse has 1 trigger, which fire on events in ClickHouse:
inbound_webhook
Next steps
- Claude Code, Cursor, Codex and ChatGPT: connect each client to your portal and use ClickHouse there
- Tool permissions: tool filters and what employees see
- ClickHouse on metorial.com: the integration overview