rohitg00/kubectl-mcp-server
Stateless Kubernetes MCP server for AI-assisted troubleshooting and Helm operations
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
kubectl-mcp-server is a Python MCP adapter between an AI client and Kubernetes. The Python entry point is kubectl_mcp_tool.mcp_server; the server uses fastmcp>=4.1,<5, and the dependency manifest also includes Pydantic, FastAPI, Uvicorn, Starlette, and the Kubernetes Python client. The core toolset wraps kubectl operations, and a separate toolset exposes Helm v3. Tool calls accept a Kubernetes context, so the client can select a cluster without changing the shared current context.
v2.0.0 supports stdio for client-launched processes and stateless Streamable HTTP under MCP 2026-07-28 for shared deployments, with negotiation for older clients. HTTP replicas do not need to share MCP session state, but they still need consistent tool configuration, authorization policy, and cluster access. Extensions are grouped into opt-in toolsets. With --tool-search, enabled tools beyond the defaults can be discovered through search_tools and invoked through call_tool; the same read-only, scope, and redaction controls apply.
Key Capabilities & Differentiators
The default registry contains 26 tools across core and helm, down from 281 in the previous default. Generic get and describe operations cover built-in and custom resource kinds; logs and pod diagnostics support incident triage. The same default surface includes operations such as apply, patch, delete, and exec, so a smaller catalog does not mean read-only access. Helm v3 tools cover release lifecycle operations alongside resource inspection.
There are also 14 workflow prompts, 8 browsable resources, and 6 resource templates. Clients can browse contexts, namespaces, and cluster metadata or fetch named workload manifests; the Secret template masks data. Operators can opt into specific integrations such as GitOps, cert-manager, Velero, KEDA, or Cilium, and detect_ecosystem identifies installed operators and corresponding toolsets. Workflow prompts guide the assistant; they are not a substitute for reviewing a diagnosis or proposed change.
Trade-offs & Limitations
Compared with direct kubectl and Helm, the MCP layer is useful when an assistant needs to correlate events, logs, manifests, and releases without repeated manual handoffs. It adds a client integration and an authorization layer to maintain, and model-selected actions are less predictable than a fixed CI step. Start with the default toolsets to limit tool-schema overhead, then add only what operators need. For work centered on a single controller, evaluate alternatives such as Argo CD MCP, Flux Operator MCP, or Kyverno MCP rather than assuming the general-purpose adapter covers the same depth.
Treat OAuth scopes, read-only mode, per-call confirmation, Secret redaction, and flag-injection guards as defense in depth, not substitutes for Kubernetes RBAC. Start with narrowly scoped Kubernetes credentials, require explicit context selection for sensitive work, and review both the enabled tools and the data returned to the client. A read-only kubeconfig mount prevents writes to the mounted files, not writes to the cluster. Secret redaction also does not make logs or arbitrary resource output safe to share.
Hardware & Deployment Guide
For local stdio, run through npx with Node.js 18+, or install with pip or uvx using the documented Python 3.10+ baseline. Non-container setups need configured kubectl and access to a Kubernetes cluster; ensure Helm is available if you expose Helm tools. The Docker build uses Python 3.13 slim, fetches kubectl v1.37.1 and Helm v3.22.1, and verifies kubectl's SHA-256. The image runs as UID 10001 with HOME=/home/mcp; for local credentials, make sure that UID can read the kubeconfig mounted at /home/mcp/.kube:ro and that any files or credential helpers it references are available inside the container.
For shared HTTP, configure OAuth rather than relying on the explicit unauthenticated override, which is suitable only for deliberate loopback testing. Helm charts and deployment files provide an in-cluster path; use a dedicated, scoped service account there. Upgrade from v1.24.0 before rebuilding: its open-ended fastmcp>=3.0.0b1 constraint can resolve to FastMCP 4 and fail at import, whereas v2.0.0 specifies fastmcp>=4.1,<5, adopts stateless transport, and tightens network exposure.
Platform and SRE teams that want assistants to correlate Kubernetes logs, events, manifests, and Helm releases across explicitly selected contexts, starting with a read-only rollout.
You need deterministic CI execution, deep coverage of a single controller, or cannot put least-privilege cluster credentials and a review of returned data in place.
Quick Start & Installation
# Run directly without installation - works instantly! npx -y kubectl-mcp-server # Or install globally for faster startup npm install -g kubectl-mcp-server
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| kubectl-mcp-server ★ | 974 | — | Python | MIT | Stateless Kubernetes MCP server for AI-assisted troubleshooting and Helm operati |
| chrome-devtools-mcp | 60.4k | +760 | TypeScript | Apache-2.0 | Chrome DevTools via MCP and CLI for live browser debugging and performance analy |
| context7 | 65.8k | +333 | TypeScript | MIT | A hosted documentation index with MCP and CLI access for coding agents |
| mcp-for-blender | 37.1k | +1.1k | Python | GPL-3.0 | A local MCP bridge for inspecting and editing live Blender scenes with AI |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/rohitg00/kubectl-mcp-server.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about kubectl-mcp-server
How does an MCP client connect, and how does it select a cluster?
Does it need a GPU, and what should I size for?
Can we self-host it commercially, and will cluster data stay local?
When should we choose it over direct CLI access or a GitOps-specific MCP server?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy