ClickHouse MCP Server
by iskakaushik
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Allows querying and interacting with ClickHouse databases, providing tools for executing SQL select queries, listing databases, and viewing tables within a database.
ClickHouse MCP Server
Migrated to https://github.com/ClickHouse/mcp-clickhouse
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 = 1
to 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 sync
to install the dependencies. To installuv
follow the instructions here. Then dosource .venv/bin/activate
. - Setup the
.env.production
file with the ClickHouse credentials.
Copy
- Run
fastmcp install mcp_clickhouse/mcp_server.py -f .env.production
to install the server. - Restart Claude Desktop.
Development
- In
test-services
directory rundocker compose up -d
to start the ClickHouse cluster. - Add the following variables to a
.env
file in the root of the repository.
Copy
- Run
uv sync
to install the dependencies. To installuv
follow the instructions here. Then dosource .venv/bin/activate
. - For easy testing, you can run
fastmcp dev mcp_clickhouse/mcp_server.py
to start the MCP server.
You must be authenticated.
An MCP server for ClickHouse.