# k8s-mcp-server — Kubernetes + Helm MCP Tools > Build k8s-mcp-server in Go to expose Kubernetes tools over MCP with stdio/SSE/streamable-http modes and an optional read-only flag. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```bash git clone https://github.com/reza-gholizade/k8s-mcp-server.git && cd k8s-mcp-server go mod download go build -o k8s-mcp-server main.go ./k8s-mcp-server --mode stdio --read-only ``` ## Intro Use k8s-mcp-server to connect an MCP-capable assistant to Kubernetes and Helm operations with a clear, flag-driven runtime mode. Build k8s-mcp-server in Go to expose Kubernetes tools over MCP with stdio/SSE/streamable-http modes and an optional read-only flag. **Best for:** platform engineers who want MCP-based Kubernetes tooling with explicit run modes for CLI and web integrations **Works with:** Go, kubeconfig or env-based cluster auth, MCP clients (stdio) or web transports (SSE/streamable-http) **Setup time:** ~10–20 minutes (clone + go build + first config) ### Key facts (verified) - GitHub: 155 stars · 37 forks · pushed 2026-05-11. - License: MIT · owner avatar + repo URL verified via GitHub API. - Entrypoint (README-backed): `go build -o k8s-mcp-server main.go`. ## Main - Prefer `--read-only` for first runs; only enable write operations after you validate namespace scoping and auth paths. - Use stdio mode for desktop clients and SSE/HTTP modes for web deployments; keep configs separate per environment. - Keep kubeconfig and tokens out of agent prompts; pass them via env vars and mount paths as documented. ### README excerpt (source) ```text # Kubernetes MCP Server A Kubernetes Model Context Protocol (MCP) server that provides tools for interacting with Kubernetes clusters through a standardized interface. ## Hosted deployment A hosted deployment is available on [Fronteir AI](https://fronteir.ai/mcp/reza-gholizade-k8s-mcp-server). ## Features - **API Resource Discovery**: Get all available API resources in your Kubernetes cluster. - **Resource Listing**: List resources of any type with optional namespace and label filtering. - **Resource Details**: Get detailed information about specific Kubernetes resources. - **Resource Description**: Get comprehensive descriptions of Kubernetes resources, similar to `kubectl describe`. - **Pod Logs**: Retrieve logs from specific pods (optionally from a specific container, or all containers if unspecified). - **Node Metrics**: Get resource usage metrics for specific nodes. - **Pod Metrics**: Get CPU and Memory metrics for specific pods. - **Event Listing**: List events within a namespace or for a specific resource. - **Resource Creation/Updating**: Create new Kubernetes resources or update existing ones from a YAML or JSON manifest. ``` ### FAQ **Q: What modes are supported?** A: The README documents stdio, SSE, and streamable-http modes with flags and env vars. **Q: Can I keep it read-only?** A: Yes—use the `--read-only` flag as shown in the docs/config examples. **Q: How should I authenticate?** A: Start with kubeconfig via env or mounted paths; avoid pasting tokens into chats. ## Source & Thanks > Source: https://github.com/reza-gholizade/k8s-mcp-server > License: MIT > GitHub: 155 stars · 37 forks · pushed 2026-05-11 --- ## 快速使用 ```bash git clone https://github.com/reza-gholizade/k8s-mcp-server.git && cd k8s-mcp-server go mod download go build -o k8s-mcp-server main.go ./k8s-mcp-server --mode stdio --read-only ``` ## 简介 用 k8s-mcp-server 把支持 MCP 的助手接入 Kubernetes/Helm 操作,并通过参数明确运行模式与权限边界。 k8s-mcp-server 用 Go 构建并以 MCP 暴露 Kubernetes 工具:支持 stdio/SSE/streamable-http 多种模式,并可用只读选项降低风险,适合把集群操作标准化为工具调用。 **适合谁:** 想要把 Kubernetes 工具以 MCP 方式暴露,并需要明确运行模式(CLI/Web)的平台工程师 **可搭配:** Go、kubeconfig 或环境变量方式鉴权集群、MCP 客户端(stdio)或 Web 传输(SSE/streamable-http) **上手时间:** 约 10–20 分钟(clone + go build + 首次配置) ### 关键事实(已验证) - GitHub:155 stars · 37 forks · 最近更新 2026-05-11。 - 许可证:MIT(GitHub API 已验证仓库 URL / 头像等基础信息)。 - 入口命令(基于 README):`go build -o k8s-mcp-server main.go`。 ## 主要内容 - 首次运行建议加 `--read-only`;确认鉴权与命名空间范围后再逐步放开写能力。 - 桌面客户端用 stdio,Web 部署用 SSE/HTTP;不同环境分开配置,避免混用。 - kubeconfig 与 token 不要进 prompt;按文档用环境变量与挂载路径传递。 ### README 摘录(来源) ```text # Kubernetes MCP Server A Kubernetes Model Context Protocol (MCP) server that provides tools for interacting with Kubernetes clusters through a standardized interface. ## Hosted deployment A hosted deployment is available on [Fronteir AI](https://fronteir.ai/mcp/reza-gholizade-k8s-mcp-server). ## Features - **API Resource Discovery**: Get all available API resources in your Kubernetes cluster. - **Resource Listing**: List resources of any type with optional namespace and label filtering. - **Resource Details**: Get detailed information about specific Kubernetes resources. - **Resource Description**: Get comprehensive descriptions of Kubernetes resources, similar to `kubectl describe`. - **Pod Logs**: Retrieve logs from specific pods (optionally from a specific container, or all containers if unspecified). - **Node Metrics**: Get resource usage metrics for specific nodes. - **Pod Metrics**: Get CPU and Memory metrics for specific pods. - **Event Listing**: List events within a namespace or for a specific resource. - **Resource Creation/Updating**: Create new Kubernetes resources or update existing ones from a YAML or JSON manifest. ``` ### FAQ **Q: 支持哪些模式?** A: README 说明了 stdio、SSE、streamable-http 三种模式及参数/环境变量。 **Q: 能只读运行吗?** A: 可以;按文档使用 `--read-only`。 **Q: 怎么做鉴权更合适?** A: 优先用 kubeconfig 的环境变量/挂载方式,避免把 token 直接贴进聊天。 ## 来源与感谢 > 来源:https://github.com/reza-gholizade/k8s-mcp-server > 许可证:MIT > GitHub:155 stars · 37 forks · 最近更新 2026-05-11 --- Source: https://tokrepo.com/en/workflows/k8s-mcp-server-kubernetes-helm-mcp-tools Author: MCP Hub