|
| 1 | +--- |
| 2 | +slug: /use-cases/AI/MCP/remote_mcp |
| 3 | +sidebar_label: 'ClickHouse Cloud Remote MCP' |
| 4 | +title: 'Enabling the ClickHouse Cloud Remote MCP Server' |
| 5 | +pagination_prev: null |
| 6 | +pagination_next: null |
| 7 | +description: 'This guide explains how to enable and use the ClickHouse Cloud Remote MCP' |
| 8 | +keywords: ['AI', 'ClickHouse Cloud', 'MCP'] |
| 9 | +show_related_blogs: true |
| 10 | +--- |
| 11 | + |
| 12 | +import {CardHorizontal} from '@clickhouse/click-ui/bundled' |
| 13 | +import Link from '@docusaurus/Link'; |
| 14 | +import Image from '@theme/IdealImage'; |
| 15 | +import img1 from '@site/static/images/use-cases/AI_ML/MCP/1connectmcpmodal.png'; |
| 16 | +import img2 from '@site/static/images/use-cases/AI_ML/MCP/2enable_mcp.png'; |
| 17 | +import img3 from '@site/static/images/use-cases/AI_ML/MCP/3oauth.png'; |
| 18 | +import img4 from '@site/static/images/use-cases/AI_ML/MCP/4oauth_success.png'; |
| 19 | +import img5 from '@site/static/images/use-cases/AI_ML/MCP/5connected_mcp_claude.png'; |
| 20 | +import img6 from '@site/static/images/use-cases/AI_ML/MCP/6slash_mcp_claude.png'; |
| 21 | +import img7 from '@site/static/images/use-cases/AI_ML/MCP/7usage_mcp.png'; |
| 22 | + |
| 23 | +# Enabling the ClickHouse Cloud Remote MCP Server |
| 24 | + |
| 25 | +> This guide explains how to enable and use the ClickHouse Cloud Remote MCP Server. We will use Claude Code as an MCP Client for this example. |
| 26 | +
|
| 27 | +<VerticalStepper headerLevel="h2"> |
| 28 | + |
| 29 | +## Enable the remote MCP server for your ClickHouse Cloud service |
| 30 | + |
| 31 | +1. Connect to your ClickHouse Cloud Service, click on the `Connect` button, and enable the Remote MCP Server for your Service |
| 32 | + |
| 33 | +<Image img={img1} alt="Select MCP in the Connect Modal" size="sm"/> |
| 34 | + |
| 35 | +<Image img={img2} alt="Enable MCP Server" size="sm"/> |
| 36 | + |
| 37 | +2. Copy the URL of the ClickHouse Cloud MCP Server from the `Connect` view or below |
| 38 | + |
| 39 | +```bash |
| 40 | +https://mcp.clickhouse.com/mcp |
| 41 | +``` |
| 42 | + |
| 43 | +## Add the ClickHouse MCP Server in Claude Code |
| 44 | + |
| 45 | +1. In your working directory, run the following command to add the ClickHouse Cloud MCP Server configuration to Claude Code. In this example, we named the MCP server in the Claude Code config `clickhouse_cloud` |
| 46 | + |
| 47 | +```bash |
| 48 | +claude mcp add --transport http clickhouse_cloud https://mcp.clickhouse.com/mcp |
| 49 | +``` |
| 50 | + |
| 51 | +1b. Depending on the MCP Client used, you can also edit the JSON config directly |
| 52 | + |
| 53 | +```json |
| 54 | +{ |
| 55 | + "mcpServers": { |
| 56 | + "clickhouse-remote": { |
| 57 | + "url": "https://mcp.clickhouse.com/mcp" |
| 58 | + } |
| 59 | + } |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +2. Launch Claude Code in your working directory |
| 64 | + |
| 65 | +```bash |
| 66 | +[user@host ~/Documents/repos/mcp_test] $ claude |
| 67 | +``` |
| 68 | + |
| 69 | +## Authenticate to ClickHouse Cloud via OAuth |
| 70 | + |
| 71 | +1. Claude Code will open a browser window on the first session. Otherwise, you can also trigger a connection by running the `/mcp` command in Claude Code and selecting the `clickhouse_cloud` MCP server |
| 72 | + |
| 73 | + |
| 74 | +2. Authenticate using your ClickHouse Cloud credentials |
| 75 | + |
| 76 | +<Image img={img3} alt="OAuth Connect flow" size="sm"/> |
| 77 | + |
| 78 | +<Image img={img4} alt="OAuth Connect flow success" size="sm"/> |
| 79 | + |
| 80 | +## Use the ClickHouse Cloud Remote MCP Server from Claude Code |
| 81 | + |
| 82 | +1. Verify in Claude Code that the remote MCP server is connected |
| 83 | + |
| 84 | +<Image img={img5} alt="Claude Code MCP success" size="sm"/> |
| 85 | + |
| 86 | +<Image img={img6} alt="Claude Code MCP Details" size="sm"/> |
| 87 | + |
| 88 | +2. Congratulations! You can now use the ClickHouse Cloud Remote MCP Server from Claude Code |
| 89 | + |
| 90 | +<Image img={img7} alt="Claude Code MCP Usage" size="sm"/> |
| 91 | + |
| 92 | + |
| 93 | +</VerticalStepper> |
0 commit comments