- A running ClickHouse Cloud service
- Your IDE or agentic development tool of choice
- For headless authentication, a ClickHouse Cloud API key with access to the required organization and services
Enable remote MCP server for Cloud
Connect to the ClickHouse Cloud service for which you want to enable the remote MCP server. In the left-hand menu, click Connect. A box with connection details will open. Select Connect with MCP: Toggle the button on to enable MCP for the service. Enabling or disabling MCP requires thecontrol-plane:service:manage-mcp permission (see Console roles and permissions):
Copy the displayed URL, which is the same as the one below:
Setup remote MCP for development
Choose your IDE or tool below and follow the corresponding setup instructions.Authenticate from a headless environment
If your MCP client runs on a remote or headless host where a browser-based OAuth flow is not practical, authenticate with a ClickHouse Cloud API key instead.- In the ClickHouse Cloud console, open your organization and select API Keys.
- Create a key with the minimum roles and permissions required for the organizations and services the MCP client needs to access, then download the key ID and secret.
- On the remote host, provide the credentials through your secret-management system and create an HTTP Basic authorization value:
- Select your MCP client and add the remote MCP server:
- Claude Code
- Codex
- OpenCode
CH_AUTH from the environment when it connects. Launch Claude Code and run /mcp to confirm that clickhouse-cloud is connected.See the Claude Code MCP documentation for details about remote HTTP servers and header configuration.CH_AUTH available in each client session, and do not commit the API key, secret, or CH_AUTH value to source control. Base64 encoding does not encrypt the credentials.
This API-key flow does not require a browser or a separate clickhousectl login.
Claude Code
From your working directory, run the following command to add the ClickHouse Cloud MCP Server configuration to Claude Code:clickhouse-cloud and authenticate via OAuth using your credentials for ClickHouse Cloud.
Claude web UI
- Navigate to Customize > Connectors
- Click the ”+” icon and Add custom connector
- Give the custom connector a name like
clickhouse-cloudand add it - Click the newly added
clickhouse-cloudconnector and click Connect - Authenticate using your ClickHouse Cloud credentials via OAuth
Cursor
- Browse and install MCP servers from the Cursor Marketplace.
- Search for ClickHouse and click “Add to Cursor” on any server to install it
- Authenticate with OAuth.
Visual Studio Code
Add the following configuration to your.vscode/mcp.json:
Windsurf
Edit yourmcp_config.json file with the following config:
Zed
Add ClickHouse as a custom server. Add the following to your Zed settings under context_servers:Codex
Run the following command to add the ClickHouse Cloud MCP server via the CLI:Example usage
Once connected, you can interact with ClickHouse Cloud through natural-language prompts. Below are some common workflows and the tools your MCP client will invoke behind the scenes. For a full list of available tools, see the tool reference.Exploring your data
Start by discovering what’s available:Running analytical queries
Ask questions in plain language and the agent will translate them into SQL:
The
run_select_query tool only permits SELECT statements. All queries are read-only.