Clickhouse MCP server

Connect Clickhouse to Claude, ChatGPT, Cursor, Claude Code, Codex, Gemini, GitHub Copilot and any other MCP client, for your whole team. Metorial adds security, governance, and tracing, and gives everyone one Magic MCP URL to connect.

What you can do with the Clickhouse MCP server

Ask your agent in plain language. Each of these maps to a real tool on the server.

  • Use the list backups tool in Clickhouse
  • Use the update member tool in Clickhouse
  • Use the control service state tool in Clickhouse
  • Use the delete query endpoint tool in Clickhouse
  • Use the get backup configuration tool in Clickhouse
  • Use the get click pipe settings tool in Clickhouse

Supported Tools

list_backups

List Backups

List all backups for a ClickHouse service, with the most recent backups listed first. Includes backup status, timestamps, and size.

update_member

Update Member

Update an organization member's role or assigned roles. Use this to promote, demote, or change permissions for a member.

control_service_state

Control Service State

Start, stop, or wake an idle ClickHouse service. A service must be stopped before it can be deleted.

delete_query_endpoint

Delete Query Endpoint

Delete the query endpoint configuration for a service.

get_backup_configuration

Get Backup Configuration

Retrieve the current backup configuration for a service, including backup schedule and retention settings.

get_clickpipe_settings

Get ClickPipe Settings

Retrieve tunable settings for a ClickPipe.

update_clickstack_dashboard

Update ClickStack Dashboard

Update a ClickStack dashboard. The official API expects a full dashboard body including name and tiles.

update_clickpipe

Update ClickPipe

Update a ClickPipe's name, source, destination, field mappings, or settings. This uses the official ClickPipes PATCH endpoint.

list_clickstack_sources

List ClickStack Sources

List ClickStack data sources for a service. Source IDs are needed when creating or updating dashboard tiles.

update_api_key

Update API Key

Update a ClickHouse Cloud API key's name, state, role assignments, expiration, or IP allow list.

configure_clickpipe_scaling

Configure ClickPipe Scaling

Configure scaling for a Kafka, object storage, or streaming ClickPipe.

delete_service

Delete Service

Delete a ClickHouse service. The service **must be stopped** before deletion. Deletion is asynchronous and cannot be undone.

list_invitations

List Invitations

List all pending invitations for the organization. Shows who has been invited, their assigned roles, deprecated role, and expiration dates.

create_invitation

Create Invitation

Invite a new member to the organization by email. Specify the role and optional assigned role IDs.

upsert_query_endpoint

Upsert Query Endpoint

Create or update a query endpoint for a service. Query endpoints allow creating API endpoints directly from saved SQL queries. Supports parameterized queries, custom API key access, and CORS policies.

delete_invitation

Delete Invitation

Revoke a pending invitation. The invitee will no longer be able to join the organization using this invitation.

get_usage

Get Usage & Costs

Retrieve usage and cost information for the organization over a date range. Covers Storage, Compute, Data Transfer, ClickPipes, and Backup costs. Maximum queryable range is 31 days.

delete_api_key

Delete API Key

Permanently delete an API key. The key used to authenticate the current request cannot be deleted.

update_clickstack_alert

Update ClickStack Alert

Update a ClickStack alert. Pass the alert fields supported by the official ClickStack alert update request.

get_clickpipe

Get ClickPipe

Retrieve detailed information about a specific ClickPipe, including its source configuration, destination, state, and scaling settings.

create_api_key

Create API Key

Create a new API key for the organization. Specify the key name, permissions/roles, expiration, and optional IP restrictions. The key secret is only returned once — store it securely.

create_clickstack_dashboard

Create ClickStack Dashboard

Create a new ClickStack observability dashboard for a service. Dashboards can contain tiles with charts configured with SQL or Lucene queries and aggregation functions.

get_clickstack_dashboard

Get ClickStack Dashboard

Retrieve a ClickStack dashboard, including tiles, tags, filters, and saved query defaults.

get_organization

Get Organization

Retrieve the details of the ClickHouse Cloud organization, including its name, creation date, private endpoints, and BYOC configuration.

list_clickstack_alerts

List ClickStack Alerts

List all ClickStack alerts configured for a service. Alerts support webhook notifications to services like Slack and PagerDuty.

list_reverse_private_endpoints

List Reverse Private Endpoints

List all reverse private endpoints for a service. Reverse private endpoints allow ClickHouse Cloud to securely initiate connections to private customer resources.

get_service

Get Service

Retrieve detailed information about a specific ClickHouse service, including its state, scaling configuration, endpoints, IP access list, tags, and encryption settings.

delete_byoc_infrastructure

Delete BYOC Infrastructure

Delete a BYOC infrastructure from the organization.

create_service

Create Service

Create a new ClickHouse Cloud service. Specify the cloud provider, region, scaling settings, and other configuration. The response includes the generated database password — store it securely as it cannot be retrieved later.

list_api_keys

List API Keys

List all API keys in the organization. Shows key names, states, expiration dates, and assigned roles.

list_activities

List Activities

Retrieve the audit log of organization activities. Optionally filter by date range to see who performed what actions and when.

get_private_endpoint_config

Get Private Endpoint Config

Retrieve the private endpoint configuration for a specific service. Shows available private endpoint service IDs for connecting from your cloud VPC.

insert_rows

Insert Rows

Insert JSON object rows into a ClickHouse table over the HTTP interface using FORMAT JSONEachRow.

configure_scaling

Configure Scaling

Update the scaling configuration for a ClickHouse service. Adjust replica memory ranges, number of replicas, idle scaling behavior, and idle timeout.

get_api_key

Get API Key

Retrieve details for a ClickHouse Cloud API key. The key secret is not returned by the Cloud API after creation.

create_reverse_private_endpoint

Create Reverse Private Endpoint

Create a new reverse private endpoint for a service, enabling ClickHouse Cloud to securely connect to your private resources.

delete_clickstack_alert

Delete ClickStack Alert

Delete a ClickStack alert from a service.

configure_cdc_clickpipes_scaling

Configure CDC ClickPipes Scaling

Configure shared CPU and memory scaling for database CDC ClickPipes on a service.

run_query_endpoint

Run Query Endpoint

Execute a saved ClickHouse Cloud Query API endpoint using OpenAPI key Basic Auth. Supports endpoint versions, ClickHouse response formats, query variables, request timeout, and ClickHouse settings.

get_cdc_clickpipes_scaling

Get CDC ClickPipes Scaling

Retrieve shared scaling configuration for database CDC ClickPipes on a service.

list_tables

List Tables

List tables visible to the supplied ClickHouse database user, optionally scoped to one database.

get_clickstack_alert

Get ClickStack Alert

Retrieve a ClickStack alert, including state, schedule, threshold, and notification channel details.

list_clickpipes

List ClickPipes

List all ClickPipes (data ingestion pipelines) for a service. Shows pipeline names, states, scaling settings, and source configurations.

update_service

Update Service

Update a ClickHouse service's configuration, including its name, IP access list, tags, release channel, and endpoint settings. Use separate tools for scaling and state changes.

remove_member

Remove Member

Remove a member from the organization. This action is irreversible.

describe_table

Describe Table

Describe a ClickHouse table and return column metadata.

create_byoc_infrastructure

Create BYOC Infrastructure

Create new Bring Your Own Cloud (BYOC) infrastructure in the organization. BYOC lets you deploy ClickHouse services in your own cloud account.

delete_clickstack_dashboard

Delete ClickStack Dashboard

Delete a ClickStack dashboard from a service.

delete_reverse_private_endpoint

Delete Reverse Private Endpoint

Delete a reverse private endpoint from a service.

update_backup_configuration

Update Backup Configuration

Update the backup configuration for a service. Modify backup schedules, retention periods, and other backup settings.

update_byoc_infrastructure

Update BYOC Infrastructure

