ClickHouse查询
STDIO用于执行ClickHouse SQL查询的服务器
用于执行ClickHouse SQL查询的服务器
An MCP server for ClickHouse.
run_select_query
sql
(string): The SQL query to execute.readonly = 1
to ensure they are safe.list_databases
list_tables
database
(string): The name of the database.Note: This is a temporary configuration process that will be significantly improved once the package is published.
Run uv sync
to install the dependencies. To install uv
follow the instructions here. Then do source .venv/bin/activate
.
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>
Run fastmcp install mcp_clickhouse/mcp_server.py -f .env.production
to install the server.
Restart Claude Desktop.
In test-services
directory run docker compose up -d
to start the ClickHouse cluster.
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
Run uv sync
to install the dependencies. To install uv
follow the instructions here. Then do source .venv/bin/activate
.
For easy testing, you can run fastmcp dev mcp_clickhouse/mcp_server.py
to start the MCP server.