kubectl-mcp-server (rohitg00)

Python/npm kubectl MCP server with a large tool surface including Helm and diagnostics.

By defaultCan delete
With our presetRead-only
Flagssecretsexec

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

Read-onlyRead-only switch from the project's docs. Not sandbox-tested yet.
What the preset changes
  • 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

.mcp.json
{
  "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

~/.codex/config.toml
# 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

.cursor/mcp.json
{
  "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_tool module 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)
Source
rohitg00/kubectl-mcp-server
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

Spotted something wrong? Labels change when vendors change. Suggest a correction

Read-only alternatives in Kubernetes