Open the Claude Desktop configuration file located at:
Add the following:
Update the environment variables to point to your own ClickHouse service.
Or, if you'd like to try it out with the ClickHouse SQL Playground, you can use the following config:
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. On a mac, you can find this path using which uv.
Restart Claude Desktop to apply the changes.
Development
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.
Note: The use of the `default` user in this context is intended solely for local development purposes.
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 mcp dev mcp_clickhouse/mcp_server.py to start the MCP server.
Environment Variables
The following environment variables are used to configure the ClickHouse connection:
Required Variables
CLICKHOUSE_HOST: The hostname of your ClickHouse server
CLICKHOUSE_USER: The username for authentication
CLICKHOUSE_PASSWORD: The password for authentication
[!CAUTION]It is important to treat your MCP database user as you would any external client connecting to your database, granting only the minimum necessary privileges required for its operation. The use of default or administrative users should be strictly avoided at all times.
Optional Variables
CLICKHOUSE_PORT: The port number of your ClickHouse server
Open the Claude Desktop configuration file located at:
Add the following:
Update the environment variables to point to your own ClickHouse service.
Or, if you'd like to try it out with the ClickHouse SQL Playground, you can use the following config:
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. On a mac, you can find this path using which uv.
Restart Claude Desktop to apply the changes.
Development
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.
Note: The use of the `default` user in this context is intended solely for local development purposes.
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 mcp dev mcp_clickhouse/mcp_server.py to start the MCP server.
Environment Variables
The following environment variables are used to configure the ClickHouse connection:
Required Variables
CLICKHOUSE_HOST: The hostname of your ClickHouse server
CLICKHOUSE_USER: The username for authentication
CLICKHOUSE_PASSWORD: The password for authentication
[!CAUTION]It is important to treat your MCP database user as you would any external client connecting to your database, granting only the minimum necessary privileges required for its operation. The use of default or administrative users should be strictly avoided at all times.
Optional Variables
CLICKHOUSE_PORT: The port number of your ClickHouse server