Aerostack
electrical_services

ClickHouse MCP Server — Hosted for Any AI Agent

MCP Server language Hosted language Public

Execute SQL queries, explore schemas, and analyze data in your ClickHouse database — AI-native analytics database access.

aerostack @aerostack verified
v0.1.0 MIT Updated Jun 28, 2026
robot_2

Use with AI AssistantsMCP

Connect Claude, Cursor, or any MCP-compatible client — then call tools directly

① Add This MCP Server

Paste into your AI client config — then all its tools are available instantly.

.claude/mcp.json
{
  "mcpServers": {
    "clickhouse": {
      "url": "https://mcp.aerostack.dev/s/aerostack/mcp-clickhouse",
      "headers": {
        "Authorization": "Bearer YOUR_AEROSTACK_TOKEN"
      }
    }
  }
}

Replace YOUR_AEROSTACK_TOKEN with your API token from the dashboard.

② Call a Tool

Ask your AI assistant to call a specific tool, or send raw JSON-RPC:

+4 more

Natural Language Prompt

“Use the _ping tool to verify clickhouse connectivity by running select 1. used internally by aerostack to validate credentials

Using a Workspace?

Add this MCP to your Workspace — your team shares one token, secrets are stored securely, and every AI agent in the workspace can call it without per-user setup.

add_circleAdd to Workspace

The ClickHouse MCP server gives AI agents direct access to your ClickHouse analytics database — running SQL, exploring schemas, inserting rows, and monitoring system health. Hosted on Aerostack as a single sub-50ms URL for any MCP client, it lets an agent query billions of rows and answer analytics questions in natural language.

description Overview

mcp-clickhouse — ClickHouse MCP Server

Execute SQL queries, explore schemas, and analyze data in your ClickHouse database from your AI agents.

ClickHouse is the fastest open-source columnar database for real-time analytics — used by teams processing billions of rows for dashboards, observability, and data pipelines. This MCP server gives your AI agents direct access to your ClickHouse instance: running arbitrary SQL, exploring database schemas, inserting data, and monitoring system health — all through natural language.

Live endpoint: https://mcp.aerostack.dev/s/aerostack/mcp-clickhouse


What You Can Do

  • Run any SQL query against your ClickHouse database and get structured JSON results
  • Explore database schemas — list databases, tables, and describe column types
  • Insert rows into tables as part of data pipeline or automation workflows
  • Monitor your ClickHouse instance with system metrics and table size reports
  • Count rows with optional WHERE filters for quick data validation

Available Tools

Tool Description
query Execute any SQL query (SELECT, SHOW, DESCRIBE, etc.)
list_databases List all databases in the ClickHouse instance
list_tables List all tables in a specific database
describe_table Show columns, types, and defaults for a table
insert Insert rows into a table using VALUES syntax
count Count rows in a table with optional WHERE filter
show_create Show the CREATE TABLE statement for a table
system_metrics Retrieve current ClickHouse system metrics
table_sizes Show table sizes (rows, compressed/uncompressed) from system.parts

Configuration

Variable Required Description How to Get
CLICKHOUSE_URL Yes Your ClickHouse HTTP endpoint Self-hosted: http://localhost:8123. ClickHouse Cloud: https://xxx.clickhouse.cloud:8443 from your cloud console
CLICKHOUSE_USER Yes ClickHouse username Default is default for self-hosted. ClickHouse Cloud: check your cloud console credentials
CLICKHOUSE_PASSWORD Yes ClickHouse password Set during installation or from your ClickHouse Cloud console

Quick Start

Add to Aerostack Workspace
  1. Go to aerostack.dev → Your Project → MCPs
  2. Search for "ClickHouse" and click Add to Workspace
  3. Add CLICKHOUSE_URL, CLICKHOUSE_USER, and CLICKHOUSE_PASSWORD under Project → Secrets

Once added, every AI agent in your workspace can call ClickHouse tools automatically — no per-user setup needed.

