MCP.so
Sign In
Servers

MCP Server Kubernetes

@Flux159

MCP Server for kubernetes management commands

Overview

What is MCP Server Kubernetes?

MCP Server Kubernetes is a Model Context Protocol server that connects to a Kubernetes cluster and enables AI assistants to manage it. It loads kubeconfig from multiple sources in priority order and integrates with clients such as Claude Code, Claude Desktop, VS Code, Cursor, and Gemini CLI. It is intended for developers who need AI-assisted Kubernetes operations.

How to use MCP Server Kubernetes?

Install it via npx (e.g., npx mcp-server-kubernetes) and configure the server in your MCP client’s settings (e.g., claude mcp add kubernetes -- npx mcp-server-kubernetes). The server automatically uses your current kubectl context. Prerequisites: kubectl in PATH, a valid kubeconfig, and cluster access; Helm v3 is optional.

Key features of MCP Server Kubernetes

  • Connects to any Kubernetes cluster accessible via kubectl.
  • Unified kubectl API: get, describe, create, apply, delete, logs, context, explain, scale, patch, rollout, and generic commands.
  • Advanced operations: port forward, Helm install/upgrade/uninstall, pod cleanup, node management.
  • Non-destructive mode that blocks destructive operations.
  • Secrets masking for security.
  • Optional OpenTelemetry observability with distributed tracing.

Use cases of MCP Server Kubernetes

  • Manage Kubernetes resources through natural-language chat prompts in AI assistants.
  • Automatically diagnose pod issues using the built-in /k8s-diagnose troubleshooting flow.
  • Safely monitor and inspect clusters in read‑only or create/update‑only mode.
  • Perform Helm chart operations (install, upgrade, uninstall) via AI-guided commands.

FAQ from MCP Server Kubernetes

What are the prerequisites for running MCP Server Kubernetes?

You need kubectl installed and in your PATH, a valid kubeconfig file with configured contexts, and access to a Kubernetes cluster (e.g., minikube, Rancher Desktop, GKE). Helm v3 is optional.

How do I enable non-destructive mode?

Set the environment variable ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=true when starting the server. This disables all destructive operations (delete, drain, etc.) while keeping read and create/update tools available.

Does MCP Server Kubernetes support observability?

Yes, it includes optional OpenTelemetry integration (disabled by default). Enable it with ENABLE_TELEMETRY=true and configure OTEL_EXPORTER_OTLP_ENDPOINT. Traces can be sent to Jaeger, Grafana Tempo, Datadog, New Relic, and other OTLP-compatible backends.

Where does the server load its configuration from?

By default, it loads kubeconfig from ~/.kube/config. Additional authentication options (environment variables, custom paths) are described in the advanced documentation.

What transport and authentication does the server use?

It uses stdio transport configured through your MCP client. Authentication relies on your existing kubectl context and kubeconfig; no separate credentials are managed by the server itself.

Tags

More from Cloud & Infrastructure