# kubernetes-mcp-server

Connects your agent to a Kubernetes or OpenShift cluster: pods, logs, Helm, Tekton. Useful when you want to inspect and change resources without leaving the chat.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 2180
- Author: containers
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/containers/kubernetes-mcp-server
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/kubernetes-mcp-server

## What it does

The server is written in Go and talks to the Kubernetes API server directly instead of shelling out to `kubectl` or `helm`. So no external tools are required on the machine, and with the native binary you skip Node and Python too. Builds exist for Linux, macOS and Windows, plus an npm package, a Python package and a container image.

It handles any CRUD operation on Kubernetes and OpenShift resources, pod work (list, logs, `exec`, metrics, delete, run an image), namespaces, events and OpenShift projects. Helm gets its own set: install a chart, list releases, uninstall. Tekton covers starting a Pipeline or Task, restarting and cancelling a PipelineRun, and pulling logs by resolving the pod. Configuration comes from `.kube/config`, and the server notices when that file changes. Several clusters from your kubeconfig can be used at once.

Settings go through command-line arguments, a TOML file or environment variables. OpenTelemetry tracing and metrics are optional, with custom sampling rates and a `/stats` endpoint. No cluster access means nothing works, so check that first.

## Requirements
- Needs: Node.js (commands run via npx)
- Works with: Kubernetes

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add kubernetes-mcp-server -- npx -y kubernetes-mcp-server
```

### Codex

**Platform CLI**
```bash
codex mcp add kubernetes-mcp-server -- npx -y kubernetes-mcp-server
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "kubernetes-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "kubernetes-mcp-server"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "kubernetes-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "kubernetes-mcp-server"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add kubernetes-mcp-server npx -y kubernetes-mcp-server
```

## When to use it
- read pod logs without switching to a terminal
- run a command inside a container via `exec`
- install or remove a Helm release from the chat
- start a Tekton Pipeline and fetch its logs
- check namespace events when something keeps crashing

## Example prompts
- Show me the logs for pod `api-7d9f` in namespace `prod`
- Start the Tekton Pipeline `build` in namespace `ci`
- How much CPU and memory are the pods in `staging` using?

## Similar
- [kubernetes-specialist](https://affpapa.org/en/nevibecode/skills/kubernetes-specialist.md) — skill · 14100 installs
- [kubernetes-skill](https://affpapa.org/en/nevibecode/skills/kubernetes-skill.md) — skill · 1400 installs
- [kubernetes](https://affpapa.org/en/nevibecode/skills/kubernetes.md) — skill · 1000 installs
- [Kubernetes taste](https://affpapa.org/en/nevibecode/prompts/kubernetes-taste.md) — prompt · ★ 174597
- [openshift](https://affpapa.org/en/nevibecode/skills/openshift.md) — skill · 349 installs
- [project-references](https://affpapa.org/en/nevibecode/skills/project-references.md) — skill · 3900 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
