ClickHouse MCP Server
Overview
ClickHouse MCP Server is a server designed to facilitate interaction with ClickHouse databases, allowing users to execute SQL queries and manage databases and tables.
To use the ClickHouse MCP Server, configure the server settings in the Claude Desktop configuration file, specifying your ClickHouse connection details, and then run the server using the provided commands.
- Execute SQL queries on ClickHouse clusters with safety measures. - List all databases and tables within a ClickHouse instance. - Easy configuration for local development and cloud environments.
- Running SQL queries for data analysis in ClickHouse.
- Managing database schemas and structures.
- Integrating with applications that require ClickHouse data access.
Add to your AI client
Use these steps to connect ClickHouse MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-clickhouse-clickhouse": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.13",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_CONNECT_TIMEOUT": "30",
"CLICKHOUSE_HOST": "sql-clickhouse.clickhouse.com",
"CLICKHOUSE_PASSWORD": "",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30",
"CLICKHOUSE_USER": "demo",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-clickhouse-clickhouse": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.13",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_CONNECT_TIMEOUT": "30",
"CLICKHOUSE_HOST": "sql-clickhouse.clickhouse.com",
"CLICKHOUSE_PASSWORD": "",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30",
"CLICKHOUSE_USER": "demo",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-clickhouse-clickhouse": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.13",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_CONNECT_TIMEOUT": "30",
"CLICKHOUSE_HOST": "sql-clickhouse.clickhouse.com",
"CLICKHOUSE_PASSWORD": "",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30",
"CLICKHOUSE_USER": "demo",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-clickhouse-clickhouse": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.13",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_CONNECT_TIMEOUT": "30",
"CLICKHOUSE_HOST": "sql-clickhouse.clickhouse.com",
"CLICKHOUSE_PASSWORD": "",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30",
"CLICKHOUSE_USER": "demo",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-clickhouse-clickhouse": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.13",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_CONNECT_TIMEOUT": "30",
"CLICKHOUSE_HOST": "sql-clickhouse.clickhouse.com",
"CLICKHOUSE_PASSWORD": "",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30",
"CLICKHOUSE_USER": "demo",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-clickhouse-clickhouse": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-clickhouse",
"--python",
"3.13",
"mcp-clickhouse"
],
"env": {
"CLICKHOUSE_CONNECT_TIMEOUT": "30",
"CLICKHOUSE_HOST": "sql-clickhouse.clickhouse.com",
"CLICKHOUSE_PASSWORD": "",
"CLICKHOUSE_PORT": "8443",
"CLICKHOUSE_SECURE": "true",
"CLICKHOUSE_SEND_RECEIVE_TIMEOUT": "30",
"CLICKHOUSE_USER": "demo",
"CLICKHOUSE_VERIFY": "true"
}
}
}
}FAQ
What is required to run the ClickHouse MCP Server?
You need to configure the server with your ClickHouse connection details and have the necessary environment variables set up.
Can I use ClickHouse MCP Server for cloud databases?
Yes! The server can be configured to connect to ClickHouse cloud instances.
Is there a demo available for testing?
Yes! You can use the ClickHouse SQL Playground for testing without setting up your own instance.