Example Prompts
"List all databases and tables in my ClickHouse instance"
"Show me the top 10 largest tables by compressed size"
"Run SELECT count() FROM analytics.events WHERE event_date = today()"
"Describe the schema of the default.users table"
"Show me current ClickHouse system metrics"
Direct API Call
curl -X POST https://mcp.aerostack.dev/s/aerostack/mcp-clickhouse \
  -H 'Content-Type: application/json' \
  -H 'X-Mcp-Secret-CLICKHOUSE-URL: https://xxx.clickhouse.cloud:8443' \
  -H 'X-Mcp-Secret-CLICKHOUSE-USER: default' \
  -H 'X-Mcp-Secret-CLICKHOUSE-PASSWORD: your-password' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_databases","arguments":{}}}'

License

MIT

terminal Tools (10)

Available tools on this MCP server. Each tool can be called directly from any AI agent.

terminal
_ping #1

Verify ClickHouse connectivity by running SELECT 1. Used internally by Aerostack to validate credentials.

terminal
query #2

Execute any SQL query (SELECT, SHOW, DESCRIBE, etc.) and return results as JSON

terminal
list_databases #3

List all databases in the ClickHouse instance

terminal
list_tables #4

List all tables in a specific database

terminal
describe_table #5

Describe the schema (columns, types, defaults) of a table

terminal
insert #6

Insert rows into a ClickHouse table using VALUES syntax

terminal
count #7

Count rows in a table with optional WHERE filter

terminal
show_create #8

Show the CREATE TABLE statement for a table

terminal
system_metrics #9

Retrieve current ClickHouse system metrics (useful for monitoring and diagnostics)

terminal
table_sizes #10

Show table sizes (rows, compressed/uncompressed bytes) from system.parts

Details

upgrade Version 0.1.0
gavel License MIT
wifi Transport streamable-http
lock Access Public
category Category API Connectors
terminal Tools 10

language Live Endpoint

https://mcp.aerostack.dev/s/aerostack/mcp-clickhouse

Sub-50ms globally · Zero cold start

Publisher

aerostack
@aerostack verified

Pre-built functions for the most common MCP tool patterns. Clone, extend, and deploy.

Tags

Browse more servers

More in API Connectors

Browse API Connectors MCPs →

Frequently asked questions

What is the ClickHouse MCP server and what can it do? +

The ClickHouse MCP server is hosted on Aerostack and exposes these tools to your AI agent: `_ping`, `query`, `list_databases`, `list_tables`, `describe_table`. You get one hosted URL — no self-hosting — that works from Claude, Cursor, ChatGPT, Gemini, VS Code, or any MCP-compatible client, and you can share it with your team or combine it with other MCP servers in a workspace.

Is the ClickHouse MCP server hosted, or do I have to run it myself? +

It's hosted on Aerostack's edge infrastructure — you don't deploy or maintain anything. Add it to a workspace and you get one authenticated URL, with secrets encrypted, that any AI agent or editor can connect to. Use it solo or share the same URL across your whole team.

Which AI agents and editors can use the ClickHouse MCP server? +

Any MCP client: Claude and Claude Code, Cursor, ChatGPT, Gemini, Windsurf, Cline, VS Code, and custom agents. Because it's one hosted URL, the same ClickHouse MCP server works everywhere — and you can compose it with other MCP servers, skills, and functions behind a single workspace URL.

How do I install the ClickHouse MCP server in Claude Desktop? +

Add the following to your Claude Desktop config (`claude_desktop_config.json`): ```json { "mcpServers": { "@aerostack/mcp-clickhouse": { "command": "npx", "args": ["-y", "@aerostack/@aerostack/mcp-clickhouse"] } } } ``` Then restart Claude Desktop and the tools will appear automatically.

How do I use the ClickHouse MCP server in Cursor? +

In Cursor, open **Settings → MCP** and add: ```json { "name": "@aerostack/mcp-clickhouse", "command": "npx", "args": ["-y", "@aerostack/@aerostack/mcp-clickhouse"] } ``` Save and reload Cursor. The MCP tools will be available in Agent mode.

Does ClickHouse MCP require authentication? +

Yes. ClickHouse requires authentication. Check the MCP's documentation for the required credentials.