Skip to content
← All MCP servers

Is the Kubernetes MCP server safe? What it can reach

What the Kubernetes MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.

Community serverChecked

The most used Kubernetes MCP server is the community project containers/kubernetes-mcp-server, a Go binary that talks to the API server with your kubeconfig. It can list, create, update and delete any resource and exec into pods. Set read_only = true in its TOML config and give its identity a read-only RBAC role.

Who maintains it

ImplementationKindStatus
containers/kubernetes-mcp-server (community)Communityactive

It runs as a local process on your machine or as a hosted remote server.

How it signs in

It uses your kubeconfig, or the in-cluster service account, and acts with that identity’s Kubernetes RBAC rights. HTTP mode can also require OAuth or OIDC.

What its tools can do

KindTools
Readconfiguration_contexts_list, targets_list, configuration_view, events_list, namespaces_list, projects_list, nodes_log, nodes_stats_summary, nodes_top, pods_list, pods_list_in_namespace, pods_get, pods_top, pods_log, resources_list, resources_get, api_resources_list, helm_list
Writepods_run, resources_scale, helm_install
Can’t be undonepods_exec, pods_delete, resources_create_or_update, resources_delete, helm_uninstall

Only the core, config and helm toolsets are listed. Default toolsets are config and core; helm, kiali, kubevirt, tekton, observability and others are opt-in and add more tools. resources_create_or_update can create any resource kind, including roles and bindings, so it is listed as destructive.

Built-in limits

OptionWhat it does
read_onlyTOML option. When true, only tools annotated read-only are registered. The README calls it a best-effort guardrail; rely on Kubernetes RBAC.
disable_destructiveTOML option. Unregisters tools annotated destructive.
toolsetsTOML list of toolsets to enable. Default is core and config.
enabled_tools / disabled_toolsTOML allowlist and denylist of individual tools.
denied_resourcesTOML list of group, version and kind entries the server rejects, such as Secret.
Cluster RBACThe README recommends a dedicated ServiceAccount with read-only access for a secure setup.

The risks

  • pods_exec runs a command inside a container, so an injected instruction in a pod log or event could run code in a production workload.
  • resources_get and resources_list can read Secrets unless you deny them, and configuration_view returns the kubeconfig content to the model.
  • resources_create_or_update and resources_delete work on any resource kind, so the agent can change deployments, RBAC and CRDs with your kubeconfig’s rights.
  • The default kubeconfig context may point at production, and the server can reach every context in that file.

Limit it in Claude Code

Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:

claude mcp add kubernetes -- npx -y kubernetes-mcp-server@latest

Claude Code names MCP tools mcp__kubernetes__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:

{
  "permissions": {
    "deny": [
      "mcp__kubernetes__pods_exec",
      "mcp__kubernetes__pods_delete",
      "mcp__kubernetes__resources_delete",
      "mcp__kubernetes__helm_uninstall"
    ],
    "ask": [
      "mcp__kubernetes__resources_create_or_update",
      "mcp__kubernetes__pods_run",
      "mcp__kubernetes__resources_scale",
      "mcp__kubernetes__helm_install"
    ]
  }
}

Limit it in Codex

Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:

[mcp_servers.kubernetes]
command = "npx"
args = ["-y", "kubernetes-mcp-server@latest"]
disabled_tools = ["pods_exec", "pods_delete", "resources_delete", "helm_uninstall"]

Checklist

  • Create a read-only ServiceAccount and a kubeconfig that uses only it.
  • Set read_only = true and deny Secret in denied_resources.
  • Point the kubeconfig at one non-production context.
  • Deny pods_exec and the delete tools in Claude Code.
  • Enable helm or other toolsets only when needed.

Checked against the vendor documentation on November 25, 2026. containers/kubernetes-mcp-server README · Configuration reference

What Excellent covers

Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing