Skip to main content
Glama

MCP-K8sWizard

README.mdβ€’15.7 kB
# MCP-K8sWizard [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Go Version](https://img.shields.io/badge/Go-1.25.1-blue.svg)](https://golang.org/) [![Kubernetes](https://img.shields.io/badge/Kubernetes-1.31+-blue.svg)](https://kubernetes.io/) [![MCP](https://img.shields.io/badge/MCP-Protocol-green.svg)](https://modelcontextprotocol.io/) [![Makefile](https://img.shields.io/badge/built%20with-Makefile-blue)](Makefile) [![Stars](https://img.shields.io/github/stars/heniv96/MCP-K8sWizard?style=social)](https://github.com/heniv96/MCP-K8sWizard/stargazers) [![Issues](https://img.shields.io/github/issues/heniv96/MCP-K8sWizard)](https://github.com/heniv96/MCP-K8sWizard/issues) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/heniv96/MCP-K8sWizard/pulls) [![Last Commit](https://img.shields.io/github/last-commit/heniv96/MCP-K8sWizard)](https://github.com/heniv96/MCP-K8sWizard/commits/main) > **The Kubernetes Wizard for Modern DevOps** > Streamline your Kubernetes operations with AI-powered natural language interfaces and comprehensive DevOps automation. ## πŸš€ Overview MCP-K8sWizard is a comprehensive Model Context Protocol (MCP) solution designed for professional DevOps teams. It provides natural language interfaces for complex Kubernetes workflows, enabling teams to manage clusters, monitor applications, and execute operational tasks efficiently through AI-powered conversations. ## ✨ Key Features ### 🎯 **Multi-Cloud Kubernetes Management** - **Universal Compatibility**: Native support for EKS, AKS, GKE, RKE2, K3s, and standard Kubernetes distributions - **Intelligent Cluster Detection**: Automatic identification and configuration of cluster types and capabilities - **Advanced Resource Management**: Comprehensive CRUD operations across all Kubernetes resource types - **Real-time Monitoring**: Live cluster health, resource utilization, and performance metrics ### πŸ€– **AI-Powered Operations** - **Natural Language Processing**: Conversational interface for complex DevOps operations - **Intelligent Troubleshooting**: AI-driven diagnostics and step-by-step resolution guidance - **Smart Prompts**: Context-aware prompt suggestions for different scenarios - **Automated Insights**: Proactive identification of potential issues and optimization opportunities ### πŸ”’ **Security & Access Control** - **RBAC Integration**: Full integration with Kubernetes RBAC and identity providers - **Audit Logging**: Comprehensive audit trails for all operations and access - **Secure Communication**: TLS encryption for all communications - **Minimal Privilege**: Secure by design with least privilege access patterns ## πŸ—οΈ Architecture ### MCP Protocol Integration The following diagram shows how MCP-K8sWizard integrates with VSCode/Cursor AI through the Model Context Protocol: ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Cursor AI │───▢│ MCP Protocol │───▢│ MCP-K8sWizard β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ Server β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β” β”‚ Kubernetes β”‚ β”‚ Context β”‚ β”‚ Tool Handlers β”‚ β”‚ API β”‚ β”‚ Manager β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β” β”‚ K8s Tools β”‚ β”‚ Kubectl Tools β”‚ β”‚ Prompt Tools β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Cluster Infoβ”‚ β”‚ β€’ Resource β”‚ β”‚ β€’ Diagnostics β”‚ β”‚ β€’ Resources β”‚ β”‚ CRUD β”‚ β”‚ β€’ Troubleshootβ”‚ β”‚ β€’ Logs/Events β”‚ β”‚ β€’ Scaling β”‚ β”‚ β€’ Optimizationβ”‚ β”‚ β€’ Pod Exec β”‚ β”‚ β€’ Rollouts β”‚ β”‚ β€’ Security β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ### Component Architecture The internal architecture of MCP-K8sWizard follows a layered approach: ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ MCP Layer β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ MCP Server ──▢ Tool Registry ──▢ Request Router β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Core Services β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Context Manager ──▢ K8s Client Manager ──▢ Resource Handler β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ Config Manager ──▢ Event Monitor ──▢ Kubernetes API β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Tool Handlers β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ K8s Tools β”‚ Kubectl Tools β”‚ Prompt Tools β”‚ Context Tools β”‚ β”‚ ───────── β”‚ ──────────── β”‚ ─────────── β”‚ ──────────── β”‚ β”‚ β€’ Cluster Ops β”‚ β€’ Resource Mgmt β”‚ β€’ AI Guidance β”‚ β€’ Multi-Clusterβ”‚ β”‚ β€’ Monitoring β”‚ β€’ CRUD Ops β”‚ β€’ Diagnostics β”‚ β€’ Context Sw. β”‚ β”‚ β€’ Debugging β”‚ β€’ Scaling β”‚ β€’ Optimization β”‚ β€’ Health Chk β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## πŸ› οΈ Available Tools ### **Kubernetes Management Tools (37 Total)** | Category | Tools | Description | |----------|-------|-------------| | **Kubernetes Operations (14)** | `k8s_cluster_info`, `k8s_check_all_clusters`, `ping`, `k8s_list_resources`, `k8s_get_resource`, `k8s_get_logs`, `k8s_get_events`, `k8s_exec_in_pod`, `k8s_natural_language_query` | Direct Kubernetes API operations, monitoring, and debugging | | **Kubectl Operations (12)** | `kubectl_get`, `kubectl_describe`, `kubectl_create`, `kubectl_apply`, `kubectl_delete`, `kubectl_context`, `kubectl_scale`, `kubectl_patch`, `kubectl_rollout`, `kubectl_generic`, `explain_resource`, `list_api_resources` | Full CRUD operations, scaling, rollouts, and resource management via kubectl | | **Context Management (4)** | `k8s_set_context`, `k8s_get_current_context`, `k8s_list_contexts`, `k8s_clear_context` | Multi-cluster context switching and management | | **AI-Powered Guidance (7)** | `k8s_diagnose`, `k8s_troubleshoot`, `k8s_optimize`, `k8s_security`, `k8s_performance`, `k8s_deployment`, `prompt_suggestions` | Intelligent diagnostic, optimization, and troubleshooting prompts | ## πŸš€ Quick Start ### Prerequisites - Go 1.25.1 or later - Kubernetes cluster access (kubeconfig configured) - VSCode/Cursor AI with MCP support - macOS or Linux operating system ### Installation For detailed installation instructions, see our comprehensive [Installation Manual](manuals/installation.md). **Quick Setup:** 1. **Clone and install** ```bash git clone https://github.com/your-org/mcp-k8swizard.git cd mcp-k8swizard make install ``` 2. **Configure Cursor AI** Add to your `~/.cursor/mcp.json`: ```json { "mcpServers": { "k8s-wizard": { "command": "/path/to/mcp-k8swizard", "args": ["--verbose"] } } } ``` 3. **Restart Cursor AI** and start using natural language commands! > πŸ“– **Need detailed instructions?** Check out our [Installation Manual](manuals/installation.md) for step-by-step setup, troubleshooting, and advanced configuration options. ### Basic Usage ```bash # Check cluster health "Show me the status of all my Kubernetes clusters" # List resources "List all pods in the production namespace" # Debug issues "Get logs from the failing pod in the web-app deployment" # Scale applications "Scale the frontend deployment to 5 replicas" # Troubleshoot problems "Help me diagnose why my pod is stuck in Pending state" ``` ## πŸ“‹ Natural Language Examples ### **Cluster Management** ``` "Show me all my Kubernetes clusters and their health status" "Check the resource usage across all nodes in my EKS cluster" "List all namespaces and their resource quotas" ``` ### **Resource Operations** ``` "Create a new namespace called 'staging'" "List all deployments with more than 3 replicas" "Show me the configuration of the nginx service" "Delete all pods with the label 'app=test'" ``` ### **Debugging & Troubleshooting** ``` "Get the logs from the last 100 lines of the api-server pod" "Show me events related to the failing deployment" "Execute a shell command in the debug container" "Why is my pod not starting? Help me troubleshoot" ``` ### **Scaling & Updates** ``` "Scale the web-app deployment to 10 replicas" "Roll out a new version of the frontend service" "Pause the rollout of the database deployment" "Show me the rollout history for the api service" ``` ## πŸ”§ Configuration ### Environment Variables | Variable | Description | Default | |----------|-------------|---------| | `KUBECONFIG` | Path to kubeconfig file | `~/.kube/config` | | `K8S_CONTEXT` | Default Kubernetes context | Current context | | `LOG_LEVEL` | Logging level (DEBUG, INFO, WARN, ERROR) | `INFO` | | `LOG_FILE` | Log file path | `stdout` | ### Command Line Options ```bash ./mcp-k8swizard --help Options: -log-level string Set log level (DEBUG, INFO, WARN, ERROR) -verbose Enable verbose logging (equivalent to DEBUG level) -version Show version information -help Show help information ``` ## 🀝 Contributing We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details. ### Development Setup 1. Fork the repository 2. Create a feature branch 3. Make your changes 4. Submit a pull request ### Development Commands ```bash # Build the project make build # Install dependencies make deps # Format code make fmt # Run linter make lint # Run go vet make vet # Clean build artifacts make clean ``` ### Code Style - Follow Go standard formatting (`gofmt`) - Use meaningful variable and function names - Add comments for public functions ## πŸ“„ License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## πŸ™ Acknowledgments - [Model Context Protocol](https://modelcontextprotocol.io/) for the MCP specification - [Kubernetes](https://kubernetes.io/) for the amazing container orchestration platform - [Go](https://golang.org/) for the excellent programming language - The open-source community for inspiration and support ## πŸ“š Documentation ### Manuals - **[Installation Manual](manuals/installation.md)** - Complete setup guide for Cursor AI integration - **[Configuration Guide](manuals/configuration.md)** - Advanced configuration options - **[Troubleshooting Guide](manuals/troubleshooting.md)** - Common issues and solutions - **[API Reference](manuals/api-reference.md)** - Complete tool documentation ### Quick Links - **Getting Started**: See [Installation Manual](manuals/installation.md) for detailed setup - **Configuration**: Advanced options in [Configuration Guide](manuals/configuration.md) - **Troubleshooting**: Common issues in [Troubleshooting Guide](manuals/troubleshooting.md) ## πŸ“ž Support - **Documentation**: [Wiki](https://github.com/your-org/mcp-k8swizard/wiki) - **Issues**: [GitHub Issues](https://github.com/your-org/mcp-k8swizard/issues) - **Discussions**: [GitHub Discussions](https://github.com/your-org/mcp-k8swizard/discussions) --- **Made with ❀️ for the Kubernetes community**

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/heniv96/MCP-K8sWizard'

If you have feedback or need assistance with the MCP directory API, please join our Discord server