
K8s MCP Server (Go)
io.github.kaneg由 GitHub 帳號 kaneg 發布v0.4.6更新於 Oct 24, 2026
Safe Kubernetes access for AI agents via MCP. Read-only by default, with explicit permission modes.
概覽
在本機執行的 Kubernetes MCP 伺服器,預設唯讀,讓 AI 助理安全檢視叢集,並可選用 readwrite 或 dangerous 權限模式。
- 可以做什麼
- 檢視 Pod、Deployment、StatefulSet、Service、ConfigMap、Secret、PVC、Ingress、Job、節點與命名空間,含詳細資料與日誌
- 讀取事件、叢集概況,以及節點與 Pod 的即時 CPU/記憶體用量
- 將應用程式或工作負載名稱解析為對應資源並建議後續工具
- readwrite 模式下:擴縮、重啟、修補、更新映像、建立命名空間、查看推出狀態
- dangerous 模式下:刪除 Pod、Deployment、StatefulSet、DaemonSet、命名空間或其他資源,並套用任意 YAML
- 適用情境
- 適合讓助理協助診斷 Kubernetes 問題,例如異常 Pod、記憶體用量過高、警告事件、推出失敗,而不必交出不受限制的 kubectl。只在需要受控維運操作時使用 readwrite,只有確實需要完整控制叢集時才用 dangerous。
- 執行需求
- 以本機程序在使用者電腦上執行(僅桌面端),透過對應平台的 MCPB 安裝包或原生執行檔安裝,不需 Docker 或 Go。需要能存取 Kubernetes 叢集:kubeconfig 檔案、KUBECONFIG 環境變數或叢集內 ServiceAccount 憑證。權限模式在啟動時指定。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 K8s MCP Server (Go),將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
k8s-mcp-go
Safe, read-only-by-default Kubernetes access for AI agents.
A Kubernetes MCP server that lets AI assistants inspect your cluster safely — without giving them unrestricted kubectl.
[GitHub release] [License] [Go] [MCP]
What makes it different
- Read-only by default: useful for diagnosis without giving AI permission to mutate the cluster.
- Explicit permission modes: choose
readonly,readwrite, ordangerousbefore the assistant starts. - No Docker required: install via MCPB bundles or a single native binary.
- Kubernetes-native visibility: inspect pods, deployments, services, logs, events, nodes, and live CPU/memory usage.
- Registry-ready distribution: published as
io.github.kaneg/k8s-mcp-gofor MCP Registry consumers and packaged clients.
Distribution
- MCP Registry: published as
io.github.kaneg/k8s-mcp-go. - PulseMCP: indexed from the MCP ecosystem with the official
server.json. - Claude Code Marketplaces: listed with MCPB installation metadata.
Why
Most AI agents can use Kubernetes tools. The real problem is how to stop them from changing the wrong thing.
Giving an AI raw kubectl access is risky. Even a capable model can:
- delete the wrong resource
- restart the wrong workload
- apply a dangerous change
- turn a debugging session into a production incident
k8s-mcp-go gives AI agents a guardrailed interface to Kubernetes instead of unrestricted shell access.
It is built for the real-world question:
How can I let AI help with Kubernetes, without letting it break my cluster?
Permission Modes
You choose the boundary up front:
readonly (default)
For diagnosis, inspection, and safe exploration.
AI can do things like:
- list pods, deployments, services, nodes, and namespaces
- read logs and events
- inspect cluster state
- check resource usage
It cannot modify workloads or delete resources.
readwrite
For controlled operational workflows.
AI can do things like:
- scale deployments
- restart deployments
- restart statefulsets
- update images
- patch deployments
- create namespaces
It still cannot perform the most destructive operations.
dangerous
Full access.
Use this only when you explicitly want AI to be able to:
- delete resources
- delete namespaces
- apply arbitrary YAML
If you are unsure, use readonly.
Quick Start
Option 1: MCPB Install (Recommended)
Download the .mcpb bundle for your platform from Releases. MCPB-compatible clients (Claude Desktop, Cursor, etc.) can install it directly — no Docker, no Go, no manual setup.
Option 2: Manual Binary Install
Grab the binary archive from Releases and extract it:
Then add it to your MCP client.
Claude Desktop (claude_desktop_config.json):
Cursor (.cursor/mcp.json):
Restart your client and start asking questions about your cluster.
Example prompts
Once installed, ask your AI assistant things like:
- "Show me unhealthy pods in all namespaces."
- "Which pods are using the most memory?"
- "Summarize recent warning events."
- "Inspect this deployment and explain why it is not ready."
- "Check rollout status for this deployment."
In readonly mode, the assistant can investigate but cannot change the cluster.
Why not just use kubectl?
Because the problem is not whether AI can talk to Kubernetes. The problem is whether it can do so safely.
kubectl is powerful, but it does not give you a product-level permission mode for AI behavior.
With k8s-mcp-go, you decide whether the assistant can:
- inspect only
- perform limited operational actions
- or get full control
The permission boundary is the product.
Available Tools (35 total)
Tools are grouped by permission level.
Names start with an action verb such as get, list, or delete; top_nodes
and top_pods retain Kubernetes' established kubectl top terminology.
Readonly (24)
Readwrite (7)
Dangerous (7)
Prefer the dedicated delete tools above when one exists. Use delete_resource
as the fallback for other kinds. It resolves namespaced versus cluster-scoped
resources through Kubernetes discovery.
Kubernetes Configuration
Configuration is selected in this order:
- The file specified by
KUBECONFIG, when set. - The Pod's in-cluster ServiceAccount configuration.
~/.kube/configwhen running outside a cluster.
An explicit KUBECONFIG is authoritative. If it cannot be loaded, the server
returns an error instead of silently switching to the Pod's ServiceAccount.
In-cluster configuration uses Kubernetes' mounted token file so projected
ServiceAccount token rotation continues to work without copying tokens into a
kubeconfig.
Environment Variables
Build from Source
License
MIT
來源:README.md,提交 889ed38
工具
0版本歷史
1- v0.4.6最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分

