ClickHouse MCP for Self-Hosted Databases for Claude

Connect Claude Desktop to your own ClickHouse server to inspect schemas and run bounded analytics queries from a local MCP process.

How to set up the ClickHouse MCP for Self-Hosted Databases in Claude

  1. Install uv and use the publisher’s recommended Python version in the supplied launch configuration.
  2. Supply the HTTP endpoint for your self-hosted ClickHouse server and a least-privilege database identity through your local credential workflow. Adjust the HTTP port and TLS settings only to match your deployment.
  3. Restart Claude Desktop, then check one known table from a read-only development database.
Claude Desktop · Claude Desktop configuration
{
  "mcpServers": {
    "mcp-clickhouse": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp-clickhouse",
        "--python",
        "3.12",
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "YOUR_CLICKHOUSE_HOST",
        "CLICKHOUSE_PORT": "8443",
        "CLICKHOUSE_USER": "YOUR_DATABASE_USER",
        "CLICKHOUSE_SECURE": "true",
        "CLICKHOUSE_VERIFY": "true"
      }
    }
  }
}
Download configuration

Query a ClickHouse instance you operate

The publisher’s standalone MCP server connects directly to ClickHouse over its HTTP interface. It can list tables, inspect schemas, and run queries supported by your database account. This setup is useful when your team hosts ClickHouse itself and can reach it from the computer that runs Claude Desktop.

Verify a count before exploring more

Use a read-only account on a test database and ask Claude to return the schema and hourly counts for a known two-hour window from page_events. Request the SQL and the timestamp timezone. Compare both counts with the same query in your SQL client before trying a longer range.

Confirm the database port and TLS

Use your deployment’s HTTP interface and check its TLS settings. The native ClickHouse TCP port is a different interface and does not work with this server. Keep database credentials local and grant the smallest access needed for the example.

Publisher setup and documentation

Browse MCP servers