Kubernetes MCP server tools: which ones change your cluster, and how to make your agent ask
All 21 default tools of the Kubernetes MCP server from the containers project, checked by running version 0.1.3: which only read, which change the cluster, why a read-only tool hands over your token, and the Claude Code settings that make the rest ask.
Checked on by running kubernetes-mcp-server 0.1.3 from containers/kubernetes-mcp-server and reading its tools/list answer. Each tier is the tool risk checker’s reading, with our reason wherever we changed it. Written by the people who make VariantGate.
The short answer
Set read_only and toolsets = ["core"]: 14 tools, none that change anything, and no configuration_view, which hands the model your token. Otherwise allow the 14 reads and make the rest ask. RBAC is the real limit.
- Can run on their own
- 12
- Should ask a person
- 9
Which Kubernetes server this is
This page is about kubernetes-mcp-server from the containers project, a Go program that talks to the Kubernetes API itself rather than wrapping kubectl. It uses your kubeconfig, so it can do whatever the current context’s user can. Other Kubernetes MCP servers have different tools; we have not checked those.
A read-only tool that hands over your token
configuration_view is marked read-only and is on by default. We pointed the server at a kubeconfig with a token in it and called the tool: the answer was the kubeconfig, token in plain text. That puts a working credential for your cluster into the model’s context, and into any log or transcript of the session. It is the one read on this page that should never run unasked, and the easiest fix is to leave out the config toolset it belongs to.
Settings are TOML, not flags
The server takes no --read-only flag; we tried, and it refused it as unknown. Its settings go in a TOML file passed with --config or a folder passed with --config-dir. This one leaves 14 tools, all of them reads, with no configuration_view:
# ~/.config/kubernetes-mcp-server/config.toml
read_only = true
toolsets = ["core"]
# Refuse Secrets, even where the credentials could read them
[[denied_resources]]
group = ""
version = "v1"
kind = "Secret"claude mcp add kubernetes -- npx -y kubernetes-mcp-server@latest \
--config ~/.config/kubernetes-mcp-server/config.tomlread_only = truedropspods_delete,pods_exec,pods_run,resources_create_or_update,resources_delete,resources_scale.disable_destructive = trueis the weaker choice: it drops five tools but keepspods_run, which starts any image you name, because the server does not mark it destructive.- The README calls
read_onlyanddenied_resourcesbest-effort guardrails and says to rely on Kubernetes RBAC for the identity the server signs in as. Give it a service account that can onlyget,listandwatch, in the namespaces it needs, and nothing on Secrets.
All 21 tools
Hard to undo7 toolsAsk a person every time. Consider two people, or deny it if the agent never needs it.
configuration_viewGet the current Kubernetes configuration content as a kubeconfig YAML
Server says: read-only
Our call: Marked read-only, but it returns your kubeconfig with its token in plain text; we checked. Once a credential is in the model's context, it cannot be taken back.
pods_deleteDelete a Kubernetes Pod in the current or provided namespace with the provided name
Server says: destructive
pods_execExecute a command in a Kubernetes Pod (shell access, run commands in container) in the current or provided namespace with the provided name and command
Server says: destructive
pods_runRun a Kubernetes Pod in the current or provided namespace with the provided container image and optional name
Server gives no read-only or destructive hint
Our call: Starts any image in the cluster with your rights. The server does not mark it destructive, so disable_destructive keeps it.
resources_create_or_updateCreate or update a Kubernetes resource via Server-Side Apply.
Server says: destructive
resources_deleteDelete a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name (common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1…
Server says: destructive
resources_scaleGet or update the scale of a Kubernetes resource in the current cluster by providing its apiVersion, kind, name, and optionally the namespace.
Server says: destructive
Our call: Scaling a deployment to 0 takes the service down at once; the same tool also only reads the scale when no number is given.
Not sure2 toolsAsk a person until you have checked what it does.
resources_getGet a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name (common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1…
Server says: read-only
Our call: Marked read-only, and changes nothing, but it reads any kind of object: Secrets too, when your credentials can, which puts their values in the model's context. Let it run once Secrets are denied.
resources_listList Kubernetes resources and objects in the current cluster by providing their apiVersion and kind and optionally the namespace and label selector.
Server says: read-only
Our call: Marked read-only, and changes nothing, but it reads any kind of object: Secrets too, when your credentials can, which puts their values in the model's context. Let it run once Secrets are denied.
Only looks12 toolsLet it run. It only looks.
api_resources_listLook up the Kubernetes API resource type(s) matching a specific kind you already have in mind (apiVersion, plural resource name, whether namespaced), using the server's preferred version for each match -- the same data 'kubectl…
Server says: read-only
events_listList Kubernetes events (warnings, errors, state changes) for debugging and troubleshooting in the current cluster from all namespaces.
Server says: read-only
namespaces_listList all the Kubernetes namespaces in the current cluster.
Server says: read-only
nodes_logGet logs from a Kubernetes node (kubelet, kube-proxy, or other system logs).
Server says: read-only
nodes_stats_summaryGet detailed resource usage statistics from a Kubernetes node via the kubelet's Summary API.
Server says: read-only
nodes_topList the resource consumption (CPU and memory) as recorded by the Kubernetes Metrics Server for the specified Kubernetes Nodes or all nodes in the cluster.
Server says: read-only
pods_getGet a Kubernetes Pod in the current or provided namespace with the provided name
Server says: read-only
pods_listList all the Kubernetes pods in the current cluster from all namespaces.
Server says: read-only
pods_list_in_namespaceList all the Kubernetes pods in the specified namespace in the current cluster.
Server says: read-only
pods_logGet the logs of a Kubernetes Pod in the current or provided namespace with the provided name
Server says: read-only
pods_topList the resource consumption (CPU and memory) as recorded by the Kubernetes Metrics Server for the specified Kubernetes Pods in the all namespaces, the provided namespace, or the current namespace.
Server says: read-only
projects_listList all the OpenShift projects in the current cluster.
Server says: read-only
Let the reads run in Claude Code
Claude Code asks before every MCP tool it has no rule for. Added as kubernetes, this server’s tools are named mcp__kubernetes__<tool>. These allow rules, in .claude/settings.json or ~/.claude/settings.json, let the tools that only look run without a prompt. Everything else keeps asking, including any tool a later version of the server adds.
{
"permissions": {
"allow": [
"mcp__kubernetes__api_resources_list",
"mcp__kubernetes__events_list",
"mcp__kubernetes__namespaces_list",
"mcp__kubernetes__nodes_log",
"mcp__kubernetes__nodes_stats_summary",
"mcp__kubernetes__nodes_top",
"mcp__kubernetes__pods_get",
"mcp__kubernetes__pods_list",
"mcp__kubernetes__pods_list_in_namespace",
"mcp__kubernetes__pods_log",
"mcp__kubernetes__pods_top",
"mcp__kubernetes__projects_list"
]
}
}The command that adds the server:
claude mcp add kubernetes -- npx -y kubernetes-mcp-server@latestSend the rest to a person, not the terminal
A prompt in the terminal only works while someone is watching it. With this hook, every other tool of the server becomes a request in your VariantGate inbox, on your phone or in Slack, and Claude Code waits for the answer. The matcher names the look-only tools, so a tool added later is sent too. Put the key in VARIANTGATE_KEY, or run the one-command setup for Claude Code first.
{
"hooks": {
"PreToolUse": [
{
"matcher": "mcp__kubernetes__(?!(api_resources_list|events_list|namespaces_list|nodes_log|nodes_stats_summary|nodes_top|pods_get|pods_list|pods_list_in_namespace|pods_log|pods_top|projects_list)$).*",
"hooks": [
{ "type": "command", "command": "variantgate hook claude-code", "timeout": 180 }
]
}
]
}
}Disagree with a tier, or run the server with other flags? Open these tools in the tool risk checker, change what you like, and copy the settings for your own setup. It runs in your browser and starts from its own reading, so a tool we marked as only looking by hand asks there until you change it.
Any MCP client: put the proxy in front
Claude Desktop, Cursor and most other MCP clients have no hook to send a call to a person. The VariantGate MCP proxy does it in the server’s place: it starts the server, lets the look-only tools above through, and holds every other call until someone approves it in the inbox. Run npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz login once to save a key, then use this in claude_desktop_config.json or ~/.cursor/mcp.json:
{
"mcpServers": {
"kubernetes": {
"args": [
"-y",
"https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz",
"mcp-proxy",
"--name",
"kubernetes",
"--look-only",
"api_resources_list,events_list,namespaces_list,nodes_log,nodes_stats_summary,nodes_top,pods_get,pods_list,pods_list_in_namespace,pods_log,pods_top,projects_list",
"--",
"npx",
"-y",
"kubernetes-mcp-server@latest"
],
"command": "npx"
}
}
}Already have it in Claude Desktop? One command rewrites the file for you, with these look-only tools filled in, and keeps the old one (setup vscode does the same for VS Code; how it works):
npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz setup claude-desktopThe same in Claude Code, instead of the hook. The proxy now asks about every call that matters, so an allow rule for the whole server, mcp__kubernetes, keeps Claude Code from asking a second time in the terminal:
claude mcp add kubernetes -- npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz mcp-proxy --name kubernetes --look-only api_resources_list,events_list,namespaces_list,nodes_log,nodes_stats_summary,nodes_top,pods_get,pods_list,pods_list_in_namespace,pods_log,pods_top,projects_list -- npx -y kubernetes-mcp-server@latestClaude Code’s allow rules match a tool’s name, never its arguments, so a rule cannot tell a harmless call of these tools from a risky one. Once Secrets are denied, in the server's settings and in RBAC, these rules also let resources_get, resources_list run unasked:
{
"permissions": {
"allow": [
"mcp__kubernetes__api_resources_list",
"mcp__kubernetes__events_list",
"mcp__kubernetes__namespaces_list",
"mcp__kubernetes__nodes_log",
"mcp__kubernetes__nodes_stats_summary",
"mcp__kubernetes__nodes_top",
"mcp__kubernetes__pods_get",
"mcp__kubernetes__pods_list",
"mcp__kubernetes__pods_list_in_namespace",
"mcp__kubernetes__pods_log",
"mcp__kubernetes__pods_top",
"mcp__kubernetes__projects_list",
"mcp__kubernetes__resources_get",
"mcp__kubernetes__resources_list"
]
}
}Logs are other people’s text
pods_log, nodes_log and events_list return text written by your workloads, and anything that reaches a log can reach the model, including a line written to look like an instruction. Reads can run; a change the agent proposes after reading them, such as deleting a pod or scaling a deployment, is the call to answer yourself.
See it before you decide.
The playground runs the whole approval loop in your browser, no account needed. When it fits, the free plan covers 100 requests a month.