
nifi-clickhouse-kafka-mcp
io.github.arogan178由 GitHub 帳號 arogan178 發布v0.1.0更新於 Nov 2, 2026
Read-only Apache NiFi, ClickHouse and Kafka access with OIDC, audit and secret masking
概覽
唯讀 MCP 伺服器,讓助理跨多個環境檢視 Apache NiFi 流程、ClickHouse 資料庫與 Kafka 主題。
- 可以做什麼
- 列出已設定的環境,並檢視 NiFi 流程:健康狀態、狀態、流程樹、搜尋、處理群組、元件、處理器狀態、控制器服務、公告、參數、佇列、FlowFile 與溯源資訊。
- 以唯讀方式查詢 ClickHouse:用綁定參數執行 SELECT 語句、列出資料庫與資料表、描述資料表結構、搜尋欄位並檢查叢集健康狀態。
- 瀏覽 Kafka:叢集資訊、主題、主題詳情、消費者群組與落後量、取樣訊息,以及依 key、子字串或 JSON 欄位搜尋訊息。
- 在結果中遮蔽機密與設定的欄位,所有清單皆分頁,並限制列數與大小,避免輸出淹沒模型上下文。
- 適用情境
- 適合資料平台與維運情境:排查 NiFi 背壓或已停止的處理器、檢查 Kafka 消費者落後量或找出某則訊息、了解 ClickHouse 資料表結構與健康狀態,同時不必授予寫入權限或發放憑證。
- 執行需求
- 以 Python 套件形式透過 uvx 在本機執行(stdio),或部署為需 OIDC 登入的遠端 HTTP 服務。需要一份 YAML 設定檔,路徑由 NIFI_CLICKHOUSE_KAFKA_MCP_CONFIG 指定,內容描述各環境的 NiFi、ClickHouse 與 Kafka 端點及憑證;機密可從環境變數讀取。需要能連線至這些後端服務的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 nifi-clickhouse-kafka-mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
nifi-clickhouse-kafka-mcp
A read-only MCP server that lets AI assistants look inside Apache NiFi, ClickHouse and Kafka: one server, every environment, and nothing it can break.
Ask Claude, Cursor or any MCP client things like:
- "Why is the orders flow in prod backed up?" →
nifi_healthfinds the full queue, the stopped processor and the error bulletin, worst first. - "Show me a FlowFile stuck in that queue and where it came from." →
nifi_queue,nifi_flowfile,nifi_provenance. - "Is the billing consumer losing data?" →
kafka_consumer_lagflags partitions already behind retention. - "Find the message for order 42 sent in the last hour." →
kafka_searchby key, substring or JSON field. - "Which tables have customer data and how big are they?" →
clickhouse_search_columns,clickhouse_describe_table.
It grew out of a gateway built to give a data platform team AI access to NiFi 2, ClickHouse and Strimzi Kafka clusters without handing out credentials or write access.
How it works
Each environment (prod, staging, ...) has its own set of backends; one server serves them all.
Why this one
See docs/landscape.md for how this compares with other NiFi, ClickHouse and Kafka MCP servers and which of their users' complaints it answers.
Quick start
Try it against a local NiFi 2, ClickHouse and Kafka:
Then ask Claude Code "what's wrong in the demo NiFi flow?". examples/demo/README.md has the full walkthrough, including seeding Kafka.
For your own systems, write a config (see examples/config.example.yaml):
${VAR} and ${VAR:-default} read environment variables, so secrets stay out of the file.
nifi-clickhouse-kafka-mcp --config config.yaml --check validates it and lists the tools it would serve.
Connecting
One person, stdio. The server runs on your machine with your config:
A team, HTTP with OAuth. Run it once (Docker or Kubernetes), and everyone logs in with their own account:
No identity provider? Put it behind the proxy you already have (oauth2-proxy, Cloudflare Access, Tailscale, ...) and
set trusted_user_header to the header that proxy adds; the user still shows up in the audit log.
docs/deploying.md covers the identity provider, proxy mode, the read-only backend identities, Docker, Kubernetes, audit and metrics.
Tools
Tools only appear for systems you configure. Turn any off with disabled_tools (patterns allowed, e.g. kafka_search
or nifi_flow*).
Highlights:
nifi_health: back-pressured connections, invalid processors, controller services that are down, error bulletins and stopped processors, worst first, for a whole flow in one call.nifi_flowfile/nifi_provenance_event: attributes and content of real FlowFiles, JSON re-serialized with secrets masked, paged by offset.clickhouse_query: one read statement with bound{name:Type}parameters, streamed and cut at a row or size cap, with rows read and elapsed time. ClickHouse's own parser checks every statement first, and only table functions that read ClickHouse itself (numbers,merge,clusterAllReplicas, ...) may run;url,s3,file,remoteand the rest are refused.clickhouse_health: replicas with problems, disk use, partitions with the most parts, long queries, merges, stuck mutations and recent errors.kafka_search: scans every partition for a key, a substring or a JSON field equal to a value, inside a time window, with a scan and time budget and aresumetoken to continue.kafka_sample: messages from an offset, a timestamp or the end, with keys, values and headers decoded (JSON, text, Schema Registry Avro and JSON Schema) and masked.
Security model
The gateway is the first lock. It registers only read tools (each annotated readOnlyHint). The NiFi client can only
send GETs plus the temporary queue-listing and provenance requests NiFi needs, and refuses ids that would reach another
endpoint. Every ClickHouse statement is parsed by ClickHouse (EXPLAIN AST) before it runs: only SELECT, WITH,
SHOW, DESCRIBE, EXISTS and EXPLAIN pass, table functions must be on an allowlist wherever they appear, and
the few scalar functions that reach the network or disk (hasColumnInTable, file, ...) are refused. Kafka is only ever read with
assign(). Tests fail the build if a write path appears.
The backend is the second lock: give the gateway a NiFi identity with view-only policies, a ClickHouse user with
readonly and SELECT grants, and a Kafka user with Read/Describe ACLs. docs/deploying.md has
the exact setup for each.
Two choices worth knowing:
- The gateway uses its own identity, not the user's. NiFi 2 authorizes a proxied request on the end user's rights alone, so a gateway that proxies users could write wherever they can. Per-user identity is kept for audit instead.
- Masking is defence in depth, not the boundary. It hides secrets and configured fields in results, and searches (NiFi and Kafka) match against masked values so they can't be used to confirm a hidden one. It works on recognisable shapes, though, and a ClickHouse query can alias a column, so keep truly sensitive data out of reach with backend permissions: NiFi policies, ClickHouse column grants and row policies, Kafka topic ACLs.
Report vulnerabilities as described in SECURITY.md.
Development
Roadmap
- Protobuf decoding for Kafka
- NiFi provenance lineage graphs
- Helm chart
- Per-user ClickHouse roles mapped from token claims
License
Apache 2.0
來源:README.md,提交 f30ad08
工具
0版本歷史
1- v0.1.0最新Oct 19, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分