MCP/Kubernetes MCP Server
Kubernetes MCP Server logo

Kubernetes MCP Server

Verified Golden (1000+ GitHub stars)

Unified kubectl and Helm v3 MCP server for cluster discovery, resource inspection, deployment rollouts, and OpenTelemetry tracing.

developer-tools•Cloud & Infrastructure
GitHub1.6k
License:MIT
VERIFIED

About this Server

Kubernetes MCP Server (`mcp-server-kubernetes`) provides coding agents with complete, secure access to Kubernetes clusters and Helm v3 charts. It wraps kubectl commands for listing, describing, creating, patching, and scaling resources, inspecting pod logs, managing contexts, cordoning/draining nodes, cleaning problematic pods, running k8s-diagnose troubleshooting flows, and exporting OpenTelemetry traces.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

Non-Destructive Mode Guard: Set ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=true to disable kubectl_delete, uninstall_helm, and pod exec.
Secrets Masking: Automatically masks sensitive data when inspecting secrets via kubectl get secrets.
Kubeconfig Least Privilege: Operates with the RBAC permissions granted to the active kubeconfig context.

When to Use (and When Not To)

Best For
  • •Troubleshooting crashing pods, failed deployments, and viewing cluster events directly in your editor
  • •Scaling workloads, updating Helm release configurations, and applying Kubernetes YAML manifests
  • •Running automated k8s-diagnose incident investigations without leaving your AI assistant
Not For / Limitations
  • •Local Docker container sandbox orchestration (use Docker MCP Gateway instead)
  • •Relational database query tuning and snapshot rollbacks (use Rowsafe MCP instead)
  • •Agent rules and markdown steering file linting (use Asitis Agent Tools instead)

Install & Setup

terminal command
$claude mcp add kubernetes -- npx -y mcp-server-kubernetes

Exposed Tools & Endpoints

10 tools

Functions your AI agent can invoke via this Model Context Protocol server

kubectl_get

Lists or retrieves Kubernetes resources (pods, services, deployments, configmaps) in standard or JSON/YAML format.

kubectl_describe

Shows detailed resource status, events, and configuration attributes for troubleshooting.

kubectl_logs

Streams or dumps container logs for a pod with tail, previous, and container selection.

kubectl_apply

Applies a configuration manifest from YAML/JSON to the connected Kubernetes cluster.

kubectl_scale

Scales replica counts for deployments, replica sets, or stateful sets.

kubectl_rollout

Manages rollout status, history, pauses, resumes, and restarts for deployments.

kubectl_context

Lists, retrieves, or switches the active kubectl cluster context.

install_helm_chart

Installs or upgrades Helm v3 charts with custom values and repository targets.

port_forward

Forwards local ports to a Kubernetes pod or service for temporary debugging.

cleanup_pods

Cleans up problematic pods stuck in Evicted, Error, ImagePullBackOff, or CrashLoopBackOff states.