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.
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.
Frequently asked questions
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.
Basic information
More Databases MCP servers
ClickHouse MCP Server
ClickHouseConnect ClickHouse to your AI assistants.
Chroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma

nuzur
nuzur is a model-first database platform for MySQL and PostgreSQL. The MCP server lets any AI assistant or agent (Claude, Cursor, Gemini, or anything else that speaks MCP) design your schema, query your data, generate mi
MySQL MCP Server
designcomputerA Model Context Protocol (MCP) server that enables secure interaction with MySQL databases

Local YDB MCP
astandrikSafety-first stdio MCP server with 38 tools for operating Docker-based local-ydb environments locally or over SSH.
Comments