MCP.so
登录

Kubernetes Read Only MCP Server

@your-ko

关于 Kubernetes Read Only MCP Server

K8s read-only MCP server

基本信息

分类

云与基础设施

许可证

MIT

运行时

go

传输方式

stdio

发布者

your-ko

提交者

yourik

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "k8s": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "${HOME}/.kube:/root/.kube:ro",
        "ghcr.io/your-ko/mcp-k8s-ro:latest"
      ]
    }
  }
}

工具

7

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 `--previous` for crashed containers.

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.

概览

What is Kubernetes Read Only MCP Server?

A read-only MCP server that gives Claude access to Kubernetes clusters. Built in Go, it communicates over stdio using the MCP protocol and is designed for safe, production‑grade debugging.

How to use Kubernetes Read Only MCP Server?

Build the binary with make build or pull the Docker image from ghcr.io/your-ko/mcp-k8s-ro. Add it as a stdio MCP server in your Claude Desktop or CLI configuration, pointing to a kubeconfig file via the KUBECONFIG environment variable.

Key features of Kubernetes Read Only MCP Server

  • Read‑only operations: get, describe, logs, top only – no mutations.
  • Secret values are masked before being sent to the model.
  • Token‑efficient responses include only relevant fields, not raw API objects.
  • Every response includes the active context and cluster name.
  • Locks to the active kubeconfig context at startup; no runtime context switching.
  • Runs as a local binary or Docker container with no extra infrastructure.

Use cases of Kubernetes Read Only MCP Server

  • Safe on‑call debugging: Claude can inspect workloads without risking accidental mutations.
  • Quickly list and describe resources (pods, deployments, CRDs) across namespaces.
  • Fetch pod logs, including crashed container logs with --previous.
  • View Kubernetes events sorted by most recent.
  • Monitor CPU and memory usage per pod or node (requires metrics‑server).

FAQ from Kubernetes Read Only MCP Server

Is the server truly read‑only?

Yes – all tools are restricted to get, describe, logs, and top operations. If a mutating action is needed, the server prints the equivalent kubectl command for manual execution.

Are my secrets safe?

Secret values (data, stringData) are masked before being sent to the model, preventing leaks from misconfiguration or prompt injection.

Can I switch clusters at runtime?

No – the server locks to the active kubeconfig context at startup. To target a different cluster, stop the server, switch context, and restart.

How do I work with multiple clusters?

Register a separate server instance per cluster in your MCP configuration. Each instance sees only its own cluster and Claude addresses them by name.

What are the runtime dependencies?

A valid kubeconfig file (default ~/.kube/config). The k8s_top_pods and k8s_top_nodes tools additionally require the metrics‑server to be installed in the cluster.

评论

云与基础设施 分类下的更多 MCP 服务器