MCP Kubernetes logo

MCP Kubernetes

Inspect and manage Kubernetes clusters through guarded MCP tools with read-only defaults, scoped access, and optional write operations.

Install MCP Kubernetes

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-kubernetes": {
      "command": "npx",
      "args": [
        "-y",
        "@dockndevai/mcp-kubernetes"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @dockndevai/mcp-kubernetes

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The mcp-kubernetes MCP server exposes Kubernetes inspection and operations through MCP-compatible clients. It uses kubeconfig or an in-cluster service account and supports multiple Kubernetes contexts, with optional namespace and context allowlists. Read-only mode is the default; scaling, restarts, manifest application, deletion, and pod exec require progressively stronger settings. Reach for it when an AI agent needs controlled cluster visibility or narrowly permitted operational actions.

Use cases

  • Inspect pod health, logs, events, and resource state
  • Monitor several permitted Kubernetes contexts
  • Scale or restart deployments with explicit write access
  • Preview guarded changes using dry-run mode
  • Restrict agent operations to approved namespaces

Key features

  • Multi-context Kubernetes access
  • Read-only, read-write, and admin modes
  • Namespace and context allowlists
  • Separate gates for delete, apply, and exec
  • Dry-run and JSON audit logging
  • Optional laya-guard risk checks

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

13/13 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 3d ago via OSV.dev · @dockndevai/mcp-kubernetes (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
npm downloads778Package downloads in the last 30 days.
Last commit6d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Kubernetes works

What mcp-kubernetes does

The mcp-kubernetes MCP server connects an MCP-capable client to Kubernetes clusters and exposes tools for cluster inspection and operations. Each tool can target an optional kubeconfig context, allowing one server process to work with multiple clusters when those contexts are permitted.

The default access level is read-only. In this mode, an agent can inspect contexts, namespaces, pods, deployments, services, nodes, events, and individual resources. It can also retrieve pod details and logs. Higher access modes add selected operational tools rather than exposing every capability at once.

This arrangement suits teams that want an agent to investigate cluster state without granting it unrestricted mutation rights. It can also support controlled operational workflows where write or administrative actions are enabled deliberately.

How it works

The mcp-kubernetes MCP server runs as an npm package through npx, using the standard MCP process connection expected by configured clients. Authentication comes from the local kubeconfig or an in-cluster service account; the server does not store credentials.

Access is layered through K8S_MODE:

  • read-only registers read tools only.
  • read-write adds deployment scaling, restarts, image changes, namespace creation, and permitted manifest application.
  • admin adds the destructive and pod-execution tools, subject to their separate gates.

Namespace and context allowlists restrict where operations may run. The default protected namespaces—kube-system, kube-public, and kube-node-lease—remain readable but cannot be changed or deleted. Delete, apply, and exec each have independent opt-ins, so enabling admin mode alone does not enable those actions.

Write and administrative operations can run in dry-run mode. Guarded activity is emitted as JSON lines to stderr, including allowed, denied, or dry-run outcomes. Destructive and high-impact actions request human approval through MCP elicitation when the client supports it. An optional local laya-guard daemon can further classify apply, delete, and exec requests; it can restrict actions but cannot grant access.

Setup and configuration

The published package is @dockndevai/mcp-kubernetes. Configure an MCP client to run npx -y @dockndevai/mcp-kubernetes and provide the relevant environment settings. The README gives configurations for Claude Desktop, Claude Code, Cursor, Windsurf, OpenAI Codex CLI, and VS Code. A typical starting configuration sets KUBECONFIG_PATH and K8S_MODE=read-only.

For source-based development, install dependencies, build the project, and run node dist/index.js. The repository also provides development, test, and type-check scripts.

Tools and capabilities

Read tools include context and namespace listing, pod listing and details, pod logs, deployment and service listing, node and event listing, and generic resource retrieval.

Write tools include deployment scaling, deployment restarts, image updates, namespace creation, and manifest application. Applying a manifest additionally requires K8S_ALLOW_APPLY.

Administrative tools include resource deletion and execution inside a pod. They require admin mode plus K8S_ALLOW_DELETE or K8S_ALLOW_EXEC, respectively. The server also supports namespace and context scoping, dry-run behavior, JSON audit logging, and optional laya-guard checks.

Limitations and notes

The server does not provide its own credential store or authentication system; access depends on the kubeconfig or in-cluster service account available to the process. All namespaces and contexts are reachable by default unless allowlists are configured, so deployments should set those restrictions when a narrower scope is required.

Operational permissions are intentionally split across mode settings and action-specific flags. Clients without MCP elicitation use the corresponding allow gates instead of interactive approval. The optional laya-guard integration requires a separately running local daemon and only tightens decisions; it does not bypass the server’s existing permissions.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Kubernetes

mcp-kubernetes is an MCP server that connects AI clients to Kubernetes clusters through kubeconfig or an in-cluster service account. Its main tools list and inspect contexts, namespaces, pods, deployments, services, nodes, events, and resources, with additional guarded tools for scaling, restarting, applying manifests, deleting resources, and executing in pods.

Run it from npm with `npx -y @dockndevai/mcp-kubernetes` in your MCP client configuration. Set `KUBECONFIG_PATH` when using a kubeconfig file and start with `K8S_MODE=read-only`; the README includes examples for several supported clients.

Set `K8S_MODE=read-write` to expose write tools such as scaling, restarting, image updates, and namespace creation. Manifest application also requires `K8S_ALLOW_APPLY=true`; deletion and pod execution require admin mode and their own independent allow flags.

Yes, set `K8S_CONTEXT_ALLOWLIST` to restrict kubeconfig contexts and `K8S_NAMESPACE_ALLOWLIST` to restrict namespaces. Protected system namespaces remain readable but cannot be mutated or deleted by the server.

Yes, the README provides a Cursor configuration using the standard stdio command `npx -y @dockndevai/mcp-kubernetes`. Add the server under `.cursor/mcp.json` and provide the Kubernetes connection and access-mode environment settings.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Kubernetes AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-kubernetes?style=directory)](https://allmcps.com/mcp/mcp-kubernetes)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-kubernetes"><img src="https://allmcps.com/api/badge/mcp-kubernetes?style=directory" alt="MCP Kubernetes on AllMCPs" /></a>