Kubernetes MCP server

The Kubernetes MCP server gives AI agents direct access to Kubernetes and OpenShift clusters: list and edit any resource, read pod logs, exec into pods, view events and install Helm charts.

Checked by CookiesForAI on : repository facts (stars, last push, archived) re-read from GitHub; listing in the MCP Registry checked.

Written by

Connect Kubernetes

Claude Desktop or any client with a JSON config

Config
{"mcpServers": {"kubernetes": {"command": "npx", "args": ["-y", "kubernetes-mcp-server@latest"]}}}

VS Code

Terminal
code --add-mcp '{"name":"kubernetes","command":"npx","args":["kubernetes-mcp-server@latest"]}'

Claude Code, read-only with a dedicated kubeconfig (from the project's guide)

Terminal
claude mcp add-json kubernetes-mcp-server '{"command":"npx","args":["-y","kubernetes-mcp-server@latest","--config","'"${HOME}"'/.config/kubernetes-mcp-server.toml"],"env":{"KUBECONFIG":"'${HOME}'/.kube/mcp-viewer.kubeconfig"}}' -s user

For the Claude Code route, first create ~/.config/kubernetes-mcp-server.toml containing read_only = true, and a ServiceAccount kubeconfig as the project's Kubernetes setup guide describes. Runtime flags such as --read-only are no longer accepted; settings go in the TOML file.

Or paste this into your coding agent: Connect the Kubernetes MCP server to my coding agent using its documented setup: https://github.com/containers/kubernetes-mcp-server. Checked by CookiesForAI on : repository facts (stars, last push, archived) re-read from GitHub; listing in the MCP Registry checked.

What the Kubernetes MCP server does

kubernetes-mcp-server is a community MCP server from the containers GitHub organization that connects AI agents to Kubernetes and OpenShift clusters. Through it an agent can create, read, update and delete any resource, list pods across namespaces, read pod logs and resource usage, exec into a pod, run a container image, view events, and install, list or uninstall Helm releases.

kubernetes-mcp-server is written in Go and talks to the Kubernetes API directly instead of wrapping kubectl or helm, so it needs no other tools installed. It ships as a single binary for Linux, macOS and Windows, an npm package, a Python package and a container image. It reads your kubeconfig, follows changes to it, and can work with several clusters at once.

Tools come in toolsets: core and config are on by default, while helm, kcp, kiali, kubevirt, netobserv and tekton are optional. A TOML config sets read_only = true and can deny specific resource types. The project's own Claude Code guide uses read-only mode with a dedicated ServiceAccount. The repo had 2,139 GitHub stars on , more than the runner-up, Flux159/mcp-server-kubernetes, with 1,594.

When to use Kubernetes

  • A pod keeps crashing and you want the agent to read its logs and events.
  • You want a quick inventory of what runs in a namespace.
  • You want the agent to install or remove a Helm release in a dev cluster.
  • You want to troubleshoot a failing Tekton PipelineRun.

When to pick something else

  • Production clusters with an admin kubeconfig: the server can delete resources and exec into pods, so use read_only = true and a limited ServiceAccount.
  • An official server: no Kubernetes or CNCF project publishes one. The runner-up community option is Flux159/mcp-server-kubernetes (1,594 GitHub stars on , MIT), which wraps kubectl and helm.

What Kubernetes needs

  • Access to a Kubernetes or OpenShift cluster and a kubeconfig
  • Node.js for the npx route, or the native binary

What the Kubernetes MCP server costs

Free and open source under Apache-2.0, with no hosted version or paid tier; you run it against your own clusters.