json-rpc mcp protocol bridge to kubernetes api
Implements a standardized Model Context Protocol server that translates JSON-RPC requests from MCP clients (like Claude Desktop) into Kubernetes API calls via the official Go client library. The server handles protocol initialization handshakes, capability negotiation, request routing, and response serialization, acting as a stateless gateway that maintains no persistent connection state between requests.
Unique: Implements MCP as a pure protocol bridge in Go, leveraging the official Kubernetes client library for API interactions rather than wrapping kubectl, enabling direct access to cluster state without subprocess overhead or parsing fragility
vs alternatives: More reliable than shell-based kubectl wrappers because it uses the native Go Kubernetes client library, avoiding parsing and subprocess management complexity that plagues other MCP-to-K8s implementations
multi-context kubernetes cluster switching with resource isolation
Manages multiple Kubernetes contexts (cluster configurations) from a single kubeconfig file, allowing clients to list available contexts and switch between them for subsequent operations. Each context maintains isolated authentication credentials, API endpoints, and namespace defaults, with the server routing all resource queries to the currently active context without cross-context leakage.
Unique: Uses Go's official Kubernetes client library's context abstraction to manage multiple cluster connections, allowing seamless switching without reinitializing the entire client pool — each context maintains its own REST client with isolated credentials
vs alternatives: Safer than kubectl-based approaches because context switching is enforced at the Go client library level, preventing accidental cross-cluster operations that could occur with shell script context switching
kubernetes context and namespace resource exposure through mcp resources
Exposes Kubernetes contexts and namespaces as MCP resources, allowing clients to discover and reference them in prompts and tool calls. The implementation registers these resources with the MCP server, making them discoverable through the MCP protocol and enabling clients to build context-aware interfaces that reference available clusters and namespaces.
Unique: Implements MCP resources as a discovery mechanism for Kubernetes contexts and namespaces, enabling clients to build context-aware interfaces without requiring manual configuration or hardcoded references
vs alternatives: More discoverable than hardcoded context lists because it uses the MCP resources protocol to expose available contexts dynamically, enabling clients to adapt to different kubeconfig configurations
pod log streaming and retrieval with tail and follow options
Retrieves logs from Kubernetes pods using the Kubernetes API's log endpoint, supporting both historical log retrieval and real-time streaming. The implementation uses the official Go client's PodLogs interface to fetch logs with configurable tail lines, timestamps, and container selection, returning logs as plain text that can be parsed or displayed by the client.
Unique: Uses the Kubernetes API's native log endpoint via the Go client library rather than executing 'kubectl logs' subprocesses, providing direct access to the kubelet's log buffer with lower latency and no parsing overhead
vs alternatives: More efficient than shell-based log retrieval because it avoids subprocess spawning and text parsing, directly consuming the Kubernetes API response stream
in-pod command execution with container selection and output capture
Executes arbitrary commands inside running containers using the Kubernetes API's exec endpoint, establishing a bidirectional stream to the pod's container runtime (typically containerd or Docker). The implementation uses the Go client's RemoteCommandExecutor to handle stdin/stdout/stderr multiplexing, returning command output as plain text with exit codes.
Unique: Leverages the Kubernetes API's native exec endpoint with proper stream multiplexing via the Go client library, avoiding the complexity and fragility of kubectl exec subprocess management while maintaining full compatibility with container runtimes
vs alternatives: More reliable than kubectl exec wrappers because it uses the native Go client's stream handling, preventing issues with output buffering, signal handling, and terminal emulation that plague shell-based exec implementations
resource listing with namespace filtering and type selection
Lists Kubernetes resources (pods, deployments, services, nodes, events, etc.) across single or multiple namespaces with optional filtering by label selectors or field selectors. The implementation uses the Go client's dynamic client or typed clients to query the API server, returning structured resource metadata that can be filtered and sorted by the client.
Unique: Uses the Kubernetes Go client's typed and dynamic clients to query resources with native label/field selector support, avoiding the parsing fragility of kubectl output parsing while maintaining full API compatibility
vs alternatives: More scalable than kubectl-based listing because it uses the native API client with proper selector handling, avoiding subprocess overhead and text parsing that becomes problematic with large result sets
detailed resource inspection with full object retrieval
Retrieves the complete specification and status of a specific Kubernetes resource (pod, deployment, service, etc.) by name and namespace, returning the full resource object with all metadata, spec, and status fields. The implementation uses the Go client's typed or dynamic client Get method to fetch the resource from the API server, returning the complete object as JSON.
Unique: Uses the Kubernetes Go client's Get method to retrieve complete resource objects with all nested fields intact, avoiding the information loss that occurs when parsing kubectl describe output or truncated JSON
vs alternatives: More complete than kubectl describe because it returns the raw API object with all fields, enabling programmatic analysis without parsing human-readable output
yaml configuration application and resource creation
Applies Kubernetes resource definitions provided as YAML documents to the cluster, creating or updating resources as needed. The implementation parses YAML into Kubernetes objects, uses the Go client's Apply method (or Create/Update fallback) to submit them to the API server, and returns the applied resource state with any validation or conflict errors.
Unique: Uses the Kubernetes Go client's Apply method with server-side apply semantics, enabling idempotent resource updates without client-side state tracking, and supporting multi-document YAML with proper ordering
vs alternatives: Safer than kubectl apply wrappers because it uses the native Go client's Apply method with proper conflict resolution, avoiding issues with kubectl's client-side state management and enabling true idempotent operations
+3 more capabilities