https://github.com/dubin555/clickhouse_mcp_server
https://github.com/dubin555/clickhouse_mcp_server
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dubin555/clickhouse_mcp_server
- Owner: dubin555
- License: apache-2.0
- Created: 2025-03-19T12:54:15.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-19T14:43:46.000Z (7 months ago)
- Last Synced: 2025-03-19T15:38:37.421Z (7 months ago)
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
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:
```json
{
"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!
* [GreptimeTeam/greptimedb-mcp-server](https://github.com/GreptimeTeam/greptimedb-mcp-server)
* [ktanaka101/mcp-server-duckdb](https://github.com/ktanaka101/mcp-server-duckdb)
* [designcomputer/mysql_mcp_server)](https://github.com/designcomputer/mysql_mcp_server)Thanks!