kubectl-mcp-server (rohitg00)
Python/npm kubectl MCP server with a large tool surface including Helm and diagnostics.
Labels are provisional (from the project README/docs, checked Nov 3, 2026). Not yet tested in our sandbox.
Read-only switch
--read-only flag or MCP_SAFETY_MODE=read-only env. --disable-destructive is a weaker middle mode.
Preset
- Pins
@2.0.0: the npm package needs 2.0.0 or later to start a release with the switch. - Set
MCP_SAFETY_MODE=read-only
Claude Code
{
"mcpServers": {
"kubectl": {
"command": "npx",
Removed: "args": ["-y", "kubectl-mcp-server"]
"args": ["-y", "kubectl-mcp-server@2.0.0"],
"env": {
"MCP_SAFETY_MODE": "read-only"
}
}
}
}Optional third layer: add "deny": ["mcp__kubectl__<write tool>"] under permissions in .claude/settings.json.
Codex
# Generated by redpresets.dev on 2026-11-03. Unverified preset. Also use a read-only credential. Not a security guarantee.
[mcp_servers.kubectl]
command = "npx"
Removed: args = ["-y", "kubectl-mcp-server"]
args = ["-y", "kubectl-mcp-server@2.0.0"]
default_tools_approval_mode = "writes"
[mcp_servers.kubectl.env]
MCP_SAFETY_MODE = "read-only"default_tools_approval_mode = "writes" asks before any tool the server does not mark read-only.
Cursor
{
"mcpServers": {
"kubectl": {
"type": "stdio",
"command": "npx",
Removed: "args": ["-y", "kubectl-mcp-server"]
"args": ["-y", "kubectl-mcp-server@2.0.0"],
"env": {
"MCP_SAFETY_MODE": "read-only"
}
}
}
}Don't add write tools to mcpAllowlist in .cursor/permissions.json. Leave them on approval. Cursor's docs say the allowlist is not a security boundary.
Lines marked + are what we added to the vendor's install command. Struck-through lines marked − are what they replaced; Copy leaves those out.
Credential layer
Bind the kubeconfig/service account the agent uses to a read-only ClusterRole (e.g. the built-in view role). view excludes Secrets; do not grant get secrets to agents.
Gotchas
- The npm package is a wrapper that starts the Python server. Before 2.0.0 it ran any
kubectl_mcp_toolmodule already installed, whatever its version, so an old Python install could run with write tools. Use npm 2.0.0 or later.
Facts
- Vendor
- rohitg00 (community)
- License
- MIT
- GitHub stars
- 965
- Latest release
- v2.0.0 (Oct 22, 2026)
- Last push
- Oct 22, 2026
- Status
- Active
- Last checked
- Nov 3, 2026
Sources
- README: --read-only, MCP_SAFETY_MODE · checked Oct 27, 2026
- npm 1.24.0 bin/cli.js runs any importable kubectl_mcp_tool; npm 2.0.0 bin/cli.js runs kubectl-mcp-server==<its own version> via uvx, or upgrades an older local install · checked Nov 3, 2026
Spotted something wrong? Labels change when vendors change. Suggest a correction
Read-only alternatives in Kubernetes
MCP server for Argo CD applications: list, inspect, sync and manage apps.
MCP server shipped with the Flux Operator for GitOps reconciliation, debugging and diffs.
Kubernetes analyzer; k8sgpt serve --mcp exposes its cluster analysis over MCP.