Kubectl MCP
A Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters through natural language, supporting core Kubernetes operations, monitoring, security, and diagnostics.
What is Kubectl MCP?
Kubectl MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that enables ai assistants to interact with kubernetes clusters through natural language, supporting core kubernetes operations, monitoring, security, and diagnostics.
A Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters through natural language, supporting core Kubernetes operations, monitoring, security, and diagnostics.
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Model Context Protocol server that enables AI assistants t
Use Cases
Maintainer
Works with
Installation
NPM
npx -y kubectl-mcp-toolManual Installation
npx -y kubectl-mcp-toolConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Kubectl MCP
Kubectl MCP Tool is a feature-rich MCP server that gives AI assistants natural-language control over Kubernetes clusters through 253 purpose-built tools covering pod management, deployments, StatefulSets, services, networking, storage, RBAC, Helm v3, GitOps (Flux/ArgoCD), service meshes (Istio/Cilium), cost optimization, and diagnostics. It is published in the CNCF Landscape and connects directly to your existing kubeconfig, supporting multi-cluster contexts, non-destructive read-only mode, OAuth 2.1 authentication, and six interactive HTML dashboards for visual cluster monitoring.
Prerequisites
- kubectl installed and configured with a valid kubeconfig (~/.kube/config)
- Access to a Kubernetes cluster (local like minikube/kind or remote)
- Node.js 14+ and npx, or Python 3.9+ with pip
- An MCP-compatible client such as Claude Desktop, Cursor, or VS Code
Install the server
The npm package is the easiest zero-install option. A Python pip package and Docker image are also available.
# npm (zero-install):
npx -y kubectl-mcp-tool
# npm global install:
npm install -g kubectl-mcp-tool
# Python pip:
pip install kubectl-mcp-server
# Docker:
docker pull rohitghumare64/kubectl-mcp-server:latestVerify kubectl access
Confirm that kubectl can reach your cluster before connecting the MCP server. The server uses your existing kubeconfig.
kubectl cluster-info
kubectl get nodesConfigure your MCP client
Add the server to your Claude Desktop or other MCP client configuration. The KUBECONFIG environment variable is optional if your config is at the default location.
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "kubectl-mcp-tool"],
"env": {
"KUBECONFIG": "/Users/you/.kube/config",
"MCP_DEBUG": "false"
}
}
}
}Enable optional features
Set environment variables to enable OAuth authentication or browser automation dashboards if needed.
# Environment variables:
# KUBECONFIG=/path/to/kubeconfig (default: ~/.kube/config)
# MCP_DEBUG=true (verbose logging)
# MCP_LOG_FILE=/tmp/mcp.log (log to file)
# MCP_AUTH_ENABLED=true (OAuth 2.1)
# MCP_BROWSER_ENABLED=true (HTML dashboards)Explore available tools
Use the CLI to list all 253 available tools or search for specific ones before using them through an AI client.
# List all tools:
kubectl-mcp-tool tools -d
# Search for pod-related tools:
kubectl-mcp-tool grep "*pod*"
# Call a tool directly:
kubectl-mcp-tool call get_pods '{"namespace": "default"}'Kubectl MCP Examples
Client configuration
Add to claude_desktop_config.json on macOS at ~/Library/Application Support/Claude/claude_desktop_config.json.
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "kubectl-mcp-tool"],
"env": {
"KUBECONFIG": "/Users/you/.kube/config"
}
}
}
}Prompts to try
Natural language Kubernetes operations enabled by the 253 MCP tools across all cluster management domains.
- "List all pods in the production namespace and show their status"
- "Scale the frontend deployment to 5 replicas"
- "Show me all failing pods and their recent events"
- "Run a security audit on the default namespace"
- "List all Helm releases and their current versions"
- "Analyze cost optimization opportunities in the cluster"Troubleshooting Kubectl MCP
MCP server cannot connect to the Kubernetes cluster
Run 'kubectl cluster-info' to verify connectivity. If it fails, check that your VPN is connected (for remote clusters), that the kubeconfig context is correct ('kubectl config current-context'), and that KUBECONFIG points to the right file.
Permission denied errors when running cluster operations
The server uses the same RBAC permissions as your kubeconfig credentials. Check your ClusterRole bindings with 'kubectl auth can-i <verb> <resource>'. For read-only usage, ensure your user has at least 'view' cluster role.
npx kubectl-mcp-tool is slow to start on first run
The first run downloads the package from npm. Use 'npm install -g kubectl-mcp-tool' to install globally and avoid the download on every invocation, or pre-pull with 'npx -y kubectl-mcp-tool --version'.
Frequently Asked Questions about Kubectl MCP
What is Kubectl MCP?
Kubectl MCP is a Model Context Protocol (MCP) server that model context protocol server that enables ai assistants to interact with kubernetes clusters through natural language, supporting core kubernetes operations, monitoring, security, and diagnostics. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Kubectl MCP?
Install via npm with the command: npx -y kubectl-mcp-tool. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Kubectl MCP?
Kubectl MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Kubectl MCP free to use?
Yes, Kubectl MCP is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Kubectl MCP Alternatives — Similar Cloud Services Servers
Looking for alternatives to Kubectl MCP? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
Browse More Cloud Services MCP Servers
Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Kubectl MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Kubectl MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.