cleanup
Cleanup all managed resources
Let an agent run kubectl and Helm against a cluster you can already reach — read the state, change it, and watch the rollout — without leaving the conversation.
LABSCO SUMMARY
What it takes off you is the terminal round trip: the verbs you would have typed — get, describe, logs, apply, scale, rollout, drain — arrive as tools, so the investigation and the fix it implies happen in the same conversation. How far that goes is yours to set: read-only, non-destructive, or an explicit tool list, decided at startup rather than per call.
A kubectl and Helm surface over a cluster. Most calls mirror a kubectl verb one for one, and a generic call falls through to any kubectl command for what the named ones do not cover. Values from kubectl get secrets come back masked unless you turn that off.
npx on your PATH, kubectl installed, and a cluster kubectl can already reach — kubectl get pods succeeding in a terminal is the check. It follows your current context by default; KUBECONFIG_PATH points at a different file, and KUBECONFIG_YAML or KUBECONFIG_JSON pass the config inline for containers with no file to mount. Secrets are masked in responses unless MASK_SECRETS is set to false.
One command — npx mcp-server-kubernetes
USE CASES
Describe the pod, read its logs including the previous container, and check what the events say — in one thread.
Apply the manifest, follow the rollout, and roll back to a named revision if it goes wrong.
Cordon it, drain it with a grace period, do the work, then uncordon — with a dry run first.
Forward a local port to the pod or service, use it, then stop the forward by id rather than hunting the process.
Install with your own values, upgrade in place later, and uninstall the release when it is finished with.
Start it with ALLOW_ONLY_READONLY_TOOLS — the write verbs never appear in the tool list it is offered.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
cleanupCleanup all managed resources
exec_in_podExecute a command in a Kubernetes pod or container and return the output. Command must be an array of strings where the first element is the executable and remaining elements are arguments. This executes directly without shell interpretation for security.
explain_resourceGet documentation for a Kubernetes resource or field
install_helm_chartInstall a Helm chart with support for both standard and template-based installation
kubectl_applyApply a Kubernetes YAML manifest from a string or file
kubectl_contextManage Kubernetes contexts - list, get, or set the current context
kubectl_createCreate Kubernetes resources using various methods (from file or using subcommands)
kubectl_deleteDelete Kubernetes resources by resource type, name, labels, or from a manifest file
kubectl_describeDescribe Kubernetes resources by resource type, name, and optionally namespace
kubectl_genericExecute any kubectl command with the provided arguments and flags
kubectl_getGet or list Kubernetes resources by resource type, name, and optionally namespace
kubectl_logsGet logs from Kubernetes resources like pods, deployments, or jobs
kubectl_patchUpdate field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch
kubectl_reconnectReconnect to the Kubernetes API server by recreating all API clients. Use this after cluster upgrades (e.g., EKS control plane upgrades that rotate ENIs/IPs) to force fresh DNS resolution and new TCP connections.
kubectl_rolloutManage the rollout of a resource (e.g., deployment, daemonset, statefulset)
kubectl_scaleScale a Kubernetes deployment
list_api_resourcesList the API resources available in the cluster
node_managementManage Kubernetes nodes with cordon, drain, and uncordon operations
pingVerify that the counterpart is still responsive and the connection is alive.
port_forwardForward a local port to a port on a Kubernetes resource
stop_port_forwardStop a port-forward process
uninstall_helm_chartUninstall a Helm chart release
upgrade_helm_chartUpgrade an existing Helm chart release
BEFORE YOU INSTALL
23 tools when we connected. cleanup_pods, helm_template_apply and helm_template_uninstall appear in the documentation but not on the running server; clean up pods with kubectl_get and kubectl_delete using field selectors.
CONTEXT COST
Rated by the size of the 23 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx mcp-server-kubernetesclaude mcp add kubernetes -- npx mcp-server-kubernetescodex mcp add kubernetes -- npx mcp-server-kubernetes{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": [
"mcp-server-kubernetes"
]
}
}
}Settings -> Extensions -> Browse Extensions and scroll to find mcp-server-kubernetes
{
"servers": {
"kubernetes": {
"command": "npx",
"args": [
"mcp-server-kubernetes"
],
"description": "Kubernetes cluster management and operations"
}
}
}npx mcp-chat --server "npx mcp-server-kubernetes"