MCP Server Kubernetes
@Flux159
About MCP Server Kubernetes
MCP Server for kubernetes management commands
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": [
"mcp-server-kubernetes"
]
}
}
}Tools
23Cleanup all managed resources
Get or list Kubernetes resources by resource type, name, and optionally namespace
Describe Kubernetes resources by resource type, name, and optionally namespace
Apply a Kubernetes YAML manifest from a string or file
Delete Kubernetes resources by resource type, name, labels, or from a manifest file
Create Kubernetes resources using various methods (from file or using subcommands)
Get logs from Kubernetes resources like pods, deployments, or jobs
Scale a Kubernetes deployment
Update field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch
Manage the rollout of a resource (e.g., deployment, daemonset, statefulset)
Manage Kubernetes contexts - list, get, or set the current context
Reconnect to the Kubernetes API server by recreating all API clients. Use this after cluster upgrades (e.g., EKS control plane upgrades that rotate ENIs/IPs) to force fresh DNS resolution and new TCP connections.
Get documentation for a Kubernetes resource or field
Install a Helm chart with support for both standard and template-based installation
Upgrade an existing Helm chart release
Uninstall a Helm chart release
Manage Kubernetes nodes with cordon, drain, and uncordon operations
Forward a local port to a port on a Kubernetes resource
Stop a port-forward process
Execute a command in a Kubernetes pod or container and return the output. Command must be an array of strings where the first element is the executable and remaining elements are arguments. This executes directly without shell interpretation for security.
List the API resources available in the cluster
Execute any kubectl command with the provided arguments and flags
Verify that the counterpart is still responsive and the connection is alive.
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.
Frequently asked questions
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.
Basic information
More Cloud & Infrastructure MCP servers
Terraform MCP Server
hashicorpThe Terraform MCP Server provides seamless integration with Terraform ecosystem, enabling advanced automation and interaction capabilities for Infrastructure as Code (IaC) development.
MCP Gateway
mcp-ecosystem🧩 MCP Gateway - A lightweight gateway service that instantly transforms existing MCP Servers and APIs into MCP servers with zero code changes. Features Docker deployment and management UI, requiring no infrastructure modifications.
Firebase MCP
gannonh🔥 Model Context Protocol (MCP) server for Firebase.
MCP Server that interacts with Azure AI Foundry (experimental)
azure-ai-foundryA MCP Server for Azure AI Foundry: it's now moved to cloud, check the new Foundry MCP Server
🐳 docker-mcp
QuantGeekDevA docker MCP Server (modelcontextprotocol)
Comments