MCP K8s Ro logo

MCP K8s Ro

Inspect Kubernetes resources, logs, events, and metrics through read-only MCP tools with masked secrets.

Install MCP K8s Ro

Run the project’s own setup commands, in order.

Setup steps from the project

mcp-k8s-ro installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Add to Claude Code
    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:latest
    
  2. 2. Add to Claude Code
    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.0
    
  3. 3. Install
    curl -fsSL "https://github.com/your-ko/mcp-k8s-ro/releases/download/${VERSION}/mcp-k8s-ro-${VERSION}-${ARCH}" -o ~/.local/bin/mcp-k8s-ro
    
  4. 4. Install
    chmod +x ~/.local/bin/mcp-k8s-ro
    
  5. 5. Run
    xattr -d com.apple.quarantine ~/.local/bin/mcp-k8s-ro 2>/dev/null  # macOS only: remove Gatekeeper quarantine
    
  6. 6. Add to Claude Code
    claude mcp add --scope user --transport stdio k8s-ro ~/.local/bin/mcp-k8s-ro
    

Overview

The mcp-k8s-ro MCP server connects an MCP client to the Kubernetes cluster selected by the active kubeconfig context. It exposes read-only tools for discovering resource types, listing and describing objects, reading pod logs, reviewing events, and checking CPU and memory usage. Resource responses are reduced to useful operational fields, while secret values and selected certificate-related fields are masked. Use it for cluster investigation and on-call diagnostics when agent access must not perform mutations.

Use cases

  • Inspect pod and deployment health during an incident
  • Retrieve logs from current or previously crashed containers
  • Review recent namespace or cluster-wide Kubernetes events
  • Check pod and node CPU and memory usage
  • Compare read-only views across separately registered clusters

Key features

  • Read-only Kubernetes access over MCP
  • Resource discovery and compact resource listings
  • Masked secrets and selected certificate fields
  • Pod logs with container and previous-container support
  • Namespace and cluster event queries
  • Pod and node metrics through metrics-server

Tools7

What MCP K8s Ro lets your agent do. Expand a tool for its parameters.

Self-reported~204 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

15/15 checks healthy over the last 82d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
Last commit4d agoMost recent push to the default branch.
Tools exposed7Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP K8s Ro works

What mcp-k8s-ro does

mcp-k8s-ro gives an MCP client a read-only view of one Kubernetes cluster. It supports resource discovery, workload inspection, pod log retrieval, event review, and resource-usage queries without exposing create, update, or delete operations. When an operation would require a mutation, the server can print an equivalent kubectl command for a person to run separately.

The server is designed for operational investigation. Lists return compact, resource-specific details such as names, status, readiness, restart counts, nodes, and IP addresses instead of always returning complete Kubernetes objects. Descriptions provide the full YAML for an individual resource, with sensitive and low-value fields removed or masked before they reach the model.

How it works

The implementation is written in Go and communicates over MCP through standard input and output. It uses the kubeconfig context active when the process starts. Each response includes the active context and cluster name, providing an explicit indication of where the query was executed.

The process does not follow context changes made in another terminal. To use another cluster, stop or reload the server after selecting the desired kubeconfig context. Separate server registrations can point to different kubeconfig files when multiple clusters need to be available at the same time.

Setup and configuration

The server can run as a downloaded binary, a locally built executable, or a Docker container. Docker usage mounts the kubeconfig directory or file read-only and runs the container with standard input attached. Prebuilt binaries are available from the project's GitHub Releases, and the source can be built with make build.

KUBECONFIG selects the kubeconfig file. If it is not set, the server uses ~/.kube/config. Start the server through an MCP client using the stdio transport. Claude integrations can register either the binary or a Docker command with claude mcp add; other stdio-capable MCP clients can use their normal server configuration.

On macOS, downloaded binaries are not code-signed. Gatekeeper may require the quarantine attribute to be removed with xattr, or the application may need to be explicitly allowed in Privacy & Security settings.

Tools and capabilities

  • k8s_list_resources lists named resources of a selected type, optionally limited to a namespace. It supports common objects such as pods, deployments, and CRDs, with returned fields varying by kind.
  • k8s_describe_resource returns one resource as YAML while masking secret data.
  • k8s_list_resource_types queries Kubernetes discovery and can filter by API group.
  • k8s_get_logs retrieves pod logs, including a selected container, a requested tail length, or logs from a previously crashed container.
  • k8s_get_events lists namespace-scoped or cluster-wide events in newest-first order.
  • k8s_top_pods reports pod and per-container CPU and memory usage.
  • k8s_top_nodes reports node CPU and memory usage, including the percentage of allocatable capacity.

Limitations and notes

The server is intentionally limited to one kubeconfig context per running instance and has no runtime cluster-switching tool. Register separate instances when simultaneous cluster access is required. The pod and node metrics tools depend on Kubernetes metrics-server.

Secret data and stringData are masked. Managed fields, certificate-signing request payloads, and selected cert-manager certificate fields are also redacted to avoid sending secret material, large PEM values, or low-value metadata to the model. The read-only boundary protects against MCP-triggered mutations, but users still need appropriate Kubernetes permissions for the resources they query.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP K8s Ro

mcp-k8s-ro is an MCP server that connects an MCP client to the Kubernetes cluster selected by a kubeconfig context. Its main tools list and describe resources, discover resource types, fetch pod logs, review events, and report pod or node metrics. It is read-only, and secret values are masked.

Install it by downloading a GitHub Release binary, building it with `make build`, or running the published Docker image. Register the executable or Docker command with an MCP client over stdio. Docker setups should mount the kubeconfig path read-only.

Stop or reload the server after selecting another kubeconfig context. mcp-k8s-ro pins the active context at startup and cannot switch clusters through an MCP tool. For simultaneous access, register separate server instances with distinct kubeconfig files.

Yes, metrics-server is required for `k8s_top_pods` and `k8s_top_nodes`. The other resource, log, event, and discovery tools do not depend on those metrics queries.

It reads `~/.kube/config` by default. Set `KUBECONFIG` to use another kubeconfig file, including when registering a binary or Docker-based MCP server.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP K8s Ro AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-k8s-ro?style=directory)](https://allmcps.com/mcp/mcp-k8s-ro)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-k8s-ro"><img src="https://allmcps.com/api/badge/mcp-k8s-ro?style=directory" alt="MCP K8s Ro on AllMCPs" /></a>