Skip to content

MCP setupData and AI

ClickHouse MCP Server

Let your agent run read-only SQL against ClickHouse and browse its databases and tables using ClickHouse's official MCP server.

npx workspacetemplates add clickhouse-mcp --tool claude-code

Writes 1 file to your project root

.mcp.jsonmerge into your file21 lines · 450 BFile
{
  "mcpServers": {
    "clickhouse": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp-clickhouse",
        "--python",
        "3.12",
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "${CLICKHOUSE_HOST}",
        "CLICKHOUSE_USER": "${CLICKHOUSE_USER}",
        "CLICKHOUSE_PASSWORD": "${CLICKHOUSE_PASSWORD}",
        "CLICKHOUSE_SECURE": "${CLICKHOUSE_SECURE}"
      }
    }
  }
}

What it does

mcp-clickhouse is ClickHouse's own MCP server. It gives the agent three tools: run a query, list databases and list tables, with paging and name filters for large schemas. That is enough to explore an analytics warehouse and draft queries against real column names.

Queries run with the readonly setting on by default, because CLICKHOUSE_ALLOW_WRITE_ACCESS is false unless you change it. The ClickHouse user's grants remain the real boundary, so connect with an account that can only read.

Example

you › In the analytics database, count page_views per day for the last 7 days and note any day that dips below half the average.

agent › Seven rows returned, averaging 41k views per day. Saturday shows 17k, under half the average, which matches the weekend traffic pattern.

Questions

Can it drop or change tables?
Not with the defaults. Writes stay blocked until you set CLICKHOUSE_ALLOW_WRITE_ACCESS, and destructive statements also need CLICKHOUSE_ALLOW_DROP.
Do I need uv installed?
Yes for this command. The project also documents a pip install with the mcp-clickhouse executable if you prefer that.
  • Apify MCP Server

    MCP setupData and AI

    Free
  • Chroma MCP Server

    MCP setupData and AI

    Free
  • Firecrawl MCP Server

    MCP setupData and AI

    Free
  • Hugging Face MCP Server

    MCP setupData and AI

    Free