mcp-registry/mcp-k8s-go

    ==================
      
       /// MCP ///
      /// MCP ///
        
    ==================
        
    [server:online]
    [protocol:ready]

mcp-k8s-go

by strowk

Golang-based Model-Context-Protocol (MCP) server that exposes Kubernetes clusters as a set of chat-accessible resources and tools (list/get/create/modify resources, fetch logs, exec, etc.).

330
41
Open Source

01

List Kubernetes contexts

Return the list of kubeconfig contexts available to the server

02

List Kubernetes namespaces

Return the namespaces present in the selected Kubernetes context

03

List, get, create and modify any Kubernetes resources

Full CRUD operations for arbitrary Kubernetes resources, including custom mappings for pods, services, deployments, etc.

04

List Kubernetes nodes

Return the nodes in the current Kubernetes cluster

05

List Kubernetes pods

Return pod objects within the chosen namespace

06

Get Kubernetes events

Retrieve event objects from the Kubernetes API

07

Get Kubernetes pod logs

Fetch log output for a specified pod/container

08

Run command in Kubernetes pod

Execute an arbitrary command inside a running pod

Installation

1. Prerequisites
• Go 1.22 or later installed
• Access to a Kubernetes cluster and a valid kubeconfig (~/.kube/config)
• (Optional) Docker if you prefer container deployment
2. Get the source & build from GitHub
git clone https://github.com/strowk/mcp-k8s-go.git cd mcp-k8s-go go build -o mcp-k8s ./cmd/server
Or install directly:
go install github.com/strowk/mcp-k8s-go/cmd/server@latest
3. Install via NPM (Node.js wrapper / CLI convenience)
npm install -g @strowk/mcp-k8s
4. Container image (quick start)
docker pull ghcr.io/strowk/mcp-k8s-go:latest docker run -p 8080:8080 -v $HOME/.kube:/root/.kube ghcr.io/strowk/mcp-k8s-go:latest
5. Basic configuration
The server looks for the following environment variables (use a .env file or your CI/CD secrets):
• KUBECONFIG – path to kubeconfig (defaults to ~/.kube/config)
• MCP_PORT – port to expose the MCP HTTP interface (default 8080)
• LOG_LEVEL – debug | info | warn | error (default info)
6. Start the server
MCP_PORT=8080 ./mcp-k8s
7. Verify
Open http://localhost:8080/healthz – returns 200 OK when the MCP server is healthy and able to reach the Kubernetes API.

Documentation

License: MIT License
Updated 7/30/2025

Table of Contents