ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

ClickHouse

โดย ClickHouseรุ่น 0.7.0i★ –iรันบนเครื่อง
ชื่อใน registryio.github.ClickHouse/mcp-clickhouse

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Official ClickHouse MCP server for querying and exploring ClickHouse clusters and chDB.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: ฐานข้อมูลและชุดข้อมูล
  • ต้องใส่ค่าเหล่านี้: CLICKHOUSE_HOST, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

  • ผลตรวจเบื้องต้น: ผ่าน 1 จาก 1 ข้อ
  • รันในเครื่องคุณด้วยสิทธิ์ของผู้ใช้คุณ (ไฟล์ อินเทอร์เน็ต แอปต่าง ๆ)
  • ค่าที่คุณต้องใส่เอง: CLICKHOUSE_HOST, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, CLICKHOUSE_PORT, CLICKHOUSE_SECURE, CLICKHOUSE_VERIFY, CLICKHOUSE_CA_CERT, CLICKHOUSE_CLIENT_CERT, CLICKHOUSE_CLIENT_CERT_KEY, CLICKHOUSE_TLS_MODE, CLICKHOUSE_DATABASE, CLICKHOUSE_ROLE, CLICKHOUSE_ALLOW_WRITE_ACCESS, CLICKHOUSE_ALLOW_DROP, CLICKHOUSE_MCP_QUERY_TIMEOUT, CLICKHOUSE_MCP_MAX_WORKERS

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "clickhouse": {
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "ใส่ค่าของคุณ",
        "CLICKHOUSE_USER": "ใส่ค่าของคุณ",
        "CLICKHOUSE_PASSWORD": "ใส่ค่าของคุณ",
        "CLICKHOUSE_PORT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_SECURE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_VERIFY": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CA_CERT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CLIENT_CERT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CLIENT_CERT_KEY": "ใส่ค่าของคุณ",
        "CLICKHOUSE_TLS_MODE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_DATABASE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ROLE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ALLOW_WRITE_ACCESS": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ALLOW_DROP": "ใส่ค่าของคุณ",
        "CLICKHOUSE_MCP_QUERY_TIMEOUT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_MCP_MAX_WORKERS": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add clickhouse --env CLICKHOUSE_HOST='ใส่ค่าของคุณ' --env CLICKHOUSE_USER='ใส่ค่าของคุณ' --env CLICKHOUSE_PASSWORD='ใส่ค่าของคุณ' --env CLICKHOUSE_PORT='ใส่ค่าของคุณ' --env CLICKHOUSE_SECURE='ใส่ค่าของคุณ' --env CLICKHOUSE_VERIFY='ใส่ค่าของคุณ' --env CLICKHOUSE_CA_CERT='ใส่ค่าของคุณ' --env CLICKHOUSE_CLIENT_CERT='ใส่ค่าของคุณ' --env CLICKHOUSE_CLIENT_CERT_KEY='ใส่ค่าของคุณ' --env CLICKHOUSE_TLS_MODE='ใส่ค่าของคุณ' --env CLICKHOUSE_DATABASE='ใส่ค่าของคุณ' --env CLICKHOUSE_ROLE='ใส่ค่าของคุณ' --env CLICKHOUSE_ALLOW_WRITE_ACCESS='ใส่ค่าของคุณ' --env CLICKHOUSE_ALLOW_DROP='ใส่ค่าของคุณ' --env CLICKHOUSE_MCP_QUERY_TIMEOUT='ใส่ค่าของคุณ' --env CLICKHOUSE_MCP_MAX_WORKERS='ใส่ค่าของคุณ' -- uvx mcp-clickhouse

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "clickhouse": {
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "ใส่ค่าของคุณ",
        "CLICKHOUSE_USER": "ใส่ค่าของคุณ",
        "CLICKHOUSE_PASSWORD": "ใส่ค่าของคุณ",
        "CLICKHOUSE_PORT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_SECURE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_VERIFY": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CA_CERT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CLIENT_CERT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CLIENT_CERT_KEY": "ใส่ค่าของคุณ",
        "CLICKHOUSE_TLS_MODE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_DATABASE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ROLE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ALLOW_WRITE_ACCESS": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ALLOW_DROP": "ใส่ค่าของคุณ",
        "CLICKHOUSE_MCP_QUERY_TIMEOUT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_MCP_MAX_WORKERS": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "clickhouse": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-clickhouse"
      ],
      "env": {
        "CLICKHOUSE_HOST": "ใส่ค่าของคุณ",
        "CLICKHOUSE_USER": "ใส่ค่าของคุณ",
        "CLICKHOUSE_PASSWORD": "ใส่ค่าของคุณ",
        "CLICKHOUSE_PORT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_SECURE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_VERIFY": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CA_CERT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CLIENT_CERT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_CLIENT_CERT_KEY": "ใส่ค่าของคุณ",
        "CLICKHOUSE_TLS_MODE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_DATABASE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ROLE": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ALLOW_WRITE_ACCESS": "ใส่ค่าของคุณ",
        "CLICKHOUSE_ALLOW_DROP": "ใส่ค่าของคุณ",
        "CLICKHOUSE_MCP_QUERY_TIMEOUT": "ใส่ค่าของคุณ",
        "CLICKHOUSE_MCP_MAX_WORKERS": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • CLICKHOUSE_HOST จำเป็น env
    Hostname of the ClickHouse server
  • CLICKHOUSE_USER จำเป็น env
    Username for ClickHouse authentication
  • CLICKHOUSE_PASSWORD ความลับ env
    Password for ClickHouse authentication. Required unless a client certificate uses the default or mutual TLS mode
  • CLICKHOUSE_PORT env
    ClickHouse HTTP(S) port. Defaults to 8443 when CLICKHOUSE_SECURE=true, 8123 otherwise
  • CLICKHOUSE_SECURE env
    Use HTTPS to connect to ClickHouse
  • CLICKHOUSE_VERIFY env
    Verify SSL certificates
  • CLICKHOUSE_CA_CERT env
    Path to a PEM CA bundle for ClickHouse server certificate verification
  • CLICKHOUSE_CLIENT_CERT env
    Path to a PEM client certificate for the ClickHouse HTTPS connection
  • CLICKHOUSE_CLIENT_CERT_KEY env
    Path to the PEM private key for CLICKHOUSE_CLIENT_CERT
  • CLICKHOUSE_TLS_MODE env
    Client certificate mode: mutual, proxy, or strict
  • CLICKHOUSE_DATABASE env
    Default database to use
  • CLICKHOUSE_ROLE env
    ClickHouse role to activate for the session
  • CLICKHOUSE_ALLOW_WRITE_ACCESS env
    Allow write operations (DDL and DML). Queries run read-only by default
  • CLICKHOUSE_ALLOW_DROP env
    Allow destructive operations (DROP, TRUNCATE, DELETE, UPDATE, REPLACE, CLEAR, and DETACH PERMANENTLY) when write access is also enabled
  • CLICKHOUSE_MCP_QUERY_TIMEOUT env
    Query tool timeout in seconds
  • CLICKHOUSE_MCP_MAX_WORKERS env
    Maximum query worker thread pool size

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub ClickHouse ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด ฐานข้อมูลและชุดข้อมูลi

  • ดาวมากกว่า 0% ของอีก 956 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 40% ของอีก 956 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 956 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

ClickHouse ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: CLICKHOUSE_HOST, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.7.0) เข้า registry 2 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv), Docker ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Supabase, MongoDB MCP Server, Elasticsearch MCP Server

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Supabase

