Get the FREE Ultimate OpenClaw Setup Guide →

mcp -k8s-go

Sample MCP server for Kubernetes, written in Go

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nokamoto-mcp-server-k8s-go /go/bin/mcp-server-k8s-go \
  --env KUBECONFIG="/home/codespace/.kube/config"

How to use

This MCP server is a sample implementation of an MCP (Model Context Protocol) server written in Go that is designed to work with Kubernetes (K8s). It provides an MCP interface for interacting with Kubernetes-like resources via the MCP protocol, and can be tested using the Studio transport (stdio) to send requests and receive responses through standard input and output. To try it locally, you can start Minikube, optionally create a sample Kubernetes deployment, and then run the MCP server binary to begin handling MCP messages for your cluster. The included example demonstrates how to connect to the server via stdio by feeding a sequence of MCP messages, which you can observe or adapt for your own model context workflows.

How to install

Prerequisites:\n- Go programming language installed (https://golang.org/dl/).\n- Mage build tool installed (as used by the project) (https://magefile.org/).\n- Minikube and kubectl installed if you want to test against a local Kubernetes cluster.\n\nInstallation steps:\n1) Ensure Go is installed and in your PATH.\n2) Install Mage: go install github.com/magefile/mage@latest\n3) Build the MCP server with Mage (as shown in the repository):\n\t mage\n4) Confirm the binary is available (example path used in the configuration): /go/bin/mcp-server-k8s-go\n5) (Optional) Ensure your Kubernetes config is accessible via KUBECONFIG. For example, export KUBECONFIG or set it in your environment as shown in the configuration example.\n6) Run the server using the configuration in your mcp config (see next section for the example).

Additional notes

Tips and notes:\n- The server is designed to run within a Go environment and is typically invoked as a long-running process that serves MCP requests for Kubernetes resources. Make sure the KUBECONFIG path points to a valid kubeconfig, especially when running inside codespaces or containers.\n- If you modify or expand the MCP model, ensure your client tooling (Studio transport or other MCP clients) is compatible with the server’s MCP version.\n- When testing via stdio, you can pipe a sequence of MCP messages (for example, by listing example requests) to the server’s stdin and observe responses on stdout.\n- If you deploy to Kubernetes or run in a Kubernetes-like environment, ensure the necessary RBAC permissions are granted for the operations you intend to model with MCP.

Related MCP Servers

Sponsor this space

Reach thousands of developers