# mcp-server-kubernetes

> mcp-server-kubernetes is an open-source MCP server for developer tools. MCP server letting AI assistants run kubectl, Helm and pod operations on a cluster. It is available on CLI, macOS, Linux, Windows, VS Code and Self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux, Windows, VS Code, Self-hosted
- **Website:** https://www.npmjs.com/package/mcp-server-kubernetes
- **Repository:** https://github.com/flux159/mcp-server-kubernetes
- **GitHub stars:** 1,616
- **License:** MIT
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools), [cloud and infrastructure](https://ai-powered.com/categories/cloud-and-infrastructure)
- **Listing updated:** 2026-12-01

## About

Gives AI clients such as Claude Code, Cursor and VS Code a bridge into an existing Kubernetes cluster. It reads kubeconfig from the standard location and from other configured sources, then exposes cluster operations as MCP tools that the assistant can call during a conversation.

Beyond the core kubectl verbs, the server covers Helm installs and upgrades, port forwarding to pods and services, node cordon, drain and uncordon, and cleanup of pods stuck in failure states. A non-destructive mode disables deletes and arbitrary commands, and a read-only mode limits the assistant to inspection tools. Secret values are masked in get output.

It suits platform and DevOps engineers who want an assistant to inspect workloads, debug failing pods and make routine changes. Optional OpenTelemetry tracing can export tool-call spans to an OTLP backend.

## Features

- **Unified kubectl tools:** Get, describe, apply, create, patch, scale and roll out resources through named MCP tools.
- **Helm chart operations:** Install, upgrade and uninstall charts with custom values, repositories and versions.
- **Port forwarding:** Open port forwards to pods and services so local tools can reach cluster workloads.
- **Pod cleanup and node management:** Clear pods in states such as Evicted or CrashLoopBackOff and cordon, drain or uncordon nodes.
- **Non-destructive and read-only modes:** Environment flags block deletes and arbitrary commands, or restrict the server to read-only tools.
- **Secret masking and tracing:** Masks secret values in get output and can export tool-call traces via OpenTelemetry.

## Good for

- Asking an assistant to list failing pods and explain why they crash
- Scaling or rolling back a deployment from within a chat session
- Installing or upgrading a Helm chart without leaving the editor
- Giving an assistant read-only cluster access for auditing
- Draining a node before maintenance with a guided command

## Tools

From the tool list in its README, going by the names, 3 of 25 tools delete data and 4 change data; 14 names don't say. From the server's own tool labels and tool names; not verified by us.

- `kubectl_get` (name suggests: reads): Get or list Kubernetes resources.
- `kubectl_describe` (name suggests: reads): Describe Kubernetes resources.
- `kubectl_create` (name suggests: changes): Create Kubernetes resources.
- `kubectl_apply`: Apply YAML manifests.
- `kubectl_delete` (name suggests: deletes): Delete Kubernetes resources.
- `kubectl_logs`: Get logs from resources.
- `kubectl_context`: Manage kubectl contexts.
- `explain_resource` (name suggests: reads): Explain Kubernetes resource schemas.
- `list_api_resources` (name suggests: reads): List API resources.
- `kubectl_scale`: Scale resources.
- `kubectl_patch` (name suggests: changes): Update fields of a resource.
- `kubectl_rollout`: Manage deployment rollouts.
- `kubectl_generic`: Execute any kubectl command.
- `ping`: Verify connection to the cluster.
- `port_forward`: Port forward to pods and services.
- `stop_port_forward` (name suggests: changes): Stop an active port forward.
- `helm_template_apply`: Install a Helm chart via template apply.
- `helm_template_uninstall` (name suggests: deletes): Uninstall a Helm chart via template.
- `install_helm_chart`: Install a Helm chart.
- `upgrade_helm_chart`: Upgrade a Helm chart.
- `uninstall_helm_chart` (name suggests: deletes): Uninstall a Helm chart.
- `cleanup_pods`: Clean up problematic pods.
- `node_management`: Cordon, drain and uncordon nodes.
- `exec_in_pod` (name suggests: changes): Run a command inside a pod.
- `cleanup`: Clean up managed resources.

## FAQ

### Which MCP clients can use mcp-server-kubernetes?

The README gives setup steps for Claude Code, Codex CLI, Claude Desktop, VS Code, Cursor and Muse Code, plus the mcp-chat client.

### Does mcp-server-kubernetes need kubectl installed?

Yes. kubectl must be on the PATH and a working kubeconfig must be present; Helm v3 is needed only for Helm operations.

### Can I stop the assistant from deleting resources?

Setting ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=true disables delete and similar tools, and ALLOW_ONLY_READONLY_TOOLS=true limits it to read-only tools.

### What license is mcp-server-kubernetes released under?

The project is released under the MIT license.

### Is mcp-server-kubernetes free?

Yes. mcp-server-kubernetes is open source, so you can use and self-host it for free.

### What are the best alternatives to mcp-server-kubernetes?

The closest alternatives to mcp-server-kubernetes are k8s-mcp-server, kubectl-mcp-server, mcp-k8s, Helm MCP and Kubernetes MCP Server.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [k8s-mcp-server](https://ai-powered.com/mcp/k8s-mcp-server): k8s-mcp-server is an open-source MCP server for developer tools.
- [kubectl-mcp-server](https://ai-powered.com/mcp/kubectl-mcp-server): kubectl-mcp-server is an open-source MCP server for cloud and infrastructure.
- [mcp-k8s](https://ai-powered.com/mcp/mcp-k8s): mcp-k8s is an open-source MCP server for cloud and infrastructure.
- [Helm MCP](https://ai-powered.com/mcp/helm-mcp-2): Helm MCP is an open-source MCP server for cloud and infrastructure.
- [Kubernetes MCP Server](https://ai-powered.com/mcp/kubernetes-mcp-server): Kubernetes MCP Server is an open-source MCP server for developer tools.
- [MCP Kubernetes](https://ai-powered.com/mcp/mcp-kubernetes): MCP Kubernetes is an open-source MCP server for developer tools.
- [MCP Openshift](https://ai-powered.com/mcp/mcp-openshift): MCP Openshift is an open-source MCP server for cloud and infrastructure.
- [K8s MCP Server (Go)](https://ai-powered.com/mcp/k8s-mcp-server-go): K8s MCP Server (Go) is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/mcp-server-kubernetes
