kube-triage-mcp
Provides read-only Kubernetes incident triage: scans pods and nodes, diagnoses CrashLoopBackOff, OOMKilled, probe failures, image pull errors, missing Secrets/ConfigMaps, scheduling problems, and readiness issues; retrieves redacted logs and events; checks rollout status; and proposes approved restarts or scaling actions via the Kubernetes API.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
kube-triage-mcp
Let an AI agent work a Kubernetes incident with you, without handing it the keys.
An MCP server that gives Claude (or any MCP client) the first 20 minutes of an incident: what's broken, why, and what to check next. It is read-only by default, redacts secrets before anything reaches the model, and won't change anything without a human approving a written plan first.
The run above is real, from Claude Code with this server against a kind cluster running examples/broken-shop.yaml. The full transcript is below.
Why
Every incident starts with the same loop: get pods, describe, logs --previous, get events, rollout history, and then reading it all to find a cause. An agent can run that loop faster than a person can type it. But if you give a model raw kubectl, you've given it your cluster.
This server is the middle ground:
It turns raw cluster state into findings. Each one has a cause, evidence and a next step.
It holds the model to the same guardrails you'd put on a new on-call engineer.
Related MCP server: mimiops-mcp
What it catches
Failure | How it knows | What it tells you |
CrashLoopBackOff | container state + exit code | the crash logs, with secrets redacted |
OOMKilled | last termination reason + memory limit | the limit it hit and the restart count |
Liveness probe kills |
| the probe or startup timing is wrong, not the app |
Image pull failure | pull events | a tag that doesn't exist vs. the registry refusing access |
Missing Secret / ConfigMap |
| which object or key is missing |
Unschedulable | scheduler condition | not enough CPU/memory, a taint, affinity, or an unbound PVC |
Running but not ready | readiness probe events | the pod is getting no traffic; check what it depends on |
Flapping | restarts while running | look at the last crash before it's lost |
Evicted / node pressure | pod and node conditions | which node, and what kind of pressure |
The diagnosis is plain Python over the API's JSON. There's no model inside the server, so the same cluster state always gives the same findings, and every rule is unit-tested.
Safety model
The rest of the server is built around this.
Layer | What it does |
Read-only by default | Write tools refuse until the server is started with |
Least-privilege RBAC |
|
Namespace allow-list |
|
Redaction | Logs are scrubbed of passwords, bearer tokens, cloud keys, JWTs, credentials in URLs and private keys before they leave the server. |
Propose → approve → execute |
|
Kill switch |
|
Audit log | Every tool call, plan, refusal and execution is appended to a JSONL log. |
Tool annotations | Tools are marked read-only or destructive, so MCP clients can gate them in their own permission UI. |
HTTP auth | Streamable HTTP mode won't start without a bearer token, compares it in constant time, and has |
Tools
Tool | Kind | Purpose |
| read | Scans pods and nodes and ranks the findings. Start here. |
| read | Diagnosis, container states, warning events, and the crashed container's last log lines. |
| read | Redacted log tail; |
| read | Recent events, newest first. |
| read | Replica health plus revision history with the image for each revision, to spot a bad release. |
| plan | A rolling-restart plan and a token. |
| plan | A scaling plan and a token. Warns when scaling to zero. |
| write | Carries out an approved plan. |
There's also an incident prompt: give it the symptom ("checkout is 500ing") and it starts a triage session.
Quick start
Claude Code
claude mcp add kube-triage -- uvx --from git+https://github.com/qais20/kube-triage-mcp kube-triage-mcp --namespaces shopClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"kube-triage": {
"command": "uvx",
"args": ["--from", "git+https://github.com/qais20/kube-triage-mcp", "kube-triage-mcp", "--namespaces", "shop"]
}
}
}It uses your current kubeconfig context; pass --context to choose a different one.
Try it on a cluster that's broken on purpose
kind create cluster --name triage-demo
kubectl apply -f examples/broken-shop.yaml # 6 broken services, 1 healthy
# then ask your agent: "users say the shop is broken. what's wrong in demo-shop?"Run it in-cluster
To share one server with a team: deploy it once and connect clients over streamable HTTP.
kubectl create ns kube-triage
kubectl -n kube-triage create secret generic kube-triage --from-literal=token=$(openssl rand -hex 32)
kubectl apply -f deploy/The pod runs as non-root with a read-only root filesystem and all capabilities dropped. Put it behind your ingress with TLS. Clients send Authorization: Bearer <token>.
How it fits together
flowchart LR
A[Claude / any MCP client] -- stdio or HTTP + bearer --> S[kube-triage-mcp]
S --> G{Guard}
G -- scope + kill switch + tokens --> K[(Kubernetes API<br/>read-only RBAC)]
S --> D[diagnose.py<br/>pure rules]
S --> R[redact.py]
G --> L[(audit.jsonl)]
H((Human)) -. approves plan .-> ATests
uv run pytest # unit + full MCP protocol round trips against a fake cluster
uv run python scripts/e2e.py # against a real cluster running examples/broken-shop.yamlCI runs both on every push. The e2e job creates a real kind cluster, deploys the broken namespace, and fails the build unless the server:
diagnoses all six failures,
redacts the leaked password,
refuses a namespace outside its scope,
refuses a replayed approval token.
Real session
Tool calls, in order:
triage(namespace="demo-shop")
get_logs(namespace="demo-shop", pod="api-64f7777cb5-59qgg", previous=true, tail_lines=30)
explain_pod(namespace="demo-shop", pod="checkout-754684c849-qvp9c")
rollout_status(namespace="demo-shop", deployment="web")
explain_pod(namespace="demo-shop", pod="api-64f7777cb5-59qgg")
get_logs(namespace="demo-shop", pod="checkout-754684c849-qvp9c", tail_lines=30)Answer:
demo-shop has six broken workloads. Nothing has been changed yet. Worst first:
payments: the pod can't start because the Secret
payments-credsdoesn't exist in the namespace. Fix: create the Secret, or point the pod at the right Secret name.api: it crashes on boot with exit 1. The log says
FATAL: could not connect to postgres://app:…@db:5432/shop, so either nothing is answering atdb:5432or the login is rejected. Fix: check that thedbService has a working database behind it, and that the credentials api uses are correct. Separately, api writesDB_PASSWORDto its logs at startup (the triage tool hid the value). Remove that line and rotate the password.web: the image
busybox:9.9.9-does-not-existcan't be pulled because that tag doesn't exist. There's no older version of the deployment to roll back to. Fix: set the image to a tag that exists.checkout: the container is running, but nothing answers on port 8080, so the
/readycheck fails and it gets no traffic. It also writes no logs. Fix: make sure the app actually starts and listens on 8080, or correct the port in the readiness check.worker: it keeps running out of memory against its 32Mi limit and has restarted 4 times. Fix: raise the memory limit to something realistic, or find the leak.
batch: stuck in Pending because it asks for more memory than the single node has free. Fix: lower its memory request or add capacity.
I'd start with payments and api, since checkout probably depends on them. If you want me to make any of these changes, tell me and I'll show you the plan first.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
Fail-closed policy guardrails for AI agents running kubectl, terraform, helm, and argocd.
AI SRE for AWS teams: your agent reads security, cost and reliability findings, read-only by default
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables AI agents to inspect and operate a Kubernetes cluster safely, with read-only mode and namespace allowlist for mutations.1072 PyPI2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely observe and troubleshoot Kubernetes workloads, with limited recovery actions like pod deletion and Helm rollbacks, while preventing dangerous modifications.18Apache 2.0
- AlicenseBqualityCmaintenanceEnables read-only, stack-aware diagnostics for microservices on Kubernetes, turning debugging runbooks into conversational tools that investigate slow requests, changes, leaks, and in-pod conditions without exposing cluster credentials.57Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to safely interact with Kubernetes clusters through scoped, redacted tools, with credentials kept local and write operations requiring human approval.Apache 2.0