KubeGuard-MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PROVIDER | No | Optional LLM reviewer provider: mock (default), groq, gemini, or anthropic. | mock |
| PYTHONUTF8 | No | Set to 1 on Windows to enable full Unicode glyphs instead of ASCII-safe output. | |
| GROQ_API_KEY | No | API key used when PROVIDER=groq. | |
| GEMINI_API_KEY | No | API key used when PROVIDER=gemini. | |
| GOOGLE_API_KEY | No | Alternative API key used when PROVIDER=gemini. | |
| KUBEGUARD_ROLE | No | Default policy role for command authorization: viewer, operator, or admin. | |
| ANTHROPIC_API_KEY | No | API key used when PROVIDER=anthropic. | |
| KUBEGUARD_LLM_MODEL | No | Overrides the default LLM model for the selected reviewer provider. | |
| KUBEGUARD_MCP_ROOTS | No | Directories that diagnose_pod bundle_path is restricted to. Defaults to the server's working directory. | |
| KUBEGUARD_LLM_TIMEOUT | No | Overrides the default LLM reviewer timeout. | |
| KUBEGUARD_LLM_BASE_URL | No | Overrides the default LLM API base URL for the selected reviewer provider. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
KubeGuard is a zero-trust Kubernetes/Docker triage server. Collect data with SAFE_READ commands only (kubectl get pod -o json, kubectl get events -o json, kubectl logs --previous, the workload YAML) and pass it to diagnose_pod. Secrets are redacted before analysis and in every response. Before suggesting any command to the user, check it with classify_command: never run BLOCKED_DESTRUCTIVE commands, and ask for explicit human approval for APPROVAL_REQUIRED ones.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| diagnose_podA | Deterministically correlate Pod JSON, Events, container logs and Deployment/Service YAML (plus optional Dockerfile, Secrets metadata, Nodes, Endpoints or docker inspect output) to diagnose OOMKilled, CrashLoopBackOff, ImagePullBackOff, CreateContainerConfigError, Unschedulable and Service port mismatches. Returns the root cause, weighted evidence, an exact unified diff patch and a policy-classified command plan. All secrets are redacted. No LLM, no network. |
| redact_logsA | Strip AWS keys, JWTs/service-account tokens, kubeconfig credentials, database connection-string passwords, .env secrets, private keys, API keys and PII from logs or manifests. Returns the clean text plus a redaction audit (counts per rule, line numbers) - never the secret values. |
| validate_manifestA | Lint Kubernetes YAML/JSON (or docker-compose) for incident-causing defects: missing memory limits, unpinned images, privileged/root containers, host mounts, plaintext credentials, Service targetPort drift, JVM heaps above the memory limit and risky RBAC. Returns findings with line numbers and a 0-100 score. |
| audit_cluster_risksA | Aggregate risk across manifests (workloads, Services, Secrets, Roles/Bindings) and a list of kubectl/docker/helm commands into one 0-100 risk score with the top risks, RBAC escalation paths, secret exposure counts and per-command zero-trust verdicts. |
| classify_commandA | Classify a kubectl/oc/docker/podman/helm command as SAFE_READ, APPROVAL_REQUIRED or BLOCKED_DESTRUCTIVE, with reasons and a risk score, and say whether the given role may run it. Pipes, chaining, command substitution and non-allowlisted binaries are blocked. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| triage_pod | Collect read-only evidence for a failing pod and diagnose it with KubeGuard |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| zero-trust-policy | How KubeGuard classifies kubectl/docker/helm commands |
| oom_killed | A Spring Boot service was upgraded to v3.4.1 (new in-memory settlement batch). Pods restart with exit code 137 roughly every 3 minutes and the on-call sees CrashLoopBackOff. |
| crashloop_secret_leak | The platform team rotated the orders database password at 13:45. Since then every orders-api pod exits with code 1 a second after start - and the startup logs print the full configuration, including database and AWS credentials. |
| service_port_mismatch | After the Node.js 22 migration the checkout frontend listens on port 3000. Pods are Running and Ready, probes pass, but the ingress returns 502 Bad Gateway for 100% of checkout traffic. |
| image_pull_backoff | CI moved images from ghcr.io to the internal registry registry.acme.internal:5000. The new ingest-worker rollout never starts: pods stay Pending with ImagePullBackOff. The CI job log also dumped a raw kubeconfig. |
TDQS
Scored across 5 tools
The five tools have distinct primary actions: pod diagnosis, log redaction, manifest validation, cluster risk aggregation, and command classification. Some overlap remains because audit_cluster_risks also emits per-command verdicts and validate_manifest overlaps with its manifest risk scoring, but descriptions make the intended selection clear.
All tool names follow a consistent snake_case verb_noun pattern: diagnose_pod, redact_logs, validate_manifest, audit_cluster_risks, classify_command. No mixed conventions or ambiguous naming styles are present.
Five tools is well within the appropriate range for this server and each maps to a clear guard/diagnostic capability. There are no obvious filler tools or missing-count concerns.
The set covers diagnosis, redaction, manifest validation, cluster risk auditing, and command safety for Kubernetes operations. Minor gaps include no general resource inspection or remediation/apply step beyond returning patches and command plans, but core workflows are covered.