How flux159/mcp-server-kubernetes works
MCP Server Kubernetes exposes cluster-management tools, resources, and a troubleshooting prompt to MCP clients. The principal workflow is a client tool request, dispatch through the MCP server, execution by a Kubernetes or Helm operation, and interaction with the configured cluster. Separate tool families cover inspection, mutation, operations, and chart management; resource reads and the diagnostic prompt are additional product capabilities. Kubeconfig handling, command safeguards, and optional telemetry support the runtime. Several subsystem links reflect README capabilities whose implementation was not sampled; those links are limited to documented responsibilities.
Main entry points: index.ts MCP Entry · kubernetes-manager.ts Kubernetes Manager · kubectl-get.ts Read and Inspect · kubectl-context.ts Context Operations
Components 24
MCP Server
- MCP Entry
src/index.ts - Resource Handlers
src/resources/handlers.ts - Diagnostic Prompt
src/prompts/index.ts
Cluster Access
- Kubernetes Manager
src/utils/kubernetes-manager.ts - Kubeconfig Sources
src/utils/kubernetes-manager.ts - kubectl CLI
Kubernetes Operations
- Read and Inspect
src/tools/kubectl-get.ts - Describe and Logs
src/tools/kubectl-describe.ts - Create and Apply
src/tools/kubectl-apply.ts - Delete and Patch
src/tools/kubectl-delete.ts - Workload Operations
src/tools/kubectl-rollout.ts - Context Operations
src/tools/kubectl-context.ts - Generic kubectl
src/tools/kubectl-generic.ts - Helm Operations
src/tools/helm-operations.ts
Product Extensions
- Advanced Operations
src/tools/node-management.ts - Port Forwarding
src/tools/port_forward.ts - Pod Execution
src/tools/exec_in_pod.ts
Runtime Support
- Telemetry
src/config/telemetry-config.ts - Telemetry Middleware
src/middleware/telemetry-middleware.ts - Command Safeguards
src/security/kubectl-flags.ts - HTTP Authentication
src/utils/auth.ts
Other components
- MCP Client
- Kubernetes Cluster
- Helm CLI
Connections 27
- MCP Client → MCP Entry: sends requests
- MCP Entry → Resource Handlers: registers resources
- Resource Handlers → Kubernetes Manager: reads resources
- MCP Entry → Diagnostic Prompt: registers prompt
- MCP Entry → Read and Inspect: dispatches tools
- MCP Entry → Describe and Logs: dispatches tools
- MCP Entry → Create and Apply: dispatches tools
- MCP Entry → Delete and Patch: dispatches tools
- MCP Entry → Workload Operations: dispatches tools
- MCP Entry → Context Operations: dispatches tools
- MCP Entry → Generic kubectl: dispatches tools
- MCP Entry → Helm Operations: dispatches tools
- MCP Entry → Advanced Operations: dispatches tools
- MCP Entry → Port Forwarding: dispatches tools
- MCP Entry → Pod Execution: dispatches tools
- Kubernetes Manager → Kubeconfig Sources: loads configuration
- Kubernetes Manager → Kubernetes Cluster: uses Kubernetes API
- Read and Inspect → kubectl CLI: executes commands
- Context Operations → kubectl CLI: executes commands
- kubectl CLI → Kubernetes Cluster: queries or changes
- Helm Operations → Helm CLI: runs operations
- Helm CLI → Kubernetes Cluster: manages releases
- MCP Entry → Telemetry: initializes
- MCP Entry → Telemetry Middleware: uses instrumentation
- Read and Inspect → Command Safeguards: validates arguments
- Context Operations → Command Safeguards: executes safely
- MCP Entry → HTTP Authentication: HTTP requests