Skip to content

Kubernetes MCP and API

Kubernetes exposes cluster resources and management actions through a local MCP server and the configured kubeconfig. An agent can inspect cluster resources and run management commands with the configured kubeconfig. Longwave installs the Kubernetes MCP server and runs it on your machine, with no account or key.

Add to Longwave

Install elsewhere

Install Kubernetes

Choose a harness. These instructions start the same local MCP server shown on this page.

Claude Code

Run this in your terminal. It adds a user-scoped server; use --scope project instead if it should apply only to the current project.

terminal
claude mcp add --scope user --transport stdio kubernetes -- npx -y [email protected]
functions
23
access
Runs locally

Use Kubernetes on Longwave

  1. Download Longwave or open app.longwave.run.
  2. Longwave installs the Kubernetes MCP server and runs it on your machine, with no account or key.
  3. Ask for the result in any thread, for example: “Inspect pods for a deployment investigation”. The agent picks the Kubernetes function and calls it.

Kubernetes functions

Function
cleanup Cleanup all managed resources
exec_in_pod Execute 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_resource Get documentation for a Kubernetes resource or field
install_helm_chart Install a Helm chart with support for both standard and template-based installation
kubectl_apply Apply a Kubernetes YAML manifest from a string or file
kubectl_context Manage Kubernetes contexts - list, get, or set the current context
kubectl_create Create Kubernetes resources using various methods (from file or using subcommands)
kubectl_delete Delete Kubernetes resources by resource type, name, labels, or from a manifest file
kubectl_describe Describe Kubernetes resources by resource type, name, and optionally namespace
kubectl_generic Execute any kubectl command with the provided arguments and flags
kubectl_get Get or list Kubernetes resources by resource type, name, and optionally namespace
kubectl_logs Get logs from Kubernetes resources like pods, deployments, or jobs
kubectl_patch Update field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch
kubectl_reconnect Reconnect 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_rollout Manage the rollout of a resource (e.g., deployment, daemonset, statefulset)
kubectl_scale Scale a Kubernetes deployment
list_api_resources List the API resources available in the cluster
node_management Manage Kubernetes nodes with cordon, drain, and uncordon operations
ping Verify that the counterpart is still responsive and the connection is alive.
port_forward Forward a local port to a port on a Kubernetes resource
stop_port_forward Stop a port-forward process
uninstall_helm_chart Uninstall a Helm chart release
upgrade_helm_chart Upgrade an existing Helm chart release

Use cases

Questions people ask

How does the Kubernetes MCP server select a cluster?

The listed server uses Kubernetes configuration and the active context. The kubeconfig determines which cluster and credentials it uses. Kubernetes documentation

Which cluster operations does the Kubernetes server expose?

Its documented tools include resource inspection, kubectl operations and Helm operations. Kubernetes permissions still apply to the configured credentials. Kubernetes documentation

How do I add the Kubernetes MCP server to Claude Code?

Run claude mcp add kubernetes -- npx -y [email protected] in a terminal. Longwave installs the Kubernetes MCP server and runs it on your machine, with no account or key.

Who publishes the Kubernetes MCP server?

Flux159 publishes the Kubernetes MCP server that Longwave installs. Source code

Use Kubernetes in Longwave

Call Kubernetes from any agent thread, on your machine or in the cloud.

Add to Longwave