clickhouse-mcp-server
Provides tools for connecting to a ClickHouse database and executing SQL queries, with support for multiple queries and JSON-formatted results.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@clickhouse-mcp-servershow me the top 10 customers by total purchases"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Clickhouse MCP server
A Clickhouse database MCP server project.
Installation
You can install the package using uv:
uv pip install clickhouse-mcp-serverOr using pip:
pip install clickhouse-mcp-serverRelated MCP server: ClickHouse MCP Server
Components
Tools
The server provides two tools:
connect_database: Connects to a specific Clickhouse databasedatabaseparameter: Name of the database to connect to (string)Returns a confirmation message when connection is successful
execute_query: Executes Clickhouse queriesqueryparameter: SQL query/queries to execute (string)Returns query results in JSON format
Multiple queries can be sent separated by semicolons
Configuration
The server uses the following environment variables:
CLICKHOUSE_HOST: Clickhouse server address (default: "localhost")CLICKHOUSE_USER: Clickhouse username (default: "root")CLICKHOUSE_PASSWORD: Clickhouse password (default: "")CLICKHOUSE_DATABASE: Initial database (optional)CLICKHOUSE_READONLY: Read-only mode (set to 1/true to enable, default: false)
Quickstart
Installation
Claude Desktop
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"clickhouse-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/Users/burakdirin/Projects/clickhouse-mcp-server",
"run",
"clickhouse-mcp-server"
],
"env": {
"CLICKHOUSE_HOST": "localhost",
"CLICKHOUSE_USER": "root",
"CLICKHOUSE_PASSWORD": "password",
"CLICKHOUSE_DATABASE": "[optional]",
"CLICKHOUSE_READONLY": "true"
}
}
}
}{
"mcpServers": {
"clickhouse-mcp-server": {
"command": "uvx",
"args": [
"clickhouse-mcp-server"
],
"env": {
"CLICKHOUSE_HOST": "localhost",
"CLICKHOUSE_USER": "root",
"CLICKHOUSE_PASSWORD": "password",
"CLICKHOUSE_DATABASE": "[optional]",
"CLICKHOUSE_READONLY": "true"
}
}
}
}Installing via Smithery
To install Clickhouse Database Integration Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @burakdirin/clickhouse-mcp-server --client claudeDevelopment
Building and Publishing
To prepare the package for distribution:
Sync dependencies and update lockfile:
uv syncBuild package distributions:
uv buildThis will create source and wheel distributions in the dist/ directory.
Publish to PyPI:
uv publishNote: You'll need to set PyPI credentials via environment variables or command flags:
Token:
--tokenorUV_PUBLISH_TOKENOr username/password:
--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with this command:
npx @modelcontextprotocol/inspector uv --directory /Users/burakdirin/Projects/clickhouse-mcp-server run clickhouse-mcp-serverUpon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA Model Context Protocol server that enables Large Language Models to seamlessly interact with ClickHouse databases, supporting resource listing, schema retrieval, and query execution.Last updated2MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI assistants to securely interact with ClickHouse databases, supporting table exploration and SQL query execution through a controlled interface.Last updated18Apache 2.0
- Alicense-qualityDmaintenanceAn MCP server implementation that enables Claude to execute read-only queries against MariaDB databases and explore database schemas through natural language.Last updated20MIT

Altinity MCPofficial
Flicense-qualityAmaintenanceProduction-ready MCP server designed to empower AI agents and LLMs to interact seamlessly with ClickHouse. It exposes your ClickHouse database as a set of standardized tools and resources that adhere to the MCP protocol, making it easy for agents built on OpenAI, Claude, or other platforms to query, explore, and analyse your data.Last updated37
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/burakdirin/clickhouse-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server