k8s-mcp-server
k8s-mcp-server
Production-ready Kubernetes diagnostics and cluster observability MCP server for AI agents.
What is this?
k8s-mcp-server is a Model Context Protocol (MCP) server providing automated, read-only diagnostic tools for inspecting Kubernetes clusters. It allows AI agents to troubleshoot pod crashes, inspect ingress routes, and analyze cluster-wide warning events safely.
Available Tools
Tool | Category | Description |
| Infrastructure | Lists nodes, readiness states, roles, and kubelet versions. |
| Workloads | Detects abnormal pod phases, restart loops, and CrashLoopBackOffs. |
| Observability | Retrieves container stdout/stderr logs with tail limits and crash inspection. |
| Diagnostics | Aggregates FailedScheduling, FailedMount, and BackOff warning events. |
| Networking | Audits HTTP routing rules, host headers, and TLS certificates. |
Quick Start
Prerequisites
Python 3.11+
Active Kubernetes cluster access (
~/.kube/configor in-cluster ServiceAccount)Read-only RBAC privileges (
get,liston core and networking API groups)
Run Locally
git clone https://github.com/akkireddy-challa/k8s-mcp-server.git
cd k8s-mcp-server
pip install -r requirements.txt
python server.pyClaude Desktop Configuration
Add to claude_desktop_config.json:
{
"mcpServers": {
"kubernetes": {
"command": "python",
"args": ["/path/to/k8s-mcp-server/server.py"],
"env": {
"KUBECONFIG": "/Users/<username>/.kube/config"
}
}
}
}Security Model
Strictly Read-Only: Enforces GET and LIST operations only.
Zero-Secret Exposure: Secrets and config maps are never inspected or surfaced to LLM context.
Flexible Auth: Supports standard
~/.kube/configcontext or in-cluster pod ServiceAccounts.
License
MIT License. See LICENSE for details.
Built by Akkireddy Challa — Platform Engineer at Telia, Stockholm.
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/akkireddy-challa/k8s-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server