
Mcp K8s Ro
io.github.your-ko由 GitHub 账号 your-ko 发布v1.2.2更新于 Oct 30, 2026
Read-only Kubernetes MCP server: inspect resources, logs, events, and metrics. Secrets are masked.
概览
只读的 Kubernetes MCP 服务器,让助手列出和查看资源、读取 Pod 日志与事件,并查询 CPU/内存用量。
- 可以做什么
- 列出并查看集群资源,支持任意资源类型及其完整 YAML
- 通过 discovery API 列出可用资源类型,可按 API 组过滤
- 读取 Pod 日志,支持选择容器、指定行数以及查看崩溃前的日志
- 按命名空间或整个集群列出 Kubernetes 事件,按时间倒序
- 查看每个 Pod 和每个节点的 CPU 与内存用量,并给出占可分配容量的百分比
- 适用场景
- 适合值班和排障场景:让助手在不改动集群的前提下查看 Pod 状态、重启次数、日志、事件和资源压力。也适合希望每个服务器实例固定对应一个集群上下文的团队。
- 运行要求
- 以 stdio 本地进程运行,可使用预编译二进制或 Docker 镜像。需要 kubeconfig 文件,通过 KUBECONFIG 指定,默认 ~/.kube/config,并需具备目标集群的凭据。指标类工具要求集群中部署 metrics-server。macOS 二进制未签名,需要绕过 Gatekeeper。
安装
在 SourceWeft 中
- 打开 控制台中的 Mcp K8s Ro,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[Main] [golangci-lint] [Link validation]
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.
Redacted fields
Tools
Configuration
Usage with Claude
Docker (recommended)
Pinning a specific version (check the latest release ) is recommended for production use:
Binary
Download a pre-built binary from GitHub Releases:
macOS 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. [img.png]
Or build from source:
Custom kubeconfig location
If your kubeconfig is not at ~/.kube/config, set the KUBECONFIG environment variable:
Single-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:
To work with multiple clusters simultaneously, register a separate server instance per cluster in your MCP config:
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
来源:README.md,提交 d083672
工具
0版本历史
2- v1.2.2最新Oct 30, 2026
- v1.2.1Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分