Kubectl MCP Server
Published in CNCF Landscape: A MCP server for Kubernetes.
What is Kubectl MCP Server?
Kubectl MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to published in cncf landscape: a mcp server for kubernetes.
Published in CNCF Landscape: A MCP server for Kubernetes.
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Published in CNCF Landscape: A MCP server for Kubernetes.
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx kubectlConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Kubectl MCP Server
Kubectl MCP Server is a Python-based MCP server published in the CNCF Landscape that enables AI assistants to manage Kubernetes clusters through natural language using 253 dedicated tools covering the full spectrum of cluster operations: pod and workload management, networking, storage, RBAC, Helm, GitOps workflows, service mesh integrations, and cost optimization analysis. It connects directly to your existing kubeconfig, supports multi-cluster switching via context parameters, offers read-only and non-destructive operation modes, and exposes eight workflow prompts for common tasks like security audits, deployment automation, and troubleshooting.
Prerequisites
- Python 3.9+ and pip (for pip installation) or Node.js 14+ for the npm package
- kubectl installed and a valid kubeconfig at ~/.kube/config or a custom path
- Access to a running Kubernetes cluster (local or remote)
- An MCP-compatible client such as Claude Desktop, Cursor, Windsurf, or VS Code
Install the MCP server
Install via pip for Python usage. The npm package kubectl-mcp-tool and a Docker image are also available for the same underlying server.
# Python pip:
pip install kubectl-mcp-server
# With interactive dashboards:
pip install kubectl-mcp-server[ui]
# Docker:
docker run -i -v $HOME/.kube:/root/.kube:ro \
rohitghumare64/kubectl-mcp-server:latestVerify your Kubernetes connection
Confirm kubectl works correctly before wiring up the MCP server, as the server inherits your kubeconfig credentials and RBAC permissions.
kubectl cluster-info
kubectl get nodes
kubectl config current-contextConfigure Claude Desktop
Add the server to your Claude Desktop configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json (macOS).
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "kubectl-mcp-server"],
"env": {
"KUBECONFIG": "/Users/you/.kube/config"
}
}
}
}Set optional environment variables
Fine-tune the server behavior with environment variables for debugging, logging, OAuth authentication, and browser-based dashboards.
# KUBECONFIG=/path/to/kubeconfig (default: ~/.kube/config)
# MCP_DEBUG=true (verbose logging to stderr)
# MCP_LOG_FILE=/tmp/kubectl-mcp.log (persist logs to file)
# MCP_AUTH_ENABLED=true (enable OAuth 2.1)
# MCP_BROWSER_ENABLED=true (enable HTML dashboards)Start with alternative transports
The server defaults to stdio transport. For remote or multi-user setups, use SSE or HTTP transport modes.
# Default stdio:
kubectl-mcp-server
# SSE transport:
kubectl-mcp-server --transport sse --port 8000
# HTTP transport:
kubectl-mcp-server --transport http --port 8000Kubectl MCP Server Examples
Client configuration
Configuration for Claude Desktop. Adjust the kubeconfig path to match your system.
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "kubectl-mcp-server"],
"env": {
"KUBECONFIG": "/Users/you/.kube/config",
"MCP_DEBUG": "false"
}
}
}
}Prompts to try
Leverage natural-language Kubernetes management across all 253 tools with these example prompts.
- "Show me all pods in the kube-system namespace and their resource usage"
- "Create a deployment named nginx-test with 3 replicas using the nginx:latest image"
- "Which nodes have the highest CPU utilization right now?"
- "Run a security audit of all service accounts in the default namespace"
- "Switch to the staging cluster context and list all Helm releases"Troubleshooting Kubectl MCP Server
Server exits immediately with a kubeconfig error on startup
Set the KUBECONFIG environment variable explicitly in the MCP client config to the absolute path of your kubeconfig file. If you have multiple kubeconfig files, merge them first with 'KUBECONFIG=~/.kube/config1:~/.kube/config2 kubectl config view --merge --flatten > ~/.kube/config'.
AI assistant returns 'forbidden' errors for some Kubernetes operations
The server runs with your kubectl user's RBAC permissions. For cluster-admin operations, ensure your kubeconfig uses a service account or user with the cluster-admin ClusterRole. Check with 'kubectl auth can-i create deployments --namespace default'.
pip install fails or imports are missing at runtime
Create a fresh virtual environment and install there: 'python -m venv venv && source venv/bin/activate && pip install kubectl-mcp-server'. Then reference the full path to the Python binary in your MCP client config command.
Frequently Asked Questions about Kubectl MCP Server
What is Kubectl MCP Server?
Kubectl MCP Server is a Model Context Protocol (MCP) server that published in cncf landscape: a mcp server for kubernetes. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Kubectl MCP Server?
Follow the installation instructions on the Kubectl MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Kubectl MCP Server?
Kubectl MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Kubectl MCP Server free to use?
Yes, Kubectl MCP Server is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Kubectl MCP Server Alternatives — Similar Cloud Services Servers
Looking for alternatives to Kubectl MCP Server? 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 Server 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 Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.