
Kafka Sentinel
io.github.sanjay-amu由 GitHub 帳號 sanjay-amu 發布v0.1.2更新於 Oct 27, 2026
Read-only Kafka observability MCP server: cluster health, consumer lag, and replay-readiness.
概覽
唯讀的 Kafka 可觀測性 MCP 伺服器,讓助理檢視叢集健康、消費延遲、分割區狀態與重播可行性。
- 可以做什麼
- 列出主題與消費群組,取得名稱與狀態
- 回報叢集健康:broker 數量、控制器狀態、副本不足與離線分割區數
- 依群組、主題、分割區顯示消費延遲及已提交與末端位移
- 稽核主題持久性設定,檢視分割區 leader、ISR 縮減與分布傾斜
- 檢查指定群組與主題的重播可行性,並一次產生附時間戳的故障快照
- 適用情境
- 適合排查串流資料故障,例如消費群組停滯、延遲暴增、重平衡風暴或位移重設,也適合讓助理在完全沒有寫入或管理權限的情況下觀察並關聯 Kafka 狀態。
- 執行需求
- 以 Python 套件形式透過 pip 或 uv 本機安裝,經 stdio 啟動。需要 KAFKA_BOOTSTRAP;選用 SASL/SSL 設定透過 KAFKA_SECURITY_PROTOCOL、KAFKA_SASL_MECHANISM、KAFKA_SASL_USERNAME、KAFKA_SASL_PASSWORD 與 KAFKA_SSL_CA_LOCATION 提供。需要能連線至 broker 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Kafka Sentinel,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
kafka-sentinel-mcp
[CI] [PyPI] [Python] [License: MIT]
Give AI agents safe, read-only eyes on your Kafka clusters.
An MCP (Model Context Protocol) server that exposes Kafka cluster health, consumer lag, partition state, and replay-readiness as structured tools — so LLM agents (Claude, or any MCP client) can diagnose streaming incidents without ever being able to break anything.
Built by an engineer who spent a decade running Kafka-based financial messaging at 99.999% availability, and got tired of every "AI + Kafka" demo assuming write access to production.
Why this exists
When a consumer group stalls at 3 a.m., the questions are always the same: Is it lag? A stuck partition? A rebalance storm? An offset reset gone wrong? These are pattern-matching questions — exactly what LLM agents are good at — but no operator will hand an agent admin rights on a production cluster.
kafka-sentinel-mcp draws a hard line: every tool is read-only by design, enforced at the client-config level (no admin operations are even imported). The agent can observe, correlate, and recommend; a human executes.
Tools
Quick start
Add to Claude Desktop / any MCP client:
Then ask your agent: "Why is the payments-consumer group falling behind, and can we still replay from where it stalled?"
Security posture
-
Read-only by construction: no produce, no topic/config mutation, no offset commits, no ACL ops. The mutation APIs are never imported, and a test in CI greps the server source on every run to keep it that way.
-
The observer consumer runs with
enable.auto.commit=Falseand never commits — verified against a real broker, not just asserted. -
Supports SASL/SSL; credentials are read from the environment only and never logged.
-
Every tool call is logged with its parameters for audit.
-
Least privilege: run with a principal that has only
Describeon the cluster and topics, andDescribeon consumer groups. When an ACL denies an operation the tool returns a structured result rather than a stack trace:The agent can then tell the operator which ACL is missing instead of appearing broken. Non-authorization failures are deliberately not swallowed — they propagate, because silently degrading on an unrelated error would hide real problems.
Testing
The unit suite mocks librdkafka entirely and covers tool logic. The integration suite starts an actual broker, produces real records, and asserts the tools return correct lag, ISR state, durability flags, and replay-readiness — including that the observer leaves no committed offsets behind. Both run in CI.
Status
Early but tested. See ROADMAP.md. Issues and PRs welcome — especially war stories about what you wish an agent could have told you during an incident.
Citing this work
If you reference this project in academic work, see CITATION.cff, or use the "Cite this repository" button on GitHub.
License
MIT
來源:README.md,提交 719153d
工具
0版本歷史
1- v0.1.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分