Skip to main content
MCP server CX Codex

Kubernetes — Claude Code MCP server: what it does, how to install

An MCP server that connects to the Kubernetes cluster you already use and hands the agent kubectl tools: pods, logs, manifests.

no license updated 2026-10-29

Open on GitHub

What Kubernetes does

It runs as npx mcp-server-kubernetes and drives the kubectl already on your machine. The agent gets kubectl_get, kubectl_describe, kubectl_create, kubectl_apply, kubectl_delete, kubectl_logs, kubectl_context and explain_resource. So listing pods, pulling container logs or applying a manifest no longer means a second terminal window.

By default the server reads ~/.kube/config, and it can pull kubeconfig from several sources in priority order. On Claude a single command registers it: claude mcp add kubernetes -- npx mcp-server-kubernetes. Cursor takes the entry in ~/.cursor/mcp.json or a project .cursor/mcp.json.

Put kubectl in PATH and have a kubeconfig whose contexts actually work. Try kubectl get pods first; when that call fails, the server's tools fail the same way. Helm v3 belongs in PATH only if you plan to touch Helm releases.

What it helps with

  • list pods and their state without switching to a terminal
  • read container logs from a pod that keeps restarting
  • apply a manifest from deploy.yaml to the current context
  • move between kubectl contexts across clusters
  • look up what a resource field means with explain_resource

Example prompts for the agent

  • List every pod in default and describe the ones that aren't in Running
  • Grab the logs from the api container in that pod
  • Switch to the staging context and apply deploy.yaml

How to install Kubernetes

Install

The MCP registry has no launch command for it: see the repository README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Kubernetes

How do I install the Kubernetes MCP server in Claude Code?

With one command: claude mcp add kubernetes -- npx mcp-server-kubernetes. It writes the server into your Claude MCP settings, and the tools show up in the session.

What does the Kubernetes MCP server do?

It connects to your cluster using your kubeconfig and exposes kubectl commands as tools: get or describe a resource, apply a manifest, delete an object, fetch logs, switch context.

What has to be in place before it works?

kubectl in PATH, a kubeconfig with configured contexts, and cluster access that kubectl can already reach. Helm v3 is needed only if you manage Helm releases.

Similar MCP servers

All MCP servers for DevOps and infrastructure →

Project sponsors

Companies that keep this analytics open