ClickHouse MCP Server
An MCP server for ClickHouse.
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 = 1to 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.
-
Run
uv syncto install the dependencies. To installuvfollow the instructions here. Then dosource .venv/bin/activate. -
Setup the
.env.productionfile with the ClickHouse credentials.
CLICKHOUSE_HOST=<CLICKHOUSE_HOST>
CLICKHOUSE_PORT=<CLICKHOUSE_PORT>
CLICKHOUSE_USER=<CLICKHOUSE_USER>
CLICKHOUSE_PASSWORD=<CLICKHOUSE_PASSWORD>
-
Run
fastmcp install mcp_clickhouse/mcp_server.py -f .env.productionto install the server. -
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
uvand replace it with the absolute path to theuvexecutable. This ensures that the correct version ofuvis used when starting the server. - On macOS:
-
Restart Claude Desktop to apply the changes.
Development
-
In
test-servicesdirectory rundocker compose up -dto start the ClickHouse cluster. -
Add the following variables to a
.envfile in the root of the repository.
CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=clickhouse
-
Run
uv syncto install the dependencies. To installuvfollow the instructions here. Then dosource .venv/bin/activate. -
For easy testing, you can run
fastmcp dev mcp_clickhouse/mcp_server.pyto 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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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.