ClickHouse Database

by dubin555

6 stars
318 downloads
Not rated
GitHub

About

Enables read-only ClickHouse database interactions for schema inspection and SQL query execution, returning results in JSON format for data analysis while preventing data modification operations.

Details

Author
dubin555
Repository
dubin555/clickhouse_mcp_server
GitHub stars
6
Downloads
318
License
Apache License 2.0
Categories
Productivity, Developer Tools, Design, AI, Search, Frontend, Security, Infrastructure, Database

- List tables and read data from ClickHouse.
- Execute SQL queries through a controlled interface.
- Secure database access with user/password authentication.
- Configurable via environment variables or command-line args.
- Uses ClickHouse HTTP API on port 8123.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name ClickHouse Database
    Command (node, npx, python, etc.) uv
    Arguments
    • Argument 1 --directory
    • Argument 2 /path/to/clickhouse_mcp_server
    • Argument 3 run
    • Argument 4 -m
    • Argument 5 clickhouse_mcp_server.server
    Environment
    • CLICKHOUSE_HOST localhost
    • CLICKHOUSE_PORT 8123
    • CLICKHOUSE_USER default
    • CLICKHOUSE_DATABASE default
    • CLICKHOUSE_PASSWORD CHANGE_TO_YOUR_PASSWORD

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Set the following environment variables:

CLICKHOUSE_HOST=localhost    
CLICKHOUSE_PORT=8123         
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=CHANGE_TO_YOUR_PASSWORD
CLICKHOUSE_DATABASE=default

Or via command-line args:

--host the database host
--port the database port
--user the database username
--password the database password

  • --database the database name

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "clickhouse database": {
            "env": {
                "CLICKHOUSE_HOST": "localhost",
                "CLICKHOUSE_PORT": "8123",
                "CLICKHOUSE_USER": "default",
                "CLICKHOUSE_DATABASE": "default",
                "CLICKHOUSE_PASSWORD": "CHANGE_TO_YOUR_PASSWORD"
            },
            "args": [
                "--directory",
                "/path/to/clickhouse_mcp_server",
                "run",
                "-m",
                "clickhouse_mcp_server.server"
            ],
            "command": "uv"
        }
    }
}

Linux

{
    "env": {
        "CLICKHOUSE_HOST": "localhost",
        "CLICKHOUSE_PORT": "8123",
        "CLICKHOUSE_USER": "default",
        "CLICKHOUSE_DATABASE": "default",
        "CLICKHOUSE_PASSWORD": "CHANGE_TO_YOUR_PASSWORD"
    },
    "args": [
        "--directory",
        "/path/to/clickhouse_mcp_server",
        "run",
        "-m",
        "clickhouse_mcp_server.server"
    ],
    "command": "uv"
}

Macos

{
    "env": {
        "CLICKHOUSE_HOST": "localhost",
        "CLICKHOUSE_PORT": "8123",
        "CLICKHOUSE_USER": "default",
        "CLICKHOUSE_DATABASE": "default",
        "CLICKHOUSE_PASSWORD": "CHANGE_TO_YOUR_PASSWORD"
    },
    "args": [
        "--directory",
        "/path/to/clickhouse_mcp_server",
        "run",
        "-m",
        "clickhouse_mcp_server.server"
    ],
    "command": "uv"
}

Windows

{
    "env": {
        "CLICKHOUSE_HOST": "localhost",
        "CLICKHOUSE_PORT": "8123",
        "CLICKHOUSE_USER": "default",
        "CLICKHOUSE_DATABASE": "default",
        "CLICKHOUSE_PASSWORD": "CHANGE_TO_YOUR_PASSWORD"
    },
    "args": [
        "--directory",
        "/path/to/clickhouse_mcp_server",
        "run",
        "-m",
        "clickhouse_mcp_server.server"
    ],
    "command": "uv"
}

ClickHouse MCP Server

A Model Context Protocal (MCP) server implement for ClickHouse.

This server provides AI assistants with a secure and structured way to explore and analyze databases. It enables them to list tables, read data, and execute SQL queries through a controlled interface, ensuring responsible database access.

Configuration

Set the following environment variables:

CLICKHOUSE_HOST=localhost    
CLICKHOUSE_PORT=8123         
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=CHANGE_TO_YOUR_PASSWORD
CLICKHOUSE_DATABASE=default

Or via command-line args:

--host the database host
--port the database port
--user the database username
--password the database password

  • --database the database name


Usage


Fake some data in clickhouse


Check the SQL in dev_contribute.md for details.

Post your question to AI assistant in Cline


What is the sales volume in each region? Which product is the best - selling?

Demo Screenshot

CLINE

Configure the MCP server in VSCode, Cline extension, or other MCP client.:

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.