chmcp

oualib/chmcp

3.4

If you are the rightful owner of chmcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The MCP ClickHouse server is a comprehensive Model Context Protocol server designed for database operations and cloud management, specifically tailored for ClickHouse environments.

The MCP ClickHouse server offers a robust solution for managing ClickHouse databases and cloud infrastructure. It provides two primary capabilities: database operations and cloud management. Users can connect to any ClickHouse database, whether local, self-hosted, or cloud-based, and perform safe, read-only queries. Additionally, the server facilitates complete management of ClickHouse Cloud infrastructure through a comprehensive API, allowing users to create, configure, and monitor cloud services. The server emphasizes security and safety, with features like automatic read-only modes and query filtering to prevent accidental data modifications. It is designed to be flexible, supporting various configurations and use cases, from simple data analysis to full-scale cloud management.

Features

  • Database Operations: Connect to any ClickHouse instance and execute safe, read-only queries.
  • Cloud Management: Manage ClickHouse Cloud infrastructure programmatically with over 50 tools.
  • Safety Features: Includes automatic read-only modes and query filtering for secure operations.
  • Flexible Configuration: Supports various use cases with customizable setup options.
  • Comprehensive API Coverage: Provides full API integration for ClickHouse Cloud management.

Usages

usage with Claude Desktop Database Operations Only

{
  "mcpServers": {
    "chmcp": {
      "command": "/path/to/uv",
      "args": ["run", "--with", "chmcp", "--python", "3.13", "chmcp"],
      "env": {
        "CLICKHOUSE_HOST": "your-server.com",
        "CLICKHOUSE_PORT": "8443",
        "CLICKHOUSE_USER": "your-username",
        "CLICKHOUSE_PASSWORD": "your-password",
        "CLICKHOUSE_SECURE": "true",
        "CLICKHOUSE_READONLY": "true"
      }
    }
  }
}

usage with Claude Desktop ClickHouse Cloud Database

{
  "mcpServers": {
    "chmcp": {
      "command": "/path/to/uv",
      "args": ["run", "--with", "chmcp", "--python", "3.13", "chmcp"],
      "env": {
        "CLICKHOUSE_HOST": "your-instance.clickhouse.cloud",
        "CLICKHOUSE_USER": "default",
        "CLICKHOUSE_PASSWORD": "your-database-password",
        "CLICKHOUSE_SECURE": "true",
        "CLICKHOUSE_READONLY": "true"
      }
    }
  }
}

usage with Claude Desktop Free Testing SQL Playground

{
  "mcpServers": {
    "chmcp": {
      "command": "/path/to/uv",
      "args": ["run", "--with", "chmcp", "--python", "3.13", "chmcp"],
      "env": {
        "CLICKHOUSE_HOST": "sql-clickhouse.clickhouse.com",
        "CLICKHOUSE_PORT": "8443",
        "CLICKHOUSE_USER": "demo",
        "CLICKHOUSE_PASSWORD": "",
        "CLICKHOUSE_SECURE": "true",
        "CLICKHOUSE_READONLY": "true"
      }
    }
  }
}

usage with Claude Desktop Cloud Management Only

{
  "mcpServers": {
    "chmcp": {
      "command": "/path/to/uv",
      "args": ["run", "--with", "chmcp", "--python", "3.13", "chmcp"],
      "env": {
        "CLICKHOUSE_CLOUD_KEY_ID": "your-cloud-key-id",
        "CLICKHOUSE_CLOUD_KEY_SECRET": "your-cloud-key-secret"
      }
    }
  }
}

usage with Claude Desktop Both Database and Cloud Management

{
  "mcpServers": {
    "chmcp": {
      "command": "/path/to/uv",
      "args": ["run", "--with", "chmcp", "--python", "3.13", "chmcp"],
      "env": {
        "CLICKHOUSE_HOST": "your-instance.clickhouse.cloud",
        "CLICKHOUSE_USER": "default",
        "CLICKHOUSE_PASSWORD": "your-database-password",
        "CLICKHOUSE_SECURE": "true",
        "CLICKHOUSE_READONLY": "true",
        "CLICKHOUSE_CLOUD_KEY_ID": "your-cloud-key-id",
        "CLICKHOUSE_CLOUD_KEY_SECRET": "your-cloud-key-secret"
      }
    }
  }
}

Tools

  1. list_databases

    List all available databases.

  2. list_tables

    List tables with detailed metadata including schema, row counts, and column information.

  3. run_query

    Execute queries with safety controls, allowing only SELECT, SHOW, DESCRIBE, and EXPLAIN queries in read-only mode.

  4. cloud_list_organizations

    List available organizations in ClickHouse Cloud.

  5. cloud_create_service

    Create a new service in ClickHouse Cloud with full configuration options.