kubectl-mcp-server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Control your entire Kubernetes infrastructure through natural language conversations with AI.
Talk to your clusters like you talk to a DevOps expert. Debug crashed pods, optimize costs, deploy applications, audit security, manage Helm charts, and visualize dashboards, all through natural language.
Part of CNCF Landscape, Next to Terraform
---
Installation
Quick Start with npx (Recommended - Zero Install)
Or install with pip (Python)
---
📑 Table of Contents
- What Can You Do?
- Why kubectl-mcp-server?
- Live Demos
- Installation
- Quick Start with npx
- Install with pip
- Docker
- Getting Started
- Quick Setup with Your AI Assistant
- All Supported AI Assistants
- Complete Feature Set
- Using the CLI
- Advanced Configuration
- Optional Features
- Interactive Dashboards
- Browser Automation
- 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)
Or install with pip (Python)
Install from GitHub Release
Prerequisites
- **Python 3.9+** (for pip installation)
- **Node.js 14+** (for npx installation)
- **kubectl** installed and configured
- Access to a Kubernetes cluster
Docker
Getting Started
1. Test the Server (Optional)
Before integrating with your AI assistant, verify the installation:
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:
Cursor AI
Add to ~/.cursor/mcp.json:
Windsurf
Add to ~/.config/windsurf/mcp.json:
Using Python Instead of npx
**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:**
**Deployments:**
**Cost & Optimization:**
**Security:**
**Helm:**
**Multi-Cluster:**
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 |