ClickHouse MCP Server
@bjpadhy
About ClickHouse MCP Server
A Model Context Protocol (MCP) server that connects to ClickHouse databases and allows LLMs like Claude to explore and analyze data through natural language queries.
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"clickhouse-analytics": {
"command": "node",
"args": [
"/absolute/path/to/clickhouse-mcp-server/dist/index.js"
],
"env": {
"CLICKHOUSE_URL": "",
"CLICKHOUSE_USERNAME": "",
"CLICKHOUSE_PASSWORD": "",
"CLICKHOUSE_DATABASE": ""
}
}
}
}Tools
2Run a read-only SQL query against the database
Ask questions about your data in natural language
Overview
What is ClickHouse MCP Server?
ClickHouse MCP Server is a Model Context Protocol (MCP) server that connects to ClickHouse databases and enables LLMs like Claude to explore and analyze data through natural language queries.
How to use ClickHouse MCP Server?
Clone the repository, install dependencies with npm install, configure environment variables in a .env file (using a read-only database user), and build with npm run build. Run locally with npm start, or integrate with Claude Desktop by adding the server configuration to claude_desktop_config.json.
Key features of ClickHouse MCP Server
- Connects to ClickHouse databases
- Exposes table schemas as resources
- Runs SQL queries from natural language instructions
- Executes only read-only SQL queries
- Works with Claude Desktop for macOS
- Provides sample data (5 rows) for any table
Use cases of ClickHouse MCP Server
- Explore database schemas and sample data through LLMs
- Ask natural language questions about your data without writing SQL
- Perform read-only analytical queries against ClickHouse
FAQ from ClickHouse MCP Server
What type of queries does ClickHouse MCP Server allow?
The server only allows read-only SQL queries and performs basic validation to prevent DDL or DML statement execution.
What databases can I connect to?
It connects to any ClickHouse database configured via environment variables (CLICKHOUSE_URL, CLICKHOUSE_USERNAME, CLICKHOUSE_PASSWORD, CLICKHOUSE_DATABASE).
How do I integrate with Claude Desktop?
Add the server configuration to your Claude Desktop config file at ~/Library/Application Support/Claude/claude_desktop_config.json with the command node and absolute path to the built index.js.
What resources and tools are available?
Resources: db://info, table://{tableName}/schema, table://{tableName}/sample. Tools: execute-sql (read-only query) and natural-language-query.
Is there any security guidance?
Always use a read-only database user, store credentials in environment variables, and review query requests before execution.
More Databases MCP servers

Redis
modelcontextprotocolModel Context Protocol Servers
ClickHouse MCP Server
ClickHouseConnect ClickHouse to your AI assistants.
mcp-server-duckdb
ktanaka101A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities

PostgreSQL
modelcontextprotocolModel Context Protocol Servers
Redis MCP Server
redisThe official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently
Comments