Read-only Kafka observability MCP server: cluster health, consumer lag, and replay-readiness for AI agents that must never touch production.
Project description
kafka-sentinel-mcp
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
| Tool | What it returns |
|---|---|
cluster_health |
Broker count, controller status, under-replicated / offline partition counts |
consumer_lag |
Per-group, per-topic, per-partition lag with committed vs end offsets |
topic_audit |
Replication factor, min.insync.replicas, retention, and flags configs that violate durability best practice |
partition_state |
Leaders, ISR shrinkage, skew across brokers |
replay_readiness |
For a group + topic: earliest available offsets vs committed, i.e., "can we still replay what we missed?" |
incident_snapshot |
One-call bundle of all the above, timestamped — designed for pasting into a postmortem |
Quick start
pip install kafka-sentinel-mcp # (or: uv tool install)
# Run against your cluster (read-only credentials!)
KAFKA_BOOTSTRAP=localhost:9092 kafka-sentinel-mcp
Add to Claude Desktop / any MCP client:
{
"mcpServers": {
"kafka-sentinel": {
"command": "kafka-sentinel-mcp",
"env": { "KAFKA_BOOTSTRAP": "broker1:9092,broker2:9092" }
}
}
}
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: no produce, no topic/config mutation, no offset commits, no ACL ops.
- Supports SASL/SSL; credentials via env only, never logged.
- Every tool call is logged with caller context for audit.
- Recommended: run with a Kafka principal that has
Describe/ReadACLs only — the server degrades gracefully and reports what it can't see.
Status
Early. See ROADMAP.md. Issues and PRs welcome — especially war stories about what you wish an agent could have told you during an incident.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kafka_sentinel_mcp-0.1.0.tar.gz.
File metadata
- Download URL: kafka_sentinel_mcp-0.1.0.tar.gz
- Upload date:
- Size: 81.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5adb25ef99ac8b246e3dd7d879907d2baa5ac88ccca8170d5d73e5b092b6a9ad
|
|
| MD5 |
001a12e2c3845b528fac3fc7a4f68846
|
|
| BLAKE2b-256 |
e93e024736b9ab6b31271c2d30a9781437580ce48a08fc8b9572d44f9f2efc29
|
Provenance
The following attestation bundles were made for kafka_sentinel_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on sanjay-amu/kafka-sentinel-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kafka_sentinel_mcp-0.1.0.tar.gz -
Subject digest:
5adb25ef99ac8b246e3dd7d879907d2baa5ac88ccca8170d5d73e5b092b6a9ad - Sigstore transparency entry: 2209955987
- Sigstore integration time:
-
Permalink:
sanjay-amu/kafka-sentinel-mcp@c5bf74f5c8d38dd847c56447126ca642347e52fd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sanjay-amu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c5bf74f5c8d38dd847c56447126ca642347e52fd -
Trigger Event:
release
-
Statement type:
File details
Details for the file kafka_sentinel_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kafka_sentinel_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7005a4ea3db1a87c087cee60d92a67220716ed5453206e984f8cc54bdb297026
|
|
| MD5 |
9849bb668f60eed29cfe79243c12be85
|
|
| BLAKE2b-256 |
94a85fe6edab6c0195339ba03b565f815fccea51cec3bc09e49b4b99b682e501
|
Provenance
The following attestation bundles were made for kafka_sentinel_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on sanjay-amu/kafka-sentinel-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kafka_sentinel_mcp-0.1.0-py3-none-any.whl -
Subject digest:
7005a4ea3db1a87c087cee60d92a67220716ed5453206e984f8cc54bdb297026 - Sigstore transparency entry: 2209956029
- Sigstore integration time:
-
Permalink:
sanjay-amu/kafka-sentinel-mcp@c5bf74f5c8d38dd847c56447126ca642347e52fd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sanjay-amu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c5bf74f5c8d38dd847c56447126ca642347e52fd -
Trigger Event:
release
-
Statement type: