k8s-ops-mcp-agent
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@k8s-ops-mcp-agentwhat's the status of checkout-api in staging?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
k8s-ops-mcp-agent
An AI SRE copilot for Kubernetes, built on the Model Context Protocol (MCP). It lets an LLM (Claude, or any MCP-compatible agent) inspect the health of a cluster and — only with explicit human confirmation — restart or scale deployments.
Built to explore how LLM agents can be given real operational tools without becoming a liability: read access is open, write access is gated.
Why this exists
Incident response burns a lot of engineer time on repetitive diagnosis: "which pods are crash-looping, what do the logs say, what changed recently." This project gives an LLM agent the tools to answer that in seconds, while keeping a human explicitly in the loop for anything destructive.
Related MCP server: AIOps MCP
Architecture
┌─────────────────┐ MCP (stdio) ┌──────────────────────┐ Kubernetes API
│ Claude Desktop │ ───────────────────────▶ │ k8s-ops-mcp-agent │ ───────────────────────▶ Cluster
│ (or any MCP │ ◀─────────────────────── │ (this repo) │ ◀─────────────────────── (kind / EKS / etc.)
│ client) │ tool calls/results └──────────────────────┘
└─────────────────┘The agent process talks to the cluster using the official Kubernetes Python
client and a standard kubeconfig — the same credentials you'd use with
kubectl. It never embeds cluster credentials in the LLM prompt.
Tools exposed
Tool | Type | Description |
| read | Pod status, restart counts, age for a namespace |
| read | Tail logs for a specific pod |
| read | Recent Kubernetes events (crash loops, image pull errors, scheduling failures) |
| read | Desired vs ready vs available replicas |
| write | Rolling restart — requires |
| write | Scale replicas (0-50 range enforced) — requires |
Safety design
This is the part I care most about — an agent with unrestricted write access to production infrastructure is a bad idea. So:
Read tools require no confirmation — an agent should be free to look around and diagnose.
Write tools refuse to execute unless called with
confirm=True. The intended flow is: agent proposes an action → human says "do it" → agent calls the tool again with confirmation. This is enforced in code, not just in the prompt, so it can't be bypassed by prompt injection from logs or pod output the agent reads.Replica counts are hard-capped (0-50) regardless of confirmation, as a last line of defense against a runaway agent loop.
Every tool call is logged with timestamp and arguments for auditability.
Actions are always scoped to a single namespace passed explicitly by the caller — there is no cluster-wide destructive tool.
See server/k8s_ops_server.py and the tests in
tests/test_guardrails.py, which specifically
verify the refusal logic (six passing tests covering confirm/no-confirm and
out-of-range scaling).
Setup
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# Point at a real or local cluster (e.g. kind/minikube)
kind create cluster --name ops-demo
# Run the server directly (for local testing via MCP inspector)
python server/k8s_ops_server.pyTo use it from Claude Desktop, add an entry to your MCP config — see
docs/claude_desktop_config.example.json.
Running the tests
python -m unittest tests/test_guardrails.py -vNo cluster required — the Kubernetes client is mocked so the guardrail logic can be verified in isolation (and in CI).
Example session
> "What's going on with checkout-api in staging?"
[agent calls get_deployment_status, get_pod_logs, get_events]
The checkout-api deployment has 1/3 pods ready. One pod is in
CrashLoopBackOff — the logs show a database connection timeout at startup.
Events confirm 4 restarts in the last 10 minutes. This looks like the DB
hasn't finished migrating. Want me to restart the deployment once the
migration job completes, or scale down to reduce restart pressure?
> "Yes, restart it."
[agent calls restart_deployment(confirm=True)]
Restart triggered for checkout-api in staging at 2026-07-20T14:32:01Z.
Roadmap / possible extensions
Slack integration so the confirmation step happens in a thread
Read-only cost/right-sizing recommendations tool (via AWS Compute Optimizer)
Multi-cluster support with per-cluster kubeconfig context switching
Stack
Python · Kubernetes Python client · Model Context Protocol (MCP) · unittest
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceAI-native control plane for Kubernetes and GitOps. Provides 30+ tools for service deployment, database provisioning, and log management via natural language.11MIT
- Alicense-qualityDmaintenanceA multi-agent MCP server that turns LLMs into an autonomous incident-response copilot, enabling rapid investigation, correlation, and remediation of production incidents.MIT
- Alicense-qualityCmaintenanceAn AI-DevOps MCP server that gives LLMs read-only-by-default access to Kubernetes clusters, Prometheus metrics, and GitHub Actions, enabling natural language queries about infrastructure status and safe write operations with previews.MIT
- Flicense-qualityCmaintenanceAutonomous AI agent for Kubernetes triage and infrastructure management using natural language.
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Sovereign Agent OS — Persistent Memory, Governance & Compliance for AI Agents.
AI agent run monitoring with incident replay and SLA receipts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/takoumenecarel-gh/k8s-ops-mcp-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server