Update an existing BYOC infrastructure configuration, such as its display name.

get_prometheus_metrics

Get Prometheus Metrics

Retrieve Prometheus-format metrics for all services or a specific service. Includes metrics from system.metrics, system.events, and system.asynchronous_metrics. Idle services only return the ClickHouse_ServiceInfo gauge.

create_clickpipe

Create ClickPipe

Create a new ClickPipe data ingestion pipeline for a service. ClickPipes support sources like Apache Kafka, object storage, Amazon Kinesis, PostgreSQL, MySQL, BigQuery, and MongoDB. Provide the source configuration and destination table settings.

list_clickstack_dashboards

List ClickStack Dashboards

List all ClickStack observability dashboards for a service. ClickStack is the built-in observability platform for ClickHouse Cloud.

control_clickpipe_state

Control ClickPipe State

Change the state of a ClickPipe. Start, stop, or resync a data ingestion pipeline.

list_services

List Services

List all ClickHouse services in the organization. Optionally filter services by tags. Returns service names, states, cloud provider, region, scaling configuration, and endpoints.

execute_query

Execute Query

Execute a read-only SQL query against a ClickHouse service over the HTTP interface. Mutating statements are rejected; use insert_rows for inserts.

list_databases

List Databases

List databases available to the supplied ClickHouse database user via the HTTP interface.

delete_clickpipe

Delete ClickPipe

Delete a ClickPipe data ingestion pipeline from a service.

list_members

List Members

List all members in the organization. Returns each member's user ID, name, email, assigned roles, deprecated role, and join date.

get_backup

Get Backup

Retrieve details for a specific ClickHouse service backup.

update_clickpipe_settings

Update ClickPipe Settings

Replace tunable settings for a ClickPipe. The request body is passed to the official ClickPipe settings PUT endpoint.

list_clickstack_webhooks

List ClickStack Webhooks

List ClickStack webhook destinations for a service. Webhook IDs are needed for alert notification channels.

create_clickstack_alert

Create ClickStack Alert

Create a new ClickStack alert for a service. Alerts monitor metrics and send notifications via webhooks (Slack, PagerDuty, etc.) when thresholds are breached.

get_query_endpoint

Get Query Endpoint

Retrieve the query endpoint configuration for a service. Query endpoints expose saved SQL queries as HTTP API endpoints.

get_role

Get Role

Retrieve a ClickHouse Cloud organization role by ID.

list_roles

List Roles

List organization roles available for assignment to members and API keys.

Connect Clickhouse to your AI client

Every client uses the same Magic MCP URL, and so does any other MCP client. Add it once and sign in with SSO.

  1. Enable Clickhouse in Metorial. In your Metorial portal, enable the Clickhouse MCP server and sign in with the account that owns the data. Access stays governed by your team policies.
  2. Add a custom connector. Open Customize, then Connectors. Select Add, then Custom, then Web.
  3. Paste your Metorial MCP URL. Name it Metorial, paste your Magic MCP URL (<your-magic-mcp-url>) and continue.
  4. Sign in. Select Add and sign in to load Clickhouse tools.

Run Clickhouse through the Metorial gateway

One governed layer for every app your agents reach, not a separate connector per tool.

  • Give Clickhouse and every other app to your whole team through one MCP gateway, behind your SSO.
  • Scope which teams and agents can use Clickhouse tools with role-based access control, and trace every call.
  • Prefer to run it yourself? Metorial is open source and self-hostable.

More integrations teams use with Clickhouse

Google Sheets

Create, read, and update spreadsheets and their cell data. Read and write values to individual cells, ranges, or multiple ranges using A1 notation or named ranges. Apply cell formatting including text styles, backgrounds, borders, number formats, and conditional formatting. Manage sheets (tabs) within a spreadsheet—add, delete, copy, rename, and reorder them. Create and manage embedded charts, pivot tables, filter views, data validation rules, protected ranges, named ranges, and merged cells. Perform batch operations to apply multiple updates atomically.

GitHub

