Skip to main content

ClickHouse MCP Server

An MCP server for ClickHouse.

mcp-clickhouse MCP server

Features

Tools

  • run_select_query

    • Execute SQL queries on your ClickHouse cluster.
    • Input: sql (string): The SQL query to execute.
    • All ClickHouse queries are run with readonly = 1 to ensure they are safe.
  • list_databases

    • List all databases on your ClickHouse cluster.
  • list_tables

    • List all tables in a database.
    • Input: database (string): The name of the database.

Configuration

Note: This is a temporary configuration process that will be significantly improved once the package is published.

  1. Run uv sync to install the dependencies. To install uv follow the instructions here. Then do source .venv/bin/activate.

  2. Setup the .env.production file with the ClickHouse credentials.

CLICKHOUSE_HOST=<CLICKHOUSE_HOST>
CLICKHOUSE_PORT=<CLICKHOUSE_PORT>
CLICKHOUSE_USER=<CLICKHOUSE_USER>
CLICKHOUSE_PASSWORD=<CLICKHOUSE_PASSWORD>
  1. Run fastmcp install mcp_clickhouse/mcp_server.py -f .env.production to install the server.

  2. Open the configuration file located at:

    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%/Claude/claude_desktop_config.json

    Locate the command entry for uv and replace it with the absolute path to the uv executable. This ensures that the correct version of uv is used when starting the server.

  3. Restart Claude Desktop to apply the changes.

Development

  1. In test-services directory run docker compose up -d to start the ClickHouse cluster.

  2. Add the following variables to a .env file in the root of the repository.

CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=clickhouse
  1. Run uv sync to install the dependencies. To install uv follow the instructions here. Then do source .venv/bin/activate.

  2. For easy testing, you can run fastmcp dev mcp_clickhouse/mcp_server.py to start the MCP server.

Metadata

Release files for mcp-clickhouse 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-clickhouse 0.1.0
File Size Uploaded Provenance Actions
mcp_clickhouse-0.1.0.tar.gz 24.7 kB Without provenance Details for mcp_clickhouse-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-clickhouse 0.1.0
File Interpreter ABI Platform Actions
mcp_clickhouse-0.1.0-py3-none-any.whl Python 3 none any Details for mcp_clickhouse-0.1.0-py3-none-any.whl

Total release size: 32.9 kB

Release files / mcp_clickhouse-0.1.0.tar.gz

Download URL mcp_clickhouse-0.1.0.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
db089b8915bed35aaf607a51fe78cbed8c0cf87b87a53973cc88a836bcdd5cef
BLAKE2b-256 checksum
How to use checksums
af63467234cb3ffe08d446df88fdb14bdf0e0a8b1919b3ba3738bff103e60c66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.30

Release files / mcp_clickhouse-0.1.0-py3-none-any.whl

Download URL mcp_clickhouse-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
658b596f58bc6c7981038b91c0e4c2e4a63db1449ac2964743ecc0c633de291f
BLAKE2b-256 checksum
How to use checksums
b2d33341e7a38c2524498efb3eeb3ed20aebcf42da219962886158342877ae5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.30

Security for mcp-clickhouse 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page