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:
--host
the database host--port
the database port--user
the database username--password
the database password--database
the 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Â
uv
 package 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!
ClickHouse MCP Server
Project Details
- dubin555/clickhouse_mcp_server
- Apache License 2.0
- Last Updated: 4/9/2025
Recomended MCP Servers
A Model Completion Protocol (MCP) server for interacting with Databricks services
🚀 MCP aggregator for batching multiple tool calls into a single request. Reduces overhead, saves tokens, and simplifies...
MCP server that creates its own tools as needed
Connect a bitcoin lightning wallet to your LLM using Nostr Wallet Connect and Model Context Protocol
mcp server sopos open-api
Share code with LLMs via Model Context Protocol or clipboard. Rule-based customization enables easy switching between different tasks...
This a simple implementation of an MCP server using iFlytek. It enables calling iFlytek workflows through MCP tools.
An MCP Server for Ollama
MCP server to run MATLAB code from LLM via the Matlab Engine API.