list_contexts
List kube-config contexts
List the contexts (clusters) available in the loaded kube-config.
Takes no parameters.

io.github.dockndevaiPublished by GitHub account dockndevaiv0.3.3Updated Oct 26, 2026
Kubernetes monitoring & ops for AI agents — safe-by-default access modes and guards.
Local MCP server that lets an AI assistant inspect and operate Kubernetes clusters across contexts, read-only by default with layered safety gates.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Follow the launch instructions in the repository.
A Model Context Protocol server for Kubernetes. It lets an MCP-capable client (Claude Desktop, Claude Code, etc.) inspect and operate Kubernetes clusters across multiple contexts — with behaviour controlled entirely by flags.
The design goal is safe by default: it starts read-only, can be scoped to an allowlist of namespaces and contexts, protects system namespaces from mutation, and gates the dangerous operations (delete, apply, exec) behind explicit opt-ins.
context; scope which contexts are usable with an allowlist.read-only → read-write → admin, layered so a mode never exposes tools above its level.The layers are independent — e.g. admin mode with all three opt-ins false can restart and scale deployments but can neither delete resources nor exec into pods.
Read (read-only+): list_contexts, list_namespaces, list_pods, get_pod, get_pod_logs, list_deployments, list_services, list_nodes, list_events, get_resource
Write (read-write+): scale_deployment, restart_deployment, set_deployment_image, create_namespace, apply_manifest (needs K8S_ALLOW_APPLY)
Admin (admin): delete_resource (needs K8S_ALLOW_DELETE), exec_in_pod (needs K8S_ALLOW_EXEC)
Optional AI risk guard. Set K8S_GUARD_MODE=monitor|enforce to have delete_resource, exec_in_pod and apply_manifest consult a local laya-guard daemon (pipx install laya-guard && laya-guard) that classifies the operation allow/confirm/block before it runs. Runs after the delete/exec/apply gates; only tightens, never grants; fails closed.
Published on npm as @dockndevai/mcp-kubernetes. No clone or build needed — your MCP client runs it on demand with npx. Start in read-only mode; see .env.example for every variable and docs/CLIENTS.md for the full per-client guide.
Claude Code (CLI)
Claude Desktop · Cursor · Windsurf — same block in claude_desktop_config.json, .cursor/mcp.json, or ~/.codeium/windsurf/mcp_config.json:
OpenAI Codex CLI — in ~/.codex/config.toml:
VS Code (GitHub Copilot, Agent mode) — in .vscode/mcp.json:
Prefer the published package above. To run from a clone:
This server ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md for publishing to npm and listing on the MCP registry, Smithery, Glama, Cursor, and PulseMCP.
MIT
Source: README.md at commit abda11f
List kube-config contexts
List the contexts (clusters) available in the loaded kube-config.
Takes no parameters.
List namespaces
List namespaces in the cluster. Namespaces outside the allowlist are filtered out.
contextList pods
List pods in a namespace with status, readiness, restarts, and node.
contextnamespacerequiredGet pod
Fetch the full representation of a single pod.
namerequiredcontextnamespacerequiredGet pod logs
Fetch recent logs from a pod container.
namerequiredcontextpreviouscontainernamespacerequiredtailLinesList deployments
List deployments in a namespace with replica status.
contextnamespacerequiredList services
List services in a namespace with type and cluster IP.
contextnamespacerequiredList nodes
List cluster nodes with readiness and kubelet version.
contextList events
List recent events in a namespace — useful for diagnosing failures.
contextnamespacerequiredGet any resource
Read an arbitrary Kubernetes object by apiVersion/kind/name (e.g. apiVersion=apps/v1, kind=Deployment).
kindrequirednamerequiredcontextnamespaceapiVersionrequired90% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
claude mcp add kubernetes -e KUBECONFIG_PATH="/Users/you/.kube/config" -e K8S_MODE="read-only" -- npx -y @dockndevai/mcp-kubernetes{ "mcpServers": { "kubernetes": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-kubernetes" ], "env": { "KUBECONFIG_PATH": "/Users/you/.kube/config", "K8S_MODE": "read-only" } } }}[mcp_servers.kubernetes]command = "npx"args = ["-y", "@dockndevai/mcp-kubernetes"]env = { KUBECONFIG_PATH = "/Users/you/.kube/config", K8S_MODE = "read-only" }{ "servers": { "kubernetes": { "type": "stdio", "command": "npx", "args": [ "-y", "@dockndevai/mcp-kubernetes" ], "env": { "KUBECONFIG_PATH": "/Users/you/.kube/config", "K8S_MODE": "read-only" } } }}npm installnpm run buildnode dist/index.js # with the environment variables setnpm run dev # watch modenpm test # unit tests for the security policynpm run typecheck