get_allowed_namespacesLABSCO SUMMARY
Approval is necessary but not sufficient — the gates run again at execution time.
The design point worth understanding is that a human's approval does not authorise a blank cheque: when the client retries execution, the gateway revalidates the grant, the digests, the validity window, a second dry run and live-state drift before the adapter writes. So a plan approved against one cluster state will not silently apply against a different one. That, plus reviewing a stored snapshot rather than model-supplied text, is what separates this from an approval prompt.
What it is
A gateway that sits between MCP clients and a Kubernetes cluster and refuses to let a model mutate anything directly. Every write starts as a plan built from a server-side dry run, gets bound to a digest, and waits for a human to approve it in a separate browser session under OAuth. Three agents — Observer, Planner, Executor — run as independent processes with their own service identities and narrow scopes, so the component that detects a problem is not the component that can fix it.
What you get
- Read-only inspection:
get_allowed_namespaces,get_k8s_status,get_k8s_events,get_pod_logs,get_k8s_resource - Diagnostics that gather the related objects for you:
get_deployment_diagnostics,get_pod_diagnostics,get_service_diagnostics - Planning, not mutating:
request_apply_manifest,request_delete_manifest,request_scale_deployment,request_restart_deployment,request_set_deployment_imageeach dry-run the change and produce a plan - Approval flow:
execute_approved_planfirst returns a browser URL, then executes once a grant exists;get_plan_statusandwait_for_plan_approvaltrack it propose_planis the Planner's entry point, and sends an approval access code to the configured operator email- The browser renders the stored review snapshot, not text the model supplied
- Guardrail and approval events are written as separate JSONL audit streams
- The gateway does not expose shell execution, kubectl passthrough, exec, attach, port-forward, Secret reads or cluster-scoped writes
Requirements
Docker Compose v2, kubectl, minikube and git for the quickstart, plus an OpenRouter API key in InfraGate__OpenRouter__ApiKey for the LLM-backed agents. make quickstart brings up a Keycloak-backed OAuth path, a PostgreSQL approval store and the published gateway image; building from source additionally needs the .NET 10 SDK. Clients connect over HTTP MCP at http://127.0.0.1:3001/mcp and authenticate with OAuth, requesting mcp:tools.read or mcp:tools.write. The project describes itself as experimental and not production-certified.
Setup effort
Build from source — git clone https://github.com/mirusser/Kubernetes-MCP-Guard.git
USE CASES
Letting an agent diagnose a broken Deployment
Give it the read-only tools and let it gather pods, ReplicaSets and events without any ability to change them.
Restarting a wedged rollout with a human in the loop
The plan is dry-run first, you approve the exact change in a browser, then execution proceeds.
Scaling in response to an incident
Propose the replica change, review the diff and policy evidence in the approval page, and apply it once.
Rolling an image forward or back
Plan the container image update, have it approved, and let the gateway re-check drift before it writes.
17 tools
Listed in project docs. Your client may show a different list.
get_k8s_statusget_k8s_eventsget_pod_logsget_k8s_resourceget_deployment_diagnosticsget_pod_diagnosticsget_service_diagnosticsrequest_apply_manifestrequest_delete_manifestrequest_scale_deploymentrequest_restart_deploymentrequest_set_deployment_imagepropose_planexecute_approved_planget_plan_statuswait_for_plan_approvalBEFORE YOU INSTALL
What to know first
Tools you get
17 tools named in the project's documentation.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/mirusser/Kubernetes-MCP-Guard.git
cd Kubernetes-MCP-Guard
export InfraGate__OpenRouter__ApiKey="<YOUR_INFRA_GATE_OPEN_ROUTER_API>"
make quickstartOr make quickstart-source to build gateway/Observer/Planner/Executor from local code.
For Codex, add the Codex block to ~/.codex/config.toml, then authenticate and start Codex.
codex mcp login infra-gateFor Claude Code, run the Claude Code command, then start claude and type /mcp to authenticate.
MCP Clients
Codex
[mcp_servers.infra-gate]
url = "http://127.0.0.1:3001/mcp"
oauth_resource = "http://127.0.0.1:3001/mcp"
scopes = ["mcp:tools.read"]Claude Code
claude mcp add-json --scope user infra-gate \
'{"type":"http","url":"http://127.0.0.1:3001/mcp","oauth":{"scopes":"mcp:tools.read"}}'