The ClickHouse MCP Server is a Model Context Protocol (MCP) implementation designed to facilitate secure and structured interactions between AI assistants and ClickHouse databases. It allows AI systems to list tables, read data, and execute SQL queries through a controlled interface, ensuring responsible database access.
To configure the ClickHouse MCP Server, set the following environment variables:
CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=CHANGE_TO_YOUR_PASSWORD
CLICKHOUSE_DATABASE=default
Alternatively, you can use command-line arguments:
--host
: The database host--port
: The database port--user
: The database username--password
: The database password--database
: The database nameTo begin, you can populate ClickHouse with sample data. Refer to the SQL scripts in dev_contribute.md
for detailed instructions.
Once the data is ready, you can interact with the AI assistant in CLINE. For example, you might ask:
What is the sales volume in each region? Which product is the best-selling?
To integrate the MCP server with CLINE, configure it in VSCode or any other MCP client. Here’s an example configuration:
{
"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"
}
}
}
}
This project is licensed under the Apache License 2.0. See the LICENSE
file for more details.
Contributions are welcome! Refer to dev_contribute.md
for guidelines on how to contribute to this project.
Before contributing, ensure you have the following installed:
uv
package managerThis project was inspired by the following open-source repositories:
Special thanks to the developers of these projects for their contributions to the open-source community.
No additional description, website, or topics are provided for this project.
No releases published.
No packages published.