get_namespacesLABSCO SUMMARY
Read-only by construction, which is why it is safe to point at a real cluster.
The question set is the interesting part: pending pods come back with the reason, restart counts come with a threshold, and orphaned resources are surfaced as a category — these are the things you would otherwise assemble from several kubectl invocations. Because it uses your existing kubeconfig or the in-cluster service account, its reach is exactly whatever RBAC already allows that identity.
What it is
A Python server that reads a Kubernetes cluster and answers diagnostic questions. Every operation is a read; there is no apply, delete or scale, so an agent can explore a production cluster without the risk that usually comes with that access.
What you get
get_namespaceslists namespaces;list_nodesandnode_capacitycover node status and remaining capacitylist_podslists pods, optionally within one namespacefailed_podsreturns pods in Failed or Error state, andpending_podsreturns pending pods together with the reason they are stuckhigh_restart_podsfinds pods above a restart threshold, defaulting to 5list_deployments,list_servicesandlist_eventscover the rest of the everyday objectsorphaned_resourcesfinds resources with no owner reference — the ones nobody remembers creatingget_resource_yamlreturns the full YAML for a named resource
Requirements
Access to a cluster, which it finds by itself: your kubeconfig at ~/.kube/config, or the service account token when it runs inside a pod. No extra configuration if either is in place. Python 3.8+ and uv — clone the repository, uv venv and uv sync, then point your client at uv --directory <YOUR_PATH_TO_PARENT_FOLDER_K8S_MCP> run server.py. The Python package is k8s-mcp, version 0.1.0.
Setup effort
Build from source — git clone https://github.com/vlttnv/k8s-mcp.git
USE CASES
Finding out why a deployment is unhealthy
Pull the failing and pending pods, with the reasons, instead of running kubectl describe repeatedly.
Catching a crash loop early
List pods whose restart counts have climbed past a threshold you choose.
Checking whether the cluster has room
Read node status and remaining capacity before scheduling more work.
Reading a resource's real configuration
Fetch the YAML for one service or deployment and reason about it in the conversation.
Cleaning up after old work
List resources with no owner reference and decide what can go.
12 tools
Listed in project docs. Your client may show a different list.
list_podsfailed_podspending_podshigh_restart_podslist_nodesnode_capacitylist_deploymentslist_serviceslist_eventsorphaned_resourcesget_resource_yamlBEFORE YOU INSTALL
What to know first
Tools you get
12 tools named in the project's documentation.
Requires
- uv on PATH
- Python 3.8+
- Access to a Kubernetes cluster (via kubeconfig or in-cluster configuration)
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
git clone https://github.com/vlttnv/k8s-mcp.git
cd k8s-mcp
uv venv
source .venv/bin/activate
uv syncMCP Clients
Claude Desktop
{
"mcpServers": {
"k8s-mcp": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_PARENT_FOLDER_K8S_MCP>",
"run",
"server.py"
]
}
}
}