ClickHouse is designed for blazing-fast analytics over massive datasets: billions of rows, sub-second aggregations. Claude Code is Anthropic's AI CLI that lives in your terminal. With Sequel's MCP server bridging them, you can ask analytics questions about your ClickHouse data in plain English without switching tools or writing complex SQL.
What You'll Accomplish
After completing this setup, you'll be able to run Claude Code and ask:
- "How many events were tracked yesterday, broken down by event type?"
- "What's the p99 latency for API requests in the past 24 hours?"
- "Which country has the most active users this week?"
Prerequisites
- A Sequel account -- Sign up free at sequel.sh
- A running ClickHouse instance -- ClickHouse Cloud or self-hosted
- Claude Code installed -- run
npm install -g @anthropic-ai/claude-codeif needed
Step 1: Connect Your ClickHouse Database to Sequel
Sign in to sequel.sh and click Data Sources in the left sidebar.

Click New Connection. On the "Choose a connector" page, select ClickHouse.

Fill in the connection fields:
- Connection Name -- a memorable label, e.g.
ClickHouse Analytics - Host -- your ClickHouse hostname, without
https://orhttp://prefix - Port --
8443for ClickHouse Cloud (HTTPS),8123for self-hosted HTTP - Username -- e.g.
default - Password -- your ClickHouse password
- Database -- the database name to connect to

ClickHouse Cloud example: If your JDBC URL is jdbc:clickhouse://abc123.us-east-1.aws.clickhouse.cloud:8443?user=default&password=mypass&ssl=true, enter:
- Host:
abc123.us-east-1.aws.clickhouse.cloud - Port:
8443 - Username:
default - Password:
mypass
Click Connect to verify and save.
Step 2: Get Your Sequel API Key
Click Settings in the left sidebar, then select API Keys from the settings navigation.

Click New key, name it claude-code-clickhouse, and copy the key (starts with sql_).
Step 3: Configure Claude Code to Use Sequel MCP
In your terminal:
claude mcp add sequel \
--transport http \
https://api.sequel.sh/mcp \
--header "Authorization: Bearer sql_your_api_key"
Replace sql_your_api_key with the key from Step 2. Verify with:
claude mcp list
Step 4: Query Your ClickHouse Database
Start a Claude Code session:
How many page views were recorded in the last 7 days?
What's the breakdown of sessions by device type this month?
Show me the top 10 error codes by frequency in the past 24 hours.
Claude Code translates these to ClickHouse-optimized SQL queries and returns results fast.
What You Can Do Now
- Real-time monitoring -- ask "Are error rates higher than usual in the past hour?" during an incident
- Funnel analysis -- ask "What percentage of users who started checkout completed a purchase today?"
- Performance debugging -- ask "What are the slowest API endpoints by p95 latency over the past week?"
- Schema navigation -- ask "What tables are in this cluster?" to orient yourself on a large ClickHouse database
- Executive metrics -- ask "Give me key engagement metrics for this month vs. last month"

