ClickHouse
Read-only SQL on a ClickHouse server or ClickHouse Cloud service over the HTTP interface: databases, tables, columns, CREATE statements, table sizes, running and recent queries, and any SELECT with readonly=1.
7 日間無料 · クレジットカード不要 · EU ホスト
ClickHouse に何でも聞ける
AnythingMCP 経由で ClickHouse に実際のプロンプトを試そう — Claude がツールを呼び出し、回答します。あなたのメッセージで Enter を押すと Cloud にインストールします。
ClickHouse を Cloud にインストールClaude は AI のため誤ることがあります。回答をご確認ください。
2 分でセットアップ
- 1cloud.anythingmcp.com で無料トライアル開始。
- 2コネクターストアで ClickHouse をクリック。資格情報を貼り付け。
- 3MCP API キーを発行し、AI クライアントを MCP URL に向ける。
ClickHouse のガイド
主要 AI クライアント向けのステップバイステップセットアップ。
ClickHouse のセットアップ
コネクタ定義そのものから:認証情報の入手先、必要な権限、このアダプタが呼び出す API。 コネクタ作者により英語で提供されています。
ClickHouse
This connector runs read-only SQL against a ClickHouse server through its HTTP interface: ClickHouse Cloud services and self-hosted servers alike. Every request carries the setting readonly=1, so ClickHouse itself refuses writes, DDL and SET statements, whatever the user's grants. To manage ClickHouse Cloud services (start, stop, scaling, backups, costs) install the ClickHouse Cloud connector.
Setup (3 minutes)
CLICKHOUSE_URL: the HTTPS address with port. ClickHouse Cloud: open the service, click Connect, choose HTTPS and copy the host, e.g.https://abc123xyz.europe-west4.gcp.clickhouse.cloud:8443. Self-hosted:https://your-host:8443(orhttp://your-host:8123on a private network).- Create a dedicated user that may only read, for example
CREATE USER mcp_reader IDENTIFIED BY '...'; GRANT SELECT ON analytics.* TO mcp_reader;plusGRANT SELECT ON system.parts, system.processes, system.query_log TO mcp_readerif you wantclickhouse_table_sizes,clickhouse_running_queriesandclickhouse_recent_queries. Do not give it areadonly = 2settings profile: the connector setsreadonly=1and ClickHouse rejects that change underreadonly = 2(readonly = 0or1both work). - Put the user name into
CLICKHOUSE_USERand its password intoCLICKHOUSE_PASSWORD(sent as HTTP Basic auth). - ClickHouse Cloud only: the service's IP access list must allow the address AnythingMCP calls from.
- Run
clickhouse_server_infoto check the connection.
Workflow
- Explore:
clickhouse_list_databases, thenclickhouse_list_tablesfor one database,clickhouse_describe_tablefor the columns and keys,clickhouse_show_create_tablefor the engine, sorting key and partitioning;clickhouse_search_columnsfinds a column by name across databases. - Ask questions:
clickhouse_querywith one statement. Filter on the sorting key and partition columns fromclickhouse_show_create_table, aggregate in SQL (count(),sum(),uniq(),quantile(0.95)(x),toStartOfDay(ts)), and always end withLIMIT. UseEXPLAINorEXPLAIN ESTIMATEbefore a query that may scan a large table. - Operations:
clickhouse_server_info,clickhouse_table_sizes,clickhouse_running_queries,clickhouse_recent_queries(failed queries have anexception_code).
Reading the answers: the JSON format returns meta (column names and types), data (rows), rows (row count) and statistics (elapsed seconds, rows and bytes read). 64-bit integers (UInt64, Int64) arrive as strings, so "12345678901" is a number. DateTime values are YYYY-MM-DD hh:mm:ss in the server time zone from clickhouse_server_info unless the column type names another. Sizes from formatReadableSize are binary units (KiB, MiB, GiB).
Limits: there is no row cap besides your LIMIT and the connector's response size limit, so aggregate rather than fetch raw rows. A ClickHouse Cloud service that idles wakes on the first query, which can take up to a minute. clickhouse_running_queries shows one replica of a Cloud service.
Errors: the body carries Code: <n>. DB::Exception: .... Code 164 (READONLY) means the statement writes or changes a setting; 497 (ACCESS_DENIED, HTTP 403) a missing GRANT; 60 (UNKNOWN_TABLE) and 81 (UNKNOWN_DATABASE) a wrong name; 62 (SYNTAX_ERROR) bad SQL; 159 or 241 a timeout or memory limit (narrow the query). 401 or 516 (AUTHENTICATION_FAILED) means a wrong user or password.
あなたの AI は ClickHouse から 2 クリック先。
コネクターをインストール、資格情報を貼り付け、AI に質問。7 日間無料、クレジットカード不要。