Installation
Quick Start with npx (Recommended - Zero Install)
# Run directly without installation - works instantly!
npx -y kubectl-mcp-server
# Or install globally for faster startup
npm install -g kubectl-mcp-serverOr install with pip (Python)
# Standard installation
pip install kubectl-mcp-server
# With interactive UI dashboards (recommended)
pip install kubectl-mcp-server[ui]π Table of Contents
- What Can You Do?
- Why kubectl-mcp-server?
- Live Demos
- Installation
- Getting Started
- Quick Setup with Your AI Assistant
- All Supported AI Assistants
- Complete Feature Set
- Using the CLI
- Advanced Configuration
- Optional Features
- Enterprise
- Integrations & Ecosystem
- In-Cluster Deployment
- Multi-Cluster Support
- Architecture
- Agent Skills
- Development & Testing
- Contributing
- Support & Community
What Can You Do?
Simply ask your AI assistant in natural language:
π¬ "Why is my pod crashing?"
- Instant crash diagnosis with logs, events, and resource analysis
- Root cause identification with actionable recommendations
π¬ "Deploy a Redis cluster with 3 replicas"
- Creates deployment with best practices
- Configures services, persistent storage, and health checks
π¬ "Show me which pods are wasting resources"
- AI-powered cost optimization analysis
- Resource recommendations with potential savings
π¬ "Which services can't reach the database?"
- Network connectivity diagnostics with DNS resolution
- Service chain tracing from ingress to pods
π¬ "Audit security across all namespaces"
- RBAC permission analysis
- Secret security scanning and pod security policies
π¬ "Show me the cluster dashboard"
- Interactive HTML dashboards with live metrics
- Visual timeline of events and resource usage
253 powerful tools | 8 workflow prompts | 8 data resources | Works with all major AI assistants
Why kubectl-mcp-server?
- π Stop context-switching - Manage Kubernetes directly from your AI assistant conversations
- π§ AI-powered diagnostics - Get intelligent troubleshooting, not just raw data
- π° Built-in cost optimization - Identify waste and get actionable savings recommendations
- π Enterprise-ready - OAuth 2.1 auth, RBAC validation, non-destructive mode, secret masking
- β‘ Zero learning curve - Natural language instead of memorizing kubectl commands
- π Universal compatibility - Works with Claude, Cursor, Windsurf, Copilot, and 15+ other AI tools
- π Visual insights - Interactive dashboards and browser automation for web-based tools
- βΈοΈ Production-grade - Deploy in-cluster with kMCP, 216 passing tests, active maintenance
From debugging crashed pods to optimizing cluster costs, kubectl-mcp-server is your AI-powered DevOps companion.
Live Demos
Claude Desktop

Cursor AI

Windsurf

Installation
Quick Start with npx (Recommended - Zero Install)
# Run directly without installation - works instantly!
npx -y kubectl-mcp-server
# Or install globally for faster startup
npm install -g kubectl-mcp-serverOr install with pip (Python)
# Standard installation
pip install kubectl-mcp-server
# With interactive UI dashboards (recommended)
pip install kubectl-mcp-server[ui]Install from GitHub Release
# Install specific version directly from GitHub release (replace {VERSION} with desired version)
pip install https://github.com/rohitg00/kubectl-mcp-server/releases/download/v{VERSION}/kubectl_mcp_server-{VERSION}-py3-none-any.whl
# Example: Install v1.19.0
pip install https://github.com/rohitg00/kubectl-mcp-server/releases/download/v1.19.0/kubectl_mcp_server-1.19.0-py3-none-any.whl
# Or install latest from git
pip install git+https://github.com/rohitg00/kubectl-mcp-server.gitPrerequisites
- Python 3.9+ (for pip installation)
- Node.js 14+ (for npx installation)
- kubectl installed and configured
- Access to a Kubernetes cluster
Docker
# Pull from Docker Hub
docker pull rohitghumare64/kubectl-mcp-server:latest
# Or pull from GitHub Container Registry
docker pull ghcr.io/rohitg00/kubectl-mcp-server:latest
# Run with stdio transport
docker run -i -v $HOME/.kube:/root/.kube:ro rohitghumare64/kubectl-mcp-server:latest
# Run with HTTP transport
docker run -p 8000:8000 -v $HOME/.kube:/root/.kube:ro rohitghumare64/kubectl-mcp-server:latest --transport sseGetting Started
1. Test the Server (Optional)
Before integrating with your AI assistant, verify the installation:
# Check if kubectl is configured
kubectl cluster-info
# Test the MCP server directly
kubectl-mcp-server info
# List all available tools
kubectl-mcp-server tools
# Try calling a tool
kubectl-mcp-server call get_pods '{"namespace": "kube-system"}'2. Connect to Your AI Assistant
Choose your favorite AI assistant and add the configuration:
Quick Setup with Your AI Assistant
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "kubectl-mcp-server"]
}
}
}Cursor AI
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "kubectl-mcp-server"]
}
}
}Windsurf
Add to ~/.config/windsurf/mcp.json:
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "kubectl-mcp-server"]
}
}
}Using Python Instead of npx
{
"mcpServers": {
"kubernetes": {
"command": "python",
"args": ["-m", "kubectl_mcp_tool.mcp_server"],
"env": {
"KUBECONFIG": "/path/to/.kube/config"
}
}
}
}More integrations: GitHub Copilot, Goose, Gemini CLI, Roo Code, and 15+ other clients β> see full configuration guide below.
3. Restart Your AI Assistant
After adding the configuration, restart your AI assistant (GitHub Copilot, Claude Code,Claude Desktop, Cursor, etc.) to load the MCP server.
4. Try These Commands
Start a conversation with your AI assistant and try these:
Troubleshooting:
"Show me all pods in the kube-system namespace"
"Why is the nginx-deployment pod crashing?"
"Diagnose network connectivity issues in the default namespace"Deployments:
"Create a deployment for nginx with 3 replicas"
"Scale my frontend deployment to 5 replicas"
"Roll back the api-server deployment to the previous version"Cost & Optimization:
"Which pods are using the most resources?"
"Show me idle resources that are wasting money"
"Analyze cost optimization opportunities in the production namespace"Security:
"Audit RBAC permissions in all namespaces"
"Check for insecure secrets and configurations"
"Show me pods running with privileged access"Helm:
"List all Helm releases in the cluster"
"Install Redis from the Bitnami chart repository"
"Show me the values for my nginx-ingress Helm release"Multi-Cluster:
"List all available Kubernetes contexts"
"Switch to the production cluster context"
"Show me cluster information and version"MCP Client Compatibility
Works seamlessly with all MCP-compatible AI assistants:
| Client | Status | Client | Status |
|---|---|---|---|
| Claude Desktop | β Native | Claude Code | β Native |
| Cursor | β Native | Windsurf | β Native |
| GitHub Copilot | β Native | OpenAI Codex | β Native |
| Gemini CLI | β Native | Goose | β Native |
| Roo Code | β Native | Kilo Code | β Native |
| Amp | β Native | Trae | β Native |
| OpenCode | β Native | Kiro CLI | β Native |
| Antigravity | β Native | Clawdbot | β Native |
| Droid (Factory) | β Native | Any MCP Client | β Compatible |
All Supported AI Assistants
Claude Code
Add to ~/.config/claude-code/mcp.json:
{
"mcpServers": {
"kubernetes": {
"comman
β¦