Manage repositories, issues, and pull requests. Create and configure branches, star repositories, review code, and merge changes. Automate CI/CD workflows with GitHub Actions, manage workflow runs, secrets, and artifacts. Track issues with labels, milestones, and assignees. Search across code, repositories, issues, and users. Manage organizations, teams, and memberships. Create and manage projects, gists, packages, deployments, and environments. Access security alerts including code scanning, secret scanning, and Dependabot alerts. Read and write file contents in repositories. Manage webhooks, notifications, and codespaces.

Salesforce

Manage CRM data including Accounts, Contacts, Leads, Opportunities, Cases, and custom objects. Create, read, update, and delete records. Query data using SOQL and search across objects using SOSL. Perform bulk data operations for large-scale imports, exports, and migrations. Execute composite requests to batch multiple operations in a single API call. Access analytics, reports, and dashboards. Manage files and attachments associated with records. Interact with Chatter feeds, posts, and groups for social collaboration. Manage org metadata including custom objects, fields, layouts, and workflows. Query data using GraphQL for precise data retrieval across related objects.

Sharepoint

Manage SharePoint sites, document libraries, lists, and files. Create, read, update, and delete lists and list items with custom columns. Resolve site users to numeric Person/Group LookupId values. Upload, download, move, copy, and version files in document libraries. Search across sites, files, folders, lists, and list items using Microsoft Search. Manage permissions at site, list, and item levels with granular access control. Define and manage content types and site columns. Retrieve site properties and search for sites across Microsoft 365.

Airtable

Create, read, update, and delete records in Airtable bases and tables. Manage base schemas including creating tables and fields. Filter records using formulas, sort by fields, and scope queries to specific views. Upsert records to find, create, or update in a single call. Upload attachments to records, read and write record comments, list accessible bases, and receive real-time base change events through webhooks.

Google Drive

Upload, download, create, copy, move, rename, trash, and permanently delete files and folders in Google Drive. Search for files using complex queries filtering by name, MIME type, owner, modification date, labels, and other metadata. Share files and folders with specific users, groups, or domains with role-based permissions (owner, writer, commenter, reader). Manage shared drives and their members. Export Google Workspace files (Docs, Sheets, Slides) to standard formats like PDF, DOCX, and XLSX. Track file revision history and restore earlier versions. Create, read, update, and delete threaded comments and replies on files. Read label definitions and search files by label. Browse the Drive apps installed for your account. Store app-specific data in a hidden per-user folder.

Technical notes for Clickhouse

Manage ClickHouse Cloud organizations, services, and infrastructure via the REST API. Create, start, stop, and delete analytical database services. Configure scaling policies, replicas, and resource allocation. Manage backups, API keys, and organization members. Create and manage ClickPipes data ingestion pipelines from sources like Kafka, S3, Kinesis, PostgreSQL, and MySQL. Set up query API endpoints from saved SQL queries. Manage private endpoints, retrieve usage and cost metrics, fetch Prometheus metrics, and configure BYOC (Bring Your Own Cloud) infrastructure. Create and manage observability dashboards, alerts, and webhook notifications via ClickStack.

Frequently asked questions

Common questions about connecting Clickhouse to AI agents with Metorial.

  1. How many tools does the Clickhouse MCP server have?
    The Clickhouse MCP server exposes 67 tools, including List Backups, Update Member, Control Service State. Each one is governed and traced through Metorial.
  2. Clickhouse exposes tools your agents call on demand; it does not publish event triggers yet. Everything still runs through one governed MCP URL.
  3. Any MCP client, including VS Code, Windsurf, Zed, OpenCode and Grok. Each one reaches the Clickhouse MCP server through the same Metorial URL.
  4. Use role-based access control to decide which teams, users, and agents can use Clickhouse and which of its tools they can call.
  5. Yes. Metorial is open source, so you can run the Clickhouse MCP server yourself or use the hosted gateway.

Connect Clickhouse to production AI agents

See how Metorial gives your team governed access to Clickhouse, with tracing and security controls built in.