# flux159/mcp-server-kubernetes [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/Flux159/mcp-server-kubernetes  
**GitHub Stars:** 1609  
**npm Downloads (last month):** 106624  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/flux159-mcp-server-kubernetes

## Description
/🏠 - Typescript implementation of Kubernetes cluster operations for pods, deployments, services.

## Tools
Capabilities this server exposes over MCP:

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

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-server-kubernetes": {
    "command": "npx",
    "args": ["mcp-server-kubernetes"]
  }
}
```

## Documentation

## What flux159/mcp-server-kubernetes does

flux159/mcp-server-kubernetes exposes Kubernetes cluster operations as MCP tools. It supports common workload and resource tasks for pods, deployments, services, jobs, daemonsets, statefulsets, and other API resources through a unified interface around kubectl.

Read operations include getting or listing resources, describing them, reading logs, explaining resource fields, listing API resources, and checking the connection. Write and operational tools can apply manifests, create or delete resources, patch fields, scale deployments, manage rollouts, change contexts, and clean up managed resources.

The server also includes cluster-administration workflows. It can cordon, drain, and uncordon nodes; install, upgrade, or uninstall Helm charts; forward local ports to Kubernetes resources; execute a command in a pod; and stop an existing port-forward process. Pod commands are passed as an argument array and run directly rather than through shell interpretation.

## How it works

The server uses the Kubernetes access already configured for kubectl. By default, it loads the kubeconfig at `~/.kube/config`, including the contexts configured there, and connects to the selected cluster context. Before starting it, kubectl must be installed and available on `PATH`, and the configured credentials must be able to reach a cluster. Helm 3 is also needed for Helm operations.

MCP clients normally launch it as a stdio process with `npx mcp-server-kubernetes`. A Streamable HTTP mode is available on the `/mcp` endpoint and uses port 3000 by default when enabled. The `kubectl_reconnect` tool recreates Kubernetes API clients, which is useful after a cluster upgrade that changes endpoint DNS resolution or underlying connections.

The server supports a non-destructive mode for read and create/update-only access. Secret values are masked for `kubectl get secrets` operations, while logs are not affected by that masking behavior. Optional OpenTelemetry instrumentation can trace tool calls and export spans to Jaeger, Tempo, Grafana, or another OTLP backend.

## Setup and configuration

Install kubectl and configure a working kubeconfig before adding the server to an MCP client. Verify access independently with a command such as `kubectl get pods`. Helm 3 is optional unless chart operations are required.

Claude Code and Codex can register the server with their MCP commands:

```bash
claude mcp add kubernetes -- npx mcp-server-kubernetes
codex mcp add kubernetes -- npx mcp-server-kubernetes
```

Claude Desktop, Cursor, and VS Code can use a stdio configuration with `npx` as the command and `mcp-server-kubernetes` as its argument. Claude Desktop also supports the server as an mcpb extension. The project documents a Streamable HTTP configuration for Muse Code, using `ENABLE_UNSAFE_STREAMABLE_HTTP_TRANSPORT=1` when launching HTTP mode.

## Tools and capabilities

- Inspect resources with `kubectl_get`, `kubectl_describe`, `explain_resource`, and `list_api_resources`.
- Create, apply, delete, patch, scale, and roll out Kubernetes resources.
- Read pod, deployment, or job logs and execute direct commands in pods.
- Manage contexts and refresh API connections after cluster changes.
- Install, upgrade, and uninstall Helm releases, including template-based operations.
- Cordon, drain, and uncordon nodes for maintenance.
- Start and stop local port forwards.
- Run a generic kubectl command when a specialized tool does not cover the operation.
- Clean up managed resources and use `ping` to verify the MCP connection.

## Limitations and notes

Cluster permissions still come from the kubeconfig and Kubernetes credentials used by kubectl. The server does not replace RBAC configuration or grant access by itself. Helm features require Helm 3 on the host. Pod command execution avoids shell interpretation, so commands must be supplied as an executable followed by separate argument strings.

The non-destructive mode and secret masking are available as safety features, but secret masking does not apply to logs. OpenTelemetry is opt-in rather than enabled by default. HTTP transport is described as unsafe and must be explicitly enabled with its environment variable.

_Full upstream README: https://allmcps.com/mcp/flux159-mcp-server-kubernetes/readme_

