🐍 🏠 - A lightweight yet robust server that empowers AI assistants to securely execute Kubernetes CLI commands…
K8s MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
K8s MCP Server is a Docker-based server implementing Anthropic's Model Context Protocol (MCP) that enables Claude to run Kubernetes CLI tools (kubectl, istioctl, helm, argocd) in a secure, containerized environment.
Demo: Deploy and Troubleshoot WordPress
**Session 1:** Using k8s-mcp-server and Helm CLI to deploy a WordPress application in the claude-demo namespace, then intentionally breaking it by scaling the MariaDB StatefulSet to zero.
**Session 2:** Troubleshooting session where we use k8s-mcp-server to diagnose the broken WordPress site through kubectl commands, identify the missing database issue, and fix it by scaling up the StatefulSet and configuring ingress access..
Demo
How It Works
Claude can help users by:
- Explaining complex Kubernetes concepts
- Running commands against your cluster
- Troubleshooting issues
- Suggesting optimizations
- Crafting Kubernetes manifests
Quick Start with Claude Desktop
Get Claude helping with your Kubernetes clusters in under 2 minutes:
1. **Create or update your Claude Desktop configuration file**:
- **macOS**: Edit $HOME/Library/Application Support/Claude/claude_desktop_config.json
- **Windows**: Edit %APPDATA%\Claude\claude_desktop_config.json
- **Linux**: Edit $HOME/.config/Claude/claude_desktop_config.json
2. **Restart Claude Desktop**
- After restart, you'll see the Tools icon (🔨) in the bottom right of your input field
- This indicates Claude can now access K8s tools via the MCP server
3. **Start using K8s tools directly in Claude Desktop**:
- "What Kubernetes contexts do I have available?"
- "Show me all pods in the default namespace"
- "Create a deployment with 3 replicas of nginx:1.21"
- "Explain what's wrong with my StatefulSet 'database' in namespace 'prod'"
- "Deploy the bitnami/wordpress chart with Helm and set service type to LoadBalancer"
> **Note**: Claude Desktop will automatically route K8s commands through the MCP server, allowing natural conversation about your clusters without leaving the Claude interface.
> **Cloud Providers**: For AWS EKS, GKE, or Azure AKS, you'll need additional configuration. See the Cloud Provider Support guide.
Features
- **Multiple Kubernetes Tools**: kubectl, helm, istioctl, and argocd in one container
- **Cloud Providers**: Native support for AWS EKS, Google GKE, and Azure AKS
- **Security**: Runs as non-root user with strict command validation
- **Command Piping**: Support for common Unix tools like jq, grep, and sed
- **Easy Configuration**: Simple environment variables for customization
Transport Protocols
The server supports three transport protocols, configured via K8S_MCP_TRANSPORT:
| Transport | Description | Default |
|-----------|-------------|---------|
| stdio | Standard I/O (Claude Desktop default) | Yes |
| streamable-http | HTTP transport (recommended for remote/web clients, MCP spec 2025-11-25) | No |
| sse | Server-Sent Events (deprecated, use streamable-http instead) | No |