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:
--hostthe database host--portthe database port--userthe database username--passwordthe database password--databasethe 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
uvpackage 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!
- GreptimeTeam/greptimedb-mcp-server
- ktanaka101/mcp-server-duckdb
- designcomputer/mysql_mcp_server)
Thanks!
ClickHouse MCP Server
Project Details
- dubin555/clickhouse_mcp_server
- Apache License 2.0
- Last Updated: 4/9/2025
Recomended MCP Servers
The Power of Databases, The Convenience of VS Code: All in One Place
A Model Context Protocol server for generating charts using QuickChart.io . It allows you to create various types...
Model Context Protocol (MCP) server to capture images from an OpenCV-compatible webcam or video source
A WooCommerce (MCP) Model Context Protocol server
A MCP Filesystem implementation for Claude, written mostly by Claude
Generate image and video creatives using Placid.app templates in MCP compatible hosts
A Model Context Protocol server for interacting with the Solana blockchain, powered by the Solana Agent Kit (https://github.com/sendaifun/solana-agent-kit)
All MCP Servers related projects.
Awesome MCP template for awesome FastAPI builders
An MCP server providing advanced options analysis through Yahoo Finance, supporting Greeks calculations, strategy evaluation (CCS/PCS/CSP/CC), and risk...