โดย supabase

server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ

บนเครื่องหรือคลาวด์★ 2,993Apache-2.0อัปเดต เมื่อวาน
ติดตั้ง

MongoDB MCP Server

โดย mongodb-js

MongoDB Model Context Protocol Server

รันบนเครื่อง★ 1,157Apache-2.0อัปเดต 3 วันที่ผ่านมา
ติดตั้ง

Elasticsearch MCP Server

โดย cr7258

MCP server for interacting with Elasticsearch

รันบนเครื่อง★ 315Apache-2.0อัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

ClickHouse MCP Server

An MCP server for ClickHouse.

The server implements MCP 2026-07-28 and supports legacy initialize handshakes from 2024-11-05 through 2025-11-25. Modern clients use sessionless requests and server/discover. Existing clients can continue to negotiate the legacy protocol.

[!NOTE]

HTTP requests without MCP-Protocol-Version are routed through legacy handling so

clients from before 2025-06-18 can continue to connect. MCP 2026-07-28 permits

this behavior on servers that support those clients. Modern clients should send the

header on every POST request.

Features

ClickHouse Tools

ClickHouse tool responses are JSON-encoded strings. Integers outside [-9007199254740991, 9007199254740991] are returned as decimal strings to preserve exact values in JavaScript clients. This applies to query rows and integer table metadata. Safe-range integers and booleans keep their JSON types.

  • run_query
  • Execute SQL queries on your ClickHouse cluster.
  • Input: query (string): The SQL query to execute.
  • Optional input: params (object): Named values for ClickHouse {name:Type} placeholders. See Query parameters.
  • Queries run in read-only mode by default (CLICKHOUSE_ALLOW_WRITE_ACCESS=false), but writes can be enabled explicitly if needed.
  • DESCRIBE ( ) and EXPLAIN ESTIMATE run here too and are optional ways to inspect a query's result schema or its estimated reads. See Checking a query before running it.
  • list_databases
  • List all databases on your ClickHouse cluster.
  • list_tables
  • List tables in a database with pagination.
  • Required input: database (string).
  • Optional inputs:
  • like / not_like (string): Apply LIKE or NOT LIKE filters to table names.
  • page_token (string): Single-use token returned by a previous call. It is retained for up to one hour.
  • page_size (int, default 50): Number of tables returned per page; must be greater than 0.
  • include_detailed_columns (bool, default true): When false, omits column metadata for lighter responses while keeping the full create_table_query.
  • Response shape:
  • tables: Array of table objects for the current page.
  • next_page_token: Pass this single-use value back before it expires to fetch the next page, or null when there are no more tables.
  • total_tables: Total count of tables that match the supplied filters.
