Skip to content
MCP server

ClickHouse

Official ClickHouse MCP server for querying and exploring ClickHouse clusters and chDB.

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
0.7.0
Listing updated
4 days ago

About ClickHouse

ClickHouse is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.

Install

Run in a terminal

claude mcp add mcp-clickhouse --env CLICKHOUSE_HOST='<CLICKHOUSE_HOST>' --env CLICKHOUSE_USER='<CLICKHOUSE_USER>' --env CLICKHOUSE_PASSWORD='<CLICKHOUSE_PASSWORD>' -- uvx mcp-clickhouse

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mcp-clickhouse": {
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
        "CLICKHOUSE_USER": "<CLICKHOUSE_USER>",
        "CLICKHOUSE_PASSWORD": "<CLICKHOUSE_PASSWORD>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-clickhouse": {
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
        "CLICKHOUSE_USER": "<CLICKHOUSE_USER>",
        "CLICKHOUSE_PASSWORD": "<CLICKHOUSE_PASSWORD>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "mcp-clickhouse": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
        "CLICKHOUSE_USER": "<CLICKHOUSE_USER>",
        "CLICKHOUSE_PASSWORD": "<CLICKHOUSE_PASSWORD>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp-clickhouse": {
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
        "CLICKHOUSE_USER": "<CLICKHOUSE_USER>",
        "CLICKHOUSE_PASSWORD": "<CLICKHOUSE_PASSWORD>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mcp-clickhouse": {
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "<CLICKHOUSE_HOST>",
        "CLICKHOUSE_USER": "<CLICKHOUSE_USER>",
        "CLICKHOUSE_PASSWORD": "<CLICKHOUSE_PASSWORD>"
      }
    }
  }
}

Configuration

  • CLICKHOUSE_HOSTHostname of the ClickHouse serverRequired
  • CLICKHOUSE_USERUsername for ClickHouse authenticationRequired
  • CLICKHOUSE_PASSWORDPassword for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode
  • CLICKHOUSE_PORTClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise
  • CLICKHOUSE_SECUREUse HTTPS to connect to ClickHouse
  • CLICKHOUSE_VERIFYVerify SSL certificates
  • CLICKHOUSE_CA_CERTPath to a PEM CA bundle for ClickHouse server certificate verification
  • CLICKHOUSE_CLIENT_CERTPath to a PEM client certificate for the ClickHouse HTTPS connection
  • CLICKHOUSE_CLIENT_CERT_KEYPath to the PEM private key for CLICKHOUSE_CLIENT_CERT
  • CLICKHOUSE_TLS_MODEClient certificate mode: mutual, proxy, or strict
  • CLICKHOUSE_DATABASEDefault database to use
  • CLICKHOUSE_ROLEClickHouse role to activate for the session
  • CLICKHOUSE_ALLOW_WRITE_ACCESSAllow write operations (DDL and DML). Queries run read-only by default
  • CLICKHOUSE_ALLOW_DROPAllow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, and DETACH PERMANENTLY) when write access is also enabled
  • CLICKHOUSE_MCP_QUERY_TIMEOUTQuery tool timeout in seconds
  • CLICKHOUSE_MCP_MAX_WORKERSMaximum query worker thread pool size
  • CLICKHOUSE_HOSTHostname of the ClickHouse serverRequired
  • CLICKHOUSE_USERUsername for ClickHouse authenticationRequired
  • CLICKHOUSE_PASSWORDPassword for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode
  • CLICKHOUSE_PORTClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise
  • CLICKHOUSE_SECUREUse HTTPS to connect to ClickHouse
  • CLICKHOUSE_VERIFYVerify SSL certificates
  • CLICKHOUSE_CA_CERTPath to a PEM CA bundle for ClickHouse server certificate verification
  • CLICKHOUSE_CLIENT_CERTPath to a PEM client certificate for the ClickHouse HTTPS connection
  • CLICKHOUSE_CLIENT_CERT_KEYPath to the PEM private key for CLICKHOUSE_CLIENT_CERT
  • CLICKHOUSE_TLS_MODEClient certificate mode: mutual, proxy, or strict
  • CLICKHOUSE_DATABASEDefault database to use
  • CLICKHOUSE_ROLEClickHouse role to activate for the session
  • CLICKHOUSE_ALLOW_WRITE_ACCESSAllow write operations (DDL and DML). Queries run read-only by default
  • CLICKHOUSE_ALLOW_DROPAllow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, and DETACH PERMANENTLY) when write access is also enabled
  • CLICKHOUSE_MCP_QUERY_TIMEOUTQuery tool timeout in seconds
  • CLICKHOUSE_MCP_MAX_WORKERSMaximum query worker thread pool size

Pricing

Open source

Prices change. Check clickhouse.com before you buy.

ClickHouse FAQ

Is ClickHouse free?

Yes. ClickHouse is open source, so you can use and self-host it for free.

How do I add ClickHouse to Claude Code?

Run this command in your terminal: claude mcp add mcp-clickhouse --env CLICKHOUSE_HOST='<CLICKHOUSE_HOST>' --env CLICKHOUSE_USER='<CLICKHOUSE_USER>' --env CLICKHOUSE_PASSWORD='<CLICKHOUSE_PASSWORD>' -- uvx mcp-clickhouse

What are the best alternatives to ClickHouse?

The closest alternatives to ClickHouse are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.

Alternatives to ClickHouse

  1. Midplane

    MCP server

    Postgres gateway for AI agents with table grants, column masking and approval for writes

    Runs locally
    • Open source
    • 5 GitHub stars
    • Databases
  2. PlatypusDB

    MCP server

    Gives MCP clients access to your PlatypusDB database connections, scoped per agent

    Runs locally
    • Open source
    • Databases
  3. Lorebase

    MCP server

    Lets agents read and change a governed, versioned Postgres knowledge graph

    Runs locally
    • Open source
    • Knowledge and memory
  4. Sovaria

    MCP server

    Manage a Sovaria backend (Postgres, auth, storage, functions) from an AI assistant

    Not checked yet
    • 4 tools
    • Remote
    • Freemium
    • Databases
  5. Generate realistic connected test data, dbt projects and dashboards from a schema

    • Remote
    • Freemium
    • Databases
  6. semlayer

    MCP server

    Infers a semantic layer from your data warehouse and serves it to agents

    Runs locally
    • Free
    • Databases