[FEATURE] First-party kubectl tool (or recommended kubectl MCP)

Resolved 💬 0 comments Opened Jun 3, 2026 by yankay Closed Jun 3, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

No first-party way to talk to a Kubernetes cluster. Today I shell out via Bash (kubectl ...): every call hits permission prompts, raw output (get pods -A, describe, YAML) burns context, and read vs. mutate verbs share the same approval flow. Third-party kubectl MCP servers exist but quality and setup vary per-user.

Proposed Solution

Ship a built-in Kubectl tool (or officially-blessed kubectl MCP) that:

  • wraps read verbs (get, describe, logs, events, top, explain) with compressed/structured output
  • honors active kubeconfig + context + namespace, overridable per call
  • separates read verbs (broadly allowlistable) from mutating verbs (apply / delete / patch / scale / exec / port-forward, permission-gated like destructive Bash)
  • surfaces "kubectl missing" / "cluster unreachable" clearly instead of generic Bash failure

Alternative Solutions

  • Third-party kubectl MCP servers — work but per-user setup, varying quality
  • Bash + local rtk kubectl-style filter — what I do today; doesn't help most users

Priority

Medium - Would be very helpful

Feature Category

MCP server integration

Use Case Example

Daily k8s debugging: ask Claude to find a crashlooping pod, pull its logs, check its events, then propose a fix. Today that's 5+ Bash prompts and a flood of YAML; with a structured kubectl tool it'd be a few compact calls.

Additional Context

In enterprise multi-tenant setups, a user's effective cluster access is governed by a platform layer (e.g. DaoCloud kpanda) that issues a per-user, RBAC-scoped kubeconfig. The built-in kubectl tool should support pluggable kubeconfig acquisition — e.g. call out to a configurable provider (kpanda or similar) to fetch a fresh, user-scoped kubeconfig + token, instead of assuming a static ~/.kube/config. This way every kubectl call Claude makes runs under the real user's RBAC, not an over-privileged shared admin config.

Concretely:

  • config setting like kubectl.kubeconfigProvider = "kpanda" | "command:<cmd>" | "file:<path>"
  • provider returns kubeconfig (or just token + server + ca) on demand, with TTL / refresh
  • tool tags each call with the resolved user identity so audit logs on the cluster side stay correct

View original on GitHub ↗