Agents Schema discovery

The server instructions suggest reading Agents Schema's canonical AGENTS.ROOT through run_query when list_databases reveals an AGENTS database, before writing analytical SQL. This is guidance for the agent: no metadata is fetched automatically, tool results are unchanged, and existing ClickHouse permissions still apply. If AGENTS.ROOT is missing or inaccessible, normal discovery and queries remain available.

Query parameters

Pass values separately from SQL through the optional params object:

{

"query": "SELECT {id:UInt32} AS id, {name:String} AS name", "params": {"id": 13, "name": "O'Reilly"} }

Use ClickHouse's {name:Type} placeholders without quoting them. Keep the opening brace, name, and colon adjacent, as in {id:UInt32}. Spaces after the colon and within the type are supported, as in {id: UInt32} and {amount:Decimal(18, 4)}. For compatibility across supported driver versions, start names with a letter or underscore and use only letters, digits, and underscores. Python-style %s or %(name)s formatting and the driver's $name$ raw binary parameters are not supported. Calls with only query still work. Omitting params, passing null, or passing an empty object leaves the query unbound.

Parameter values can be JSON strings, numbers, booleans, null, or arrays, provided they match the declared ClickHouse type:

  • Use null with a Nullable(...) type.
  • Pass exact integers outside JavaScript's safe range as decimal strings, for example "18446744073709551615" with {id:UInt64}. Dates, timestamps, and exact decimals can also be passed as strings with the corresponding ClickHouse type.
  • Bind vectors as one array, for example {vector:Array(Float32)} with "params": {"vector": [0.25, 0.5, 0.75]}.
  • Nulls inside arrays depend on the installed driver. They work with clickhouse-connect 1.8.0 but fail with the supported minimum 1.0.0.
  • JSON lists and objects cannot bind to ClickHouse Tuple and Map types.

