Labsco
MCP SERVER

Kubernetes

by Flux159

Let an agent run kubectl and Helm against a cluster you can already reach — read the state, change it, and watch the rollout — without leaving the conversation.

Containers, Kubernetes & Cluster OperationsOfficial source
Summary
An agent can operate the cluster, not only read it.

What it takes off you is the terminal round trip: the verbs you would have typed — get, describe, logs, apply, scale, rollout, drain — arrive as tools, so the investigation and the fix it implies happen in the same conversation. How far that goes is yours to set: read-only, non-destructive, or an explicit tool list, decided at startup rather than per call.

What it is

A kubectl and Helm surface over a cluster. Most calls mirror a kubectl verb one for one, and a generic call falls through to any kubectl command for what the named ones do not cover. Values from `kubectl get secrets` come back masked unless you turn that off.

What you get
  • Get and describe any resource type, in one namespace or across all of them, filtered by label or field selector
  • Apply, create, patch, delete and scale — from a manifest string or a file, with a dry run available on several of them
  • Logs from pods, deployments and jobs: tailed, followed, since a timestamp, or from the previous container
  • Rollout management on deployments, daemonsets and statefulsets, including a rollback to a named revision
  • Cordon, drain and uncordon on nodes, with a dry run and a grace period
  • Helm install, upgrade and uninstall, from a repo chart or a template, with values inline or from a file
  • A port forward to a resource, and a separate call to stop it again
  • A command run inside a pod, passed as an argument array rather than a shell string
  • The API resources the cluster exposes, and the reference documentation for a resource or a single field
  • Context listing, reading and switching, and a reconnect that rebuilds every API client after a control-plane upgrade rotates addresses
  • A fall-through to any kubectl command with your own arguments and flags
  • A k8s-diagnose prompt that walks a pod problem from a keyword and an optional namespace through to a remediation suggestion
  • Three ways to narrow what the agent can do: ALLOW_ONLY_READONLY_TOOLS, ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS for read plus create and update, or ALLOWED_TOOLS as an explicit list
Requirements

Npx on your PATH, kubectl installed, and a cluster kubectl can already reach — `kubectl get pods` succeeding in a terminal is the check. It follows your current context by default; KUBECONFIG_PATH points at a different file, and KUBECONFIG_YAML or KUBECONFIG_JSON pass the config inline for containers with no file to mount. Secrets are masked in responses unless MASK_SECRETS is set to false.

Setup effort

One command — npx mcp-server-kubernetes