mcp-k8s-go

mcp-k8s-go

Golang-based MCP server to browse Kubernetes pods, logs, events, and namespaces.

364
Stars
50
Forks
19
Releases

Overview

An MCP server implemented in Go that connects to a Kubernetes cluster to expose Kubernetes resources through the MCP interface. It enables users to browse and manage resources by context, namespace, and type, including custom mappings for pods, services, and deployments. Core capabilities include listing available Kubernetes contexts, listing namespaces, listing, getting, creating, and modifying resources, listing nodes and pods, retrieving events, and streaming or retrieving pod logs. It also supports executing commands inside a pod. The server can be configured via the KUBECONFIG environment variable (defaulting to ~/.kube/config) and CLI options such as --allowed-contexts to restrict contexts, --readonly to prevent write operations, and --mask-secrets to mask sensitive output. It is designed to be extensible and usable with clients like Claude Desktop and Inspector, with multiple installation options (Smithery, mcp-get, prebuilt binaries, Docker) and multi-arch Docker images. This makes it suitable for developers and operators needing programmatic access to Kubernetes resources via MCP.

Details

Owner
strowk
Language
Go
License
MIT License
Updated
2025-12-07

Features

List Kubernetes contexts

Enumerate all Kubernetes contexts available in the connected cluster.

List Kubernetes namespaces

Return all namespaces in the current context.

List, get, create and modify Kubernetes resources

Operate on Kubernetes resources (including custom mappings for pods, services, deployments) via MCP.

List Kubernetes nodes

Retrieve the cluster's node objects.

List Kubernetes pods

List pods across namespaces and contexts.

Get Kubernetes events

Fetch events for cluster resources to aid debugging and monitoring.

Get Kubernetes pod logs

Access logs for individual pods to diagnose issues.

Run command in Kubernetes pod

Execute commands inside a pod for interactive debugging or automation.

Audience

Claude Desktop usersInteract with the MCP server to select a context/resource and inspect pod logs and other Kubernetes resources.
Inspector usersBrowse Kubernetes resources via Inspector with MCP server support.

Tags

KubernetesMCPGoGolangpodslogseventsnamespacesresourcescontextsInspectorClaudeCLIDockerKUBECONFIGextensible