Missing values and incompatible types return query errors. With non-empty params, a query carrying many unterminated {name: placeholder starts is rejected, including placeholder-like text in comments or string literals. Parameterized queries use the same write protection, timeouts, cancellation, and JSON result encoding as other queries.

Parameter values stay out of the MCP server's normal SQL log messages, but remain in MCP tool arguments and may appear in backend errors. ClickHouse 26.3.20.7 substitutes values into the query text in system.query_log, system.processes, and system.text_log. Parameter binding is not a privacy feature and does not reduce the number of vector values sent in a tool call.

Checking a query before running it

run_query also runs DESCRIBE and EXPLAIN ESTIMATE. Both are optional checks: reach for DESCRIBE when you need a query's output columns and types, and for EXPLAIN ESTIMATE before a SELECT that could be expensive.

DESCRIBE ( ) inspects the result schema and returns the same output-column metadata as DESCRIBE TABLE:

DESCRIBE (SELECT user, sum(amt) FROM events WHERE ts > now() - INTERVAL 30 DAY GROUP BY user)
user      String

sum(amt) Decimal(38, 2)

ClickHouse has to analyze the query to answer, so analysis errors surface here, with ClickHouse's own message, instead of part way through execution:

DESCRIBE (SELECT usr FROM events)  -> Code: 47. Unknown expression identifier `usr` ... Maybe you meant: ['user']

DESCRIBE (SELECT * FROM nosuch) -> Code: 60. Unknown table expression identifier 'nosuch'

A query that describes cleanly can still fail when it runs, on a memory limit or a remote server error, and it says nothing about cost.

EXPLAIN ESTIMATE returns the parts, rows and marks the query would read, one row per table, which is what separates a primary key lookup from a full scan:

EXPLAIN ESTIMATE SELECT count() FROM events WHERE id = 42
database  table   parts  rows   marks

default events 1 8192 1

Those are estimated reads from MergeTree family tables, after primary key and partition pruning. They are not run time and not result size, and other table engines are not covered.

Neither statement runs the query body, but analysis is not always free: DESCRIBE (SELECT (SELECT sleep(1))) executes the scalar subquery while analyzing. Both are read-only and work under the default CLICKHOUSE_ALLOW_WRITE_ACCESS=false. See the ClickHouse documentation for EXPLAIN ESTIMATE and DESCRIBE.

chDB Tools
  • run_chdb_select_query
  • Execute SQL queries using chDB's embedded ClickHouse engine.
  • Input: query (string): The SQL query to execute.
  • Integers outside [-9007199254740991, 9007199254740991] are returned as decimal strings.
  • Query data directly from various sources (files, URLs, databases) without ETL processes.
  • Requires the optional chdb extra: pip install 'mcp-clickhouse[chdb]'
Health Check Endpoint

When running with HTTP or SSE transport, a health check endpoint is available at /health. This endpoint:

  • Returns 200 OK (body: OK) if the server is healthy and can connect to ClickHouse
  • Returns 503 Service Unavailable with a generic error message if the server cannot connect to ClickHouse
  • Returns 503 if a ClickHouse probe does not finish within two seconds. Concurrent requests share one in-flight probe
  • Reuses a completed probe result for one second, so probes that arrive in quick succession do not each connect to ClickHouse. A failure or a recovery can therefore be reported up to a second late

GET and HEAD requests to the endpoint are intentionally unauthenticated and exempt from Host and Origin validation so orchestrator probes (e.g. Kubernetes liveness/readiness, load balancers) can use runtime-assigned pod or target IPs without extra configuration. /health is reserved and cannot be used as the MCP transport path. The response body is deliberately minimal to avoid leaking backend version strings or error details; debug failures via the server logs.

Example:

curl http://localhost:8000/health

Response: OK

Security

Authentication for HTTP/SSE Transports

When using HTTP or SSE transport, authentication is required by default. The stdio transport (default) does not require authentication as it only communicates via standard input/output.

Three authentication modes are supported. Pick one:

ModeWhen to useEnv var
Static bearer tokenSimple deployments, internal servicesCLICKHOUSE_MCP_AUTH_TOKEN
OAuth / OIDC (via FastMCP)Azure Entra, Google, GitHub, WorkOS, etc.FASTMCP_SERVER_AUTH= (+ provider-specific FASTMCP_SERVER_AUTH_* vars)
DisabledLocal development onlyCLICKHOUSE_MCP_AUTH_DISABLED=true

Startup fails if none of these are configured for HTTP/SSE transports.

Setting Up Authentication
  1. Generate a secure token (can be any random string):
   # Using uuidgen (macOS/Linux)

uuidgen

Using openssl

openssl rand -hex 32

  1. Configure the server with the token:
   export CLICKHOUSE_MCP_AUTH_TOKEN="your-generated-token"
  1. Configure your MCP client to include the token in requests:

For Claude Desktop with HTTP/SSE transport:

   {

"mcpServers": { "mcp-clickhouse": { "url": "http://127.0.0.1:8000", "headers": { "Authorization": "Bearer your-generated-token" } } } }

Note: the /health endpoint is intentionally unauthenticated (see Health Check Endpoint above). To verify that bearer-token auth is actually rejecting unauthenticated requests, hit the MCP endpoint itself e.g. with the MCP Inspector, or by POSTing a JSON-RPC request to /mcp with and without the Authorization header and confirming the unauthenticated call returns 401.

OAuth / OIDC via FastMCP

For production deployments with identity providers (Azure Entra, Google, GitHub, WorkOS, etc.), delegate authentication to FastMCP's built-in auth providers instead of using a static token. Set FASTMCP_SERVER_AUTH to the full class path

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx