ClickHouse MCP Server
by bjpadhy
The ClickHouse MCP Server connects to ClickHouse databases, enabling LLMs like Claude to explore and analyze data using natural language. It exposes table schemas and allows running read-only SQL queries from natural language instructions.
Last updated: N/A
What is ClickHouse MCP Server?
A Model Context Protocol (MCP) server that bridges ClickHouse databases and Large Language Models (LLMs) such as Claude, facilitating data exploration and analysis through natural language queries.
How to use ClickHouse MCP Server?
- Clone the repository. 2. Install dependencies using
npm install
. 3. Configure environment variables in a.env
file with ClickHouse connection details (using a read-only user). 4. Build the project withnpm run build
. 5. Run the server locally usingnpm start
. 6. Integrate with Claude Desktop by updating theclaude_desktop_config.json
file with the server configuration.
Key features of ClickHouse MCP Server
Connects to ClickHouse databases
Exposes table schemas as resources
Runs SQL queries from natural language instructions
Executes read-only SQL queries
Works with Claude Desktop for macOS
Use cases of ClickHouse MCP Server
Analyzing ClickHouse data using natural language queries
Integrating ClickHouse data with LLMs for enhanced insights
Building data exploration tools for non-technical users
Automating data analysis tasks with natural language instructions
FAQ from ClickHouse MCP Server
What is an MCP server?
What is an MCP server?
A Model Context Protocol (MCP) server acts as an intermediary between a data source (like ClickHouse) and an LLM, providing the LLM with context and tools to interact with the data.
What security measures are in place?
What security measures are in place?
The server only allows read-only SQL queries, sensitive credentials should be stored securely in environment variables, and basic validation is performed to prevent DDL or DML statement execution. Always review query requests before execution.
How do I configure the server to connect to my ClickHouse database?
How do I configure the server to connect to my ClickHouse database?
You need to set the CLICKHOUSE_URL
, CLICKHOUSE_USERNAME
, CLICKHOUSE_PASSWORD
, and CLICKHOUSE_DATABASE
environment variables in a .env
file.
What resources are available?
What resources are available?
The server provides resources like db://info
(database information), table://{tableName}/schema
(table schema), and table://{tableName}/sample
(sample data).
What tools are available?
What tools are available?
The server provides tools like execute-sql
(run a read-only SQL query) and natural-language-query
(ask questions about your data in natural language).