MCP.so
Sign In

ClickHouse MCP Server

@bjpadhy

Basic information

Category

Databases

License

MIT

Transports

stdio

Author

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.

ClickHouse MCP Server 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": ""
      }
    }
  }
}

ClickHouse MCP Server tools

2

Run 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

Frequently asked questions

1

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.

2

What databases can I connect to?

It connects to any ClickHouse database configured via environment variables (CLICKHOUSE_URL, CLICKHOUSE_USERNAME, CLICKHOUSE_PASSWORD, CLICKHOUSE_DATABASE).

3

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`.

4

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`.

5

Is there any security guidance?

Always use a read-only database user, store credentials in environment variables, and review query requests before execution.

Comments

More Databases MCP servers