Is mcp-server-kubernetes safe?
MCP server for interacting with Kubernetes clusters via kubectl
This server can run commands on your computer. An agent that is tricked could use it to do almost anything you can.
Why: can run shell commands on your computer.
What it can do
- Runs shell commands
- Writes or deletes files
- Needs API keys or tokens
Tools it offers your AI (28):
- exec_in_pod
- install_helm_chart
- upgrade_helm_chart
- uninstall_helm_chart
- k8s-diagnose
- keyword
- namespace
- kubectl_apply
- kubectl_context
- kubectl_create
- kubectl_delete
- kubectl_describe
- kubectl_generic
- kubectl_get
- kubectl_logs
- explain_resource
- list_api_resources
- kubectl_patch
- kubectl_reconnect
- kubectl_rollout
- kubectl_scale
- node_management
- ping
- port_forward
- stop_port_forward
- cleanup
- create_deployment
- list_namespaces
How to use it safely
- ✓ Run it in a container or VM, and keep "approve each tool call" turned on.
- ✓ Point it at one project folder, never your home directory or a whole drive.
- ✓ Use a key with the smallest permissions available, and never paste a production key into a shared config.
- ✓ Pin the version (below) so an update can't change what it does without you noticing.
Code patterns worth reviewing
Automated pattern matches in the published package. Some are expected for this kind of server, and some may be false positives — they are pointers for review, not confirmed vulnerabilities.
Command injection risk
The agent appears to pass input into a shell or command execution path.
dist/tools/helm-operations.js:139
Unsafe deserialization of untrusted data
Data is loaded with a deserializer that can execute code (pickle, marshal, unsafe YAML, torch.load without weights_only, node-serialize).
dist/tools/kubectl-get.js:489
External content fed into the prompt without isolation
The agent pulls in outside content (web pages, emails, retrieved documents) and adds it to its prompt, with no visible marking of that content as untrusted data.
dist/tools/kubectl-get.js:145
Install it pinned
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "mcp-server-kubernetes@4.2.1"]
}
}
}Check your whole MCP setup
Agent Verify checks the servers in your Claude, Cursor and VS Code config — including whole-drive access and keys stored in plain text.
Maintain mcp-server-kubernetes?
Show users you've thought about access: add the badge below. If something here is wrong or you've released a fix, ask for a re-scan — we update pages on request.
[](https://aimodularity.com/agentverify/mcp/mcp-server-kubernetes/)
Agent Verify reads the package published on npm as text — it is never installed or run. Ratings describe capability, not intent, and are an automated, evidence-based check, not a guarantee. Scanner 2.0.0.