# ClickHouse (MCP server)

> ClickHouse is an MCP server that adds data and analytics tools to AI assistants such as Claude Desktop, Claude Code and Cursor. Official ClickHouse MCP server for querying and exploring ClickHouse clusters and chDB. It has 880 GitHub stars, is released under the Apache-2.0 license and runs locally with uvx mcp-clickhouse.

The server implements MCP 2026-07-28 and supports legacy initialize handshakes from 2024-11-05 through 2025-11-25. Modern clients use sessionless requests and server/discover. Existing clients can continue to negotiate the legacy protocol.

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/ClickHouse/mcp-clickhouse |
| GitHub stars | 880 |
| License | Apache-2.0 |
| Language | Python |
| Transport | stdio |
| Packages | pypi: mcp-clickhouse; docker: ghcr.io/clickhouse/mcp-clickhouse:0.7.0 |
| Remote URL | none |
| Needs API key | yes |
| Official | yes |
| Works with | Claude Desktop, Claude Code, Cursor, VS Code |
| Category | Data & analytics |
| Latest release | v0.7.0 (Sep 21, 2026) |
| Last commit | Oct 6, 2026 |
| MCP registry name | io.github.ClickHouse/mcp-clickhouse |

## Install

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "clickhouse": {
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "your-value",
        "CLICKHOUSE_USER": "your-value",
        "CLICKHOUSE_PASSWORD": "your-value"
      }
    }
  }
}
```

Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.

### Claude Code

```sh
claude mcp add --env CLICKHOUSE_HOST=your-value --env CLICKHOUSE_USER=your-value --env CLICKHOUSE_PASSWORD=your-value --transport stdio clickhouse -- uvx mcp-clickhouse
```

### Cursor (.cursor/mcp.json)

```json
{
  "mcpServers": {
    "clickhouse": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "your-value",
        "CLICKHOUSE_USER": "your-value",
        "CLICKHOUSE_PASSWORD": "your-value"
      }
    }
  }
}
```

Project file; use ~/.cursor/mcp.json to enable it in every project.

### VS Code (.vscode/mcp.json)

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "clickhouse_password",
      "description": "CLICKHOUSE_PASSWORD",
      "password": true
    }
  ],
  "servers": {
    "clickhouse": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "your-value",
        "CLICKHOUSE_USER": "your-value",
        "CLICKHOUSE_PASSWORD": "${input:clickhouse_password}"
      }
    }
  }
}
```

Config formats checked against the official docs on 2026-10-07.

## Environment variables

- `CLICKHOUSE_HOST` (required): Hostname of the ClickHouse server
- `CLICKHOUSE_USER` (required): Username for ClickHouse authentication
- `CLICKHOUSE_PASSWORD` (secret): Password for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode
- `CLICKHOUSE_PORT`: ClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise
- `CLICKHOUSE_SECURE`: Use HTTPS to connect to ClickHouse
- `CLICKHOUSE_VERIFY`: Verify SSL certificates
- `CLICKHOUSE_CA_CERT`: Path to a PEM CA bundle for ClickHouse server certificate verification
- `CLICKHOUSE_CLIENT_CERT`: Path to a PEM client certificate for the ClickHouse HTTPS connection
- `CLICKHOUSE_CLIENT_CERT_KEY`: Path to the PEM private key for CLICKHOUSECLIENTCERT
- `CLICKHOUSE_TLS_MODE`: Client certificate mode: mutual, proxy, or strict
- `CLICKHOUSE_DATABASE`: Default database to use
- `CLICKHOUSE_ROLE`: ClickHouse role to activate for the session
- `CLICKHOUSE_ALLOW_WRITE_ACCESS`: Allow write operations (DDL and DML). Queries run read-only by default
- `CLICKHOUSE_ALLOW_DROP`: Allow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, and DETACH PERMANENTLY) when write access is also enabled
- `CLICKHOUSE_MCP_QUERY_TIMEOUT`: Query tool timeout in seconds
- `CLICKHOUSE_MCP_MAX_WORKERS`: Maximum query worker thread pool size

## Similar MCP servers

- [Ida Pro MCP](https://appsgit.com/mcp-servers/ida-pro-mcp): AI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP. (12,497 stars, MIT)
- [Ask Jev](https://appsgit.com/mcp-servers/ask-jev): Evaluate state with typed choice, score, and probability questions. (5,174 stars, MIT, needs API key)
- [Jitsu](https://appsgit.com/mcp-servers/jitsu): Manage Jitsu data pipelines: destinations, streams, connections, functions, live events. (5,101 stars, MIT, official)
- [Google Ads + Meta Ads + SEO/GEO MCP](https://appsgit.com/mcp-servers/google-ads-meta-ads-seo-geo-mcp): Google Ads, Meta Ads, SEO, GEO & GA4 MCP by Ryze AI - audits, reports, keywords, Search Console. (4,107 stars, MIT)
- [Blitz](https://appsgit.com/mcp-servers/blitz): Give AI agents full control over iOS/macOS development via a native macOS app with 30+ MCP tools. (1,754 stars, Apache-2.0)
- [Chunkhound](https://appsgit.com/mcp-servers/chunkhound): Your entire engineering context, deeply understood. (1,445 stars, MIT, official)

---

Canonical page: https://appsgit.com/mcp-servers/clickhouse
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed nightly.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
