# Kubernetes

> Inspect and manage Kubernetes clusters through kubectl-equivalent tools, with a non-destructive mode.

[Canonical HTML page](https://top-mcps.com/mcp/kubernetes) · [server.json](https://top-mcps.com/mcp/kubernetes.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

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

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

```shell
# export ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=true
claude mcp add kubernetes -- npx mcp-server-kubernetes
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

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

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

```jsonc
{
  "servers": {
    "kubernetes": {
      "command": "npx",
      "args": [
        "mcp-server-kubernetes"
      ],
      "env": {
        "ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "${ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS}"
      }
    }
  }
}
```

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

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

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

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

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": [
            "mcp-server-kubernetes"
          ],
          "env": {
            "ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "${ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS}"
          }
        }
      }
    ]
  }
}
```

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.kubernetes]
command = "npx"
args = [
  "mcp-server-kubernetes",
]
env = { ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS = "${ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS}" }
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

```jsonc
{
  "context_servers": {
    "kubernetes": {
      "command": {
        "path": "npx",
        "args": [
          "mcp-server-kubernetes"
        ]
      },
      "env": {
        "ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "${ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS}"
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Apps directory`

Kubernetes doesn't ship a hosted HTTPS endpoint today. ChatGPT supports remote MCP servers only — to use this server in ChatGPT you'll need to deploy it to a public HTTPS URL first (e.g. via Cloudflare Workers or Vercel) or wait for an official remote build.

```none

```

## At a glance

- **Maintainer:** Flux159 (community)
- **Transport:** stdio
- **Auth model:** None
- **Required secrets:** ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS
- **Supported clients:** Claude, Cursor, VS Code, Any MCP-compatible client, Any kubeconfig cluster
- **License:** MIT
- **Language:** TypeScript
- **Latest version:** latest
- **Last verified:** 2026-07-16
- **GitHub stars:** 1,459 (fetched 2026-07-17T12:42:37.557Z)
- **Score:** 82/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/Flux159/mcp-server-kubernetes

## Quick answer

**What it does.** Loads your kubeconfig and exposes kubectl-equivalent operations (get, describe, logs, apply, scale) plus Helm as MCP tools, with an opt-in read/create-only mode.

**Best for:**
- Diagnosing failing pods from logs + events
- Read-only cluster inspection
- Dev-cluster deploys and scaling
- Helm release management
- Multi-cluster via kubeconfig contexts

**Not for:**
- Unguarded production mutations
- Clusters where kubeconfig is unavailable to the host
- Extremely large fleets needing native-API performance

## Description

The most widely-installed Kubernetes MCP (mcp-server-kubernetes, MIT, ~14k weekly npm installs) connects an agent to any cluster in your kubeconfig. It covers the kubectl surface — pods, deployments, services, logs, events — plus Helm, and ships a non-destructive mode that masks secrets and blocks deletes so an agent can diagnose without breaking things.

## Why it matters

"Why is this pod CrashLooping" is the canonical agent task, and it requires correlating pod status, events, and logs. A Kubernetes MCP puts that whole loop one prompt away instead of a dozen kubectl invocations.

## Key features

- Full kubectl-equivalent tool surface
- Non-destructive mode (masks secrets, blocks deletes)
- Loads kubeconfig from multiple sources
- Helm support
- npm + Docker, MIT

## FAQ

### Is it safe on production?

Enable non-destructive mode (`ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=true`), which masks secrets and blocks deletes. Even so, point it at least-privilege kubeconfig contexts.

### Is this the official Kubernetes MCP?

No — there is no single official one. This community server has the widest adoption (~14k weekly npm installs). For a native-API, multi-cluster Go implementation, see containers/kubernetes-mcp-server (Red Hat, ~1.8k stars).

### Does it support Helm?

Yes — install, upgrade, and uninstall Helm releases in addition to core kubectl operations.

## Changelog

- **2026-07-16** — Refreshed install snippets and fact sheet; verified for 2026.
- **2025-03-01** — Initial directory listing.
