stdio server with uv and connects it to a major MCP client.
The server allows read-only queries by default.
Use a dedicated ClickHouse user with only the permissions that the assistant needs, and do not use a default or administrative user.
The following walkthrough demonstrates the setup with Claude Desktop.
The same ClickHouse connection details apply to the other clients covered in this guide.
Prerequisites
Before you begin:- Install
uv. - Install the MCP client that you want to use.
- Collect the hostname, username, and password for your ClickHouse service.
Replace them with your connection details.
For a ClickHouse Cloud service, the server uses HTTPS on port
8443 by default.
For a self-managed service using plain HTTP, also set CLICKHOUSE_SECURE=false and, if needed, CLICKHOUSE_PORT=8123.
Configure your MCP client
- Claude Code
- Claude Desktop
- Codex
- ChatGPT
- Cursor
- Windsurf
Run the following command in your terminal:Run
claude mcp list to verify the connection, or enter /mcp in Claude Code to inspect the server and its tools.Verify the connection
After the client reports thatmcp-clickhouse is connected, ask it:
Troubleshooting
If the client reports that it cannot finduv, replace uv in the command or configuration with its absolute path.
Run which uv on macOS or Linux, or where uv on Windows, to find that path.
For additional connection settings, optional chDB support, HTTP transport, and authentication, see the mcp-clickhouse README.
Cursor