How rohitg00/kubectl-mcp-server works
Project Type and Purpose
• This project is a tool designed to integrate Kubernetes operations with AI assistants using the Model Context Protocol (MCP). It functions in two modes—CLI for direct command-line execution and Server mode for handling MCP requests from assistants like Claude, Cursor, and Windsurf.
• The tool exposes core Kubernetes operations (like pod management, logs, deployments, scaling, etc.), enhanced by natural language processing, monitoring, security, and diagnostics capabilities.
File Structure
• The top-level “kubectl_mcp_tool” directory represents the main package and contains modules such as CLI, core operations (e.g., mcp_server.py, mcp_kubectl_tool.py), natural language processing, diagnostics, security, monitoring, and utility functions.
• The “compatible_servers” directory holds various server implementations (for Cursor, Windsurf, generic, and a minimal version), which shows support for multiple integration environments.
• The “docs” directory and related integration documentation for each AI assistant illustrate the project’s emphasis on providing plug-and-play support for external tools.
• There’s also a “python_tests” suite for validating functionalities, highlighting a well-tested and modular design.
• Configuration scripts (install.sh, start_mcp_server.sh) and setup scripts (setup.py, requirements.txt) are included to assist deployment and development.
Extract Key Architectural Components from the README
• The README describes several main components:
– MCP Server: The core server that processes commands from MCP clients.
– Tools Registry: A mapping of Kubernetes operations into MCP “tools” using registered schemas.
– Transport Layer: Supports multiple transport protocols (stdio, SSE, HTTP) for communication.
– Core Operations: The component that translates natural language or MCP tool calls into actual Kubernetes API interactions.
– Response Formatter: Converts responses from Kubernetes back into MCP-compliant formats.
• It also outlines the dual mode operation: CLI Mode and Server Mode.
• Documentation details the integration with specific AI assistants by providing sample configuration files (with minimal_wrapper, for example) for Claude, Cursor, and Windsurf.
Elements to Incorporate
• Clear labels for each of the following:
– MCP Server
– Tools Registry
– Transport Layer (with sub-labels for stdio, SSE, HTTP)
– Core Operations (interface with Kubernetes API)
– Response Formatter
– CLI Mode
– Compatible Servers (Cursor, WindSurf, Generic, Minimal)
– Kubernetes Cluster (as an external component)