mcp-k8s-ro
Provides read-only access to Kubernetes clusters, allowing listing, describing, and monitoring resources such as pods, deployments, and nodes, with secret masking and context awareness.
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., "@mcp-k8s-rolist pods in namespace production"
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.
mcp-k8s-ro
A read-only MCP server that gives Claude access to Kubernetes clusters. Built in Go, it communicates over stdio using the MCP protocol.
Design
Read-only — only
get,describe,logs, andtopstyle operations. No create, update, or delete. If a mutating operation is needed, the server prints the equivalentkubectlcommand for you to run manually. Safe to use while on-call at night: Claude can never accidentally mutate your cluster, even under prompt fatigue.Secret-safe — secret values are masked before being sent to the model, so your secrets cannot leak due to misconfiguration or prompt injection.
Token-efficient — responses include only relevant fields (name, status, restarts, etc.) rather than raw Kubernetes API objects, keeping context usage low.
Cluster-aware — every response includes the active context and cluster name, so Claude always knows which cluster it is talking to.
Context-pinned — the server locks to the active kubeconfig context at startup. Switching contexts in another terminal has no effect on the running server.
No extra infra — runs as a local binary or Docker container, connects to whatever kubeconfig context is active at startup.
Related MCP server: kubernetes-mcp
Redacted fields
Object/Field | Reason |
Secret.data | Secret leak prevention |
Secret.stringData | Secret leak prevention |
CertificateSigningRequest.spec.request | Large base64 PEM blob, no diagnostic value, saves tokens |
Certificate (cert-manager) .spec.keystores | Cert chain PEM blobs, no diagnostic value, saves tokens |
Certificate (cert-manager) status.conditions[].message | Cert chain PEM blobs, no diagnostic value, saves tokens |
*.managedFields | No diagnostic value, saves tokens |
Tools
Tool | Description |
| List any resource type by name — pods, deployments, CRDs, etc. Accepts optional namespace filter. Returns name, status, readiness, restarts, node, IP, and more depending on resource kind. |
| Return the full YAML of a single resource. Secret data is masked. |
| List all available resource types via the discovery API. Accepts optional API group filter. |
| Fetch pod logs. Supports container selector, tail lines, and |
| List Kubernetes events for a namespace or the whole cluster, sorted by most recent. |
| CPU and memory usage per pod, with per-container breakdown. Requires metrics-server. |
| CPU and memory usage per node, with percentage of allocatable capacity. Requires metrics-server. |
Configuration
Environment variable | Default | Description |
|
| Path to kubeconfig file |
Usage with Claude
Docker (recommended)
claude mcp add --scope user --transport stdio k8s-ro \
-- docker run --rm -i -v ~/.kube:/home/nonroot/.kube:ro ghcr.io/your-ko/mcp-k8s-ro:latestPinning a specific version (check the latest release ) is recommended for production use:
claude mcp add --scope user --transport stdio k8s-ro \
-- docker run --rm -i -v ~/.kube:/home/nonroot/.kube:ro ghcr.io/your-ko/mcp-k8s-ro:1.1.0Binary
Download a pre-built binary from GitHub Releases:
# macOS Apple Silicon — change ARCH for other platforms: darwin-amd64, linux-amd64, linux-arm64
ARCH=darwin-arm64
VERSION=$(curl -fsSL https://api.github.com/repos/your-ko/mcp-k8s-ro/releases/latest | grep tag_name | cut -d'"' -f4)
curl -fsSL "https://github.com/your-ko/mcp-k8s-ro/releases/download/${VERSION}/mcp-k8s-ro-${VERSION}-${ARCH}" -o ~/.local/bin/mcp-k8s-ro
chmod +x ~/.local/bin/mcp-k8s-ro
xattr -d com.apple.quarantine ~/.local/bin/mcp-k8s-ro 2>/dev/null # macOS only: remove Gatekeeper quarantine
claude mcp add --scope user --transport stdio k8s-ro ~/.local/bin/mcp-k8s-romacOS Gatekeeper: The binary is not code-signed, so macOS will block it. The
xattrcommand above removes the quarantine flag. Alternatively, go to System Settings → Privacy & Security and click "Allow Anyway" after the first blocked attempt.
Or build from source:
make build
claude mcp add --scope user --transport stdio k8s-ro ./bin/mcp-k8s-roCustom kubeconfig location
If your kubeconfig is not at ~/.kube/config, set the KUBECONFIG environment variable:
# Binary
claude mcp add --scope user --transport stdio -e KUBECONFIG=/path/to/kubeconfig k8s-ro ~/.local/bin/mcp-k8s-ro
# Docker
claude mcp add --scope user --transport stdio k8s-ro \
-- docker run --rm -i -e KUBECONFIG=/config/kubeconfig -v /path/to/kubeconfig:/config/kubeconfig:ro ghcr.io/your-ko/mcp-k8s-ro:latestSingle-cluster design
The server intentionally operates on one kubeconfig context and provides no tool to switch clusters at runtime. The reasons are:
Prompt injection isolation — a malicious value in one cluster's resources (e.g. a pod annotation) cannot instruct Claude to pivot to a different cluster, including production.
Explicit audit boundary — every tool response includes the context and cluster name, so there is never ambiguity about which cluster was queried.
To point the server at a different cluster, stop the server, switch context, and restart:
kubectl config use-context my-other-cluster
# then restart the MCP server / reload Claude DesktopTo work with multiple clusters simultaneously, register a separate server instance per cluster in your MCP config:
{
"mcpServers": {
"k8s-staging": {
"type": "stdio",
"command": "/path/to/bin/mcp-k8s-ro",
"env": { "KUBECONFIG": "/path/to/.kube/config" }
},
"k8s-prod": {
"type": "stdio",
"command": "/path/to/bin/mcp-k8s-ro",
"env": { "KUBECONFIG": "/path/to/.kube/config-prod" }
}
}
}Claude will address each server by name and each instance only ever sees its own cluster.
MCP registry
This server is published on registry.modelcontextprotocol.io
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.
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/your-ko/mcp-k8s-ro'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
