LogoSTMCP
Download
mcp-clickhouse

ClickHouse MCP Server

An MCP server for ClickHouse that provides SQL query execution, database and table listing tools, and embedded chDB functionality for direct data querying without ETL processes.

Tools

1. run_select_query

Execute SQL queries on your ClickHouse cluster.

2. list_databases

List all databases on your ClickHouse cluster.

3. list_tables

List all tables in a database.

4. run_chdb_select_query

Execute SQL queries using chDB's embedded ClickHouse engine.

Open Graph image for ClickHouse MCP Server

JSON Config

{
  "mcpServers": {
    "mcp-clickhouse": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp-clickhouse",
        "--python",
        "3.10",
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "<clickhouse-host>",
        "CLICKHOUSE_PORT": "<clickhouse-port>",
        "CLICKHOUSE_USER": "<clickhouse-user>",
        "CLICKHOUSE_PASSWORD": "<clickhouse-password>",
        "CLICKHOUSE_SECURE": "true",
        "CLICKHOUSE_VERIFY": "true",
        "CLICKHOUSE_CONNECT_TIMEOUT": "30",
        "CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30"
      }
    }
  }
}

Useful Links

Information