A Model Context Protocal (MCP) server that enables secure interaction with Clickhouse. This server allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
Project description
ClickHouse MCP Server
A Model Context Protocal (MCP) server implement for ClickHouse.
This server provides AI assistants with a secure and structured way to explore and analyze databases. It enables them to list tables, read data, and execute SQL queries through a controlled interface, ensuring responsible database access.
Configuration
Set the following environment variables:
CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=CHANGE_TO_YOUR_PASSWORD
CLICKHOUSE_DATABASE=default
Or via command-line args:
--hostthe database host--portthe database port--userthe database username--passwordthe database password--databasethe database name
Usage
Fake some data in clickhouse
Check the SQL in dev_contribute.md for details.
Post your question to AI assistant in Cline
What is the sales volume in each region? Which product is the best - selling?
CLINE
Configure the MCP server in VSCode, Cline extension, or other MCP client.: Example:
{
"mcpServers": {
"clickhouse": {
"command": "uv",
"args": [
"--directory",
"/path/to/clickhouse_mcp_server",
"run",
"-m",
"clickhouse_mcp_server.server"
],
"env": {
"CLICKHOUSE_HOST": "localhost",
"CLICKHOUSE_PORT": "8123",
"CLICKHOUSE_USER": "default",
"CLICKHOUSE_PASSWORD": "CHANGE_TO_YOUR_PASSWORD",
"CLICKHOUSE_DATABASE": "default"
}
}
}
}
License
APACHE - See LICENSE file for details.
Contribute
See dev_contribute.md for details.
Prerequisites
- Python with
uvpackage manager - ClickHouse installation
- MCP server dependencies
Acknowledgement
This library's implementation was inspired by the following three repositories and incorporates their code, respect for the open-source spirit!
Thanks!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_clickhouse_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_clickhouse_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 201.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3e8ba137127ae5f19084110ffbb973fa96bbdb9caa784340773af0b49d908e9
|
|
| MD5 |
5628cb86f5e609964e7662892d62a489
|
|
| BLAKE2b-256 |
d8110f4ca268b1d09d7725f76ff11cdc741f5acedd9615e15a0e7bb689f058e8
|
File details
Details for the file iflow_mcp_clickhouse_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_clickhouse_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6719d9fb7a66a467f64aecf25d62e2fa79df8477bd96a6634203667ae7c60009
|
|
| MD5 |
3284ca16a687f5efe4c5a793d97f142d
|
|
| BLAKE2b-256 |
5d197f07edee8871e28fa49aa4128b05a399c0e589d620244c34baea1ae0c55d
|