MCP K8S Go

MCP K8S Go

Golang-based MCP server that enables AI-driven interactions with Kubernetes clusters.

356
Stars
50
Forks
356
Watchers
8
Issues
MCP K8S Go provides a server implementation of the Model Context Protocol for managing and interacting with Kubernetes clusters. It offers functionality to list, retrieve, create, and modify Kubernetes resources such as contexts, namespaces, pods, and nodes using standardized context-aware approaches. Designed for integration with AI assistants like Claude Desktop, it enables prompting and tool execution to manage cluster state, monitor events, fetch pod logs, and run in-pod commands. The solution supports deployment via various installation methods including Docker, Node.js, and Go binaries.

Key Features

Lists Kubernetes contexts and namespaces
Retrieves and manages cluster resources
Fetches pod logs and cluster events
Runs commands in Kubernetes pods
Custom mappings for resources like pods, services, deployments
Supports multiple installation options (Docker, Node.js, Go)
Integrates with AI clients such as Claude Desktop
Cloud-native and context-aware management
Event monitoring for Kubernetes clusters
Resource creation and modification capabilities

Use Cases

AI-powered Kubernetes cluster management
Automated resource discovery and modification
Fetching and analyzing pod logs for troubleshooting
Running diagnostic commands inside cluster pods
Context-aware interactions with Kubernetes from AI assistants
Cluster event monitoring and reporting
Managing namespaces and resource topologies
DevOps automation for cloud-native infrastructure
Integrating AI chat tools with operational Kubernetes workflows
Supporting multi-context orchestration in platform engineering

README

Features

MCP πŸ’¬ prompt πŸ—‚οΈ resource πŸ€– tool

  • πŸ—‚οΈπŸ€– List Kubernetes contexts
  • πŸ’¬πŸ€– List Kubernetes namespaces
  • πŸ€– List, get, create and modify any Kubernetes resources
    • includes custom mappings for resources like pods, services, deployments
  • πŸ€– List Kubernetes nodes
  • πŸ’¬ List Kubernetes pods
  • πŸ€– Get Kubernetes events
  • πŸ€– Get Kubernetes pod logs
  • πŸ€– Run command in Kubernetes pod

Browse With Inspector

To use latest published version with Inspector you can run this:

bash
npx @modelcontextprotocol/inspector npx @strowk/mcp-k8s

Use With Claude

Following chat with Claude Desktop demonstrates how it looks when selected particular context as a resource and then asked to check pod logs for errors in kube-system namespace:

Claude Desktop

To use this MCP server with Claude Desktop (or any other client) you might need to choose which way of installation to use.

You have multiple options:

Smithery mcp-get Pre-built NPM Pre-built in Github From sources Using Docker
Claude Setup Auto Auto Manual Manual Manual Manual
Prerequisite Node.js Node.js Node.js None Golang Docker

Using Smithery

To install MCP K8S Go for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @strowk/mcp-k8s --client claude

Using mcp-get

To install MCP K8S Go for Claude Desktop automatically via mcp-get:

bash
npx @michaellatman/mcp-get@latest install @strowk/mcp-k8s

Manually with prebuilt binaries

Prebuilt from npm

Use this if you have npm installed and want to use pre-built binaries:

bash
npm install -g @strowk/mcp-k8s

Then check version by running mcp-k8s --version and if this printed installed version, you can proceed to add configuration to claude_desktop_config.json file:

json
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "mcp-k8s",
      "args": []
    }
  }
}

, or using npx with any client:

bash
npx @strowk/mcp-k8s

For example for Claude:

json
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "npx",
      "args": [
        "@strowk/mcp-k8s"
      ]
    }
  }
}

From GitHub releases

Head to GitHub releases and download the latest release for your platform.

Unpack the archive, which would contain binary named mcp-k8s-go, put that binary somewhere in your PATH and then add the following configuration to the claude_desktop_config.json file:

json
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "mcp-k8s-go",
      "args": []
    }
  }
}

Building from source

You would need Golang installed to build this project:

bash
go get github.com/strowk/mcp-k8s-go
go install github.com/strowk/mcp-k8s-go

, and then add the following configuration to the claude_desktop_config.json file:

json
{
  "mcpServers": {
    "mcp_k8s_go": {
      "command": "mcp-k8s-go",
      "args": []
    }
  }
}

Using Docker

This server is built and published to Docker Hub since 0.3.1-beta.2 release with multi-arch images available for linux/amd64 and linux/arm64 architectures.

You can use latest tag f.e like this:

bash
docker run -i -v ~/.kube/config:/home/nonroot/.kube/config --rm mcpk8s/server:latest

Windows users might need to replace ~/.kube/config with //c/Users/<username>/.kube/config at least in Git Bash.

For Claude:

json
{
  "mcpServers": {
    "mcp_k8s_go": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-v",
        "~/.kube/config:/home/nonroot/.kube/config",
        "--rm",
        "mcpk8s/server:latest"
      ]
    }
  }
}

Environment Variables and Command-line Options

The following environment variables are used by the MCP server:

  • KUBECONFIG: Path to your Kubernetes configuration file (optional, defaults to ~/.kube/config)

The following command-line options are supported:

  • --allowed-contexts=<ctx1,ctx2,...>: Comma-separated list of allowed Kubernetes contexts that users can access. If not specified, all contexts are allowed.
  • --readonly: Disables any tool which can write changes to the cluster
  • --help: Display help information
  • --version: Display version information
  • --mask-secrets: Mask secrets in the output (default: true). Use --mask-secrets=false to disable masking

For example if you are configuring Claude Desktop, you can add the following configuration to claude_desktop_config.json file:

json
{
    "mcpServers": {
        "mcp_k8s": {
            "command": "mcp-k8s",
            "args": [
                "--allowed-contexts=dev,prod",
                "--readonly"
            ]
        }
    }
}

, which would allow only dev and prod contexts to be used and would disable any tool which can write changes to the cluster.

Star History

Star History Chart

Repository Owner

strowk
strowk

User

Repository Details

Language Go
Default Branch main
Size 2,007 KB
Contributors 11
License MIT License
MCP Verified Nov 11, 2025

Programming Languages

Go
93.28%
Shell
3.75%
JavaScript
2.81%
Dockerfile
0.15%

Tags

Topics

kubernetes mcp server

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • mcp-k8s-eye

    mcp-k8s-eye

    Kubernetes management and diagnostics tool with MCP protocol support.

    mcp-k8s-eye enables users to manage and analyze Kubernetes clusters using standardized Model Context Protocol (MCP) interfaces. It offers comprehensive resource operations, diagnostics, and resource usage monitoring through both stdio and SSE transports. Supporting generic and custom resource management along with advanced diagnostic tooling, it is geared for integration with AI clients and other MCP consumers.

    • ⭐ 26
    • MCP
    • wenhuwang/mcp-k8s-eye
  • Kanboard MCP Server

    Kanboard MCP Server

    MCP server for seamless AI integration with Kanboard project management.

    Kanboard MCP Server is a Go-based server implementing the Model Context Protocol (MCP) for integrating AI assistants with the Kanboard project management system. It enables users to manage projects, tasks, users, and workflows in Kanboard directly via natural language commands through compatible AI tools. With built-in support for secure authentication and high performance, it facilitates streamlined project operations between Kanboard and AI-powered clients like Cursor or Claude Desktop. The server is configurable and designed for compatibility with MCP standards.

    • ⭐ 15
    • MCP
    • bivex/kanboard-mcp
  • Inspektor Gadget MCP Server

    Inspektor Gadget MCP Server

    AI-powered Kubernetes troubleshooting via Model Context Protocol.

    Inspektor Gadget MCP Server provides an AI-powered debugging and inspection interface for Kubernetes clusters. Leveraging the Model Context Protocol, it enables intelligent output summarization, one-click deployment of Inspektor Gadget, and automated discovery of debugging tools from Artifact Hub. The server integrates seamlessly with VS Code for interactive AI commands, simplifying Kubernetes troubleshooting and monitoring workflows.

    • ⭐ 16
    • MCP
    • inspektor-gadget/ig-mcp-server
  • metoro-mcp-server

    metoro-mcp-server

    Bridge Kubernetes observability data to LLMs via the Model Context Protocol.

    Metoro MCP Server is an implementation of the Model Context Protocol (MCP) that enables seamless integration between Kubernetes observability data and large language models. It connects Metoro’s eBPF-based telemetry APIs to LLM applications such as the Claude Desktop App, allowing AI systems to query and analyze Kubernetes clusters. This solution supports both authenticated and demo modes for accessing real-time cluster insights.

    • ⭐ 45
    • MCP
    • metoro-io/metoro-mcp-server
  • K8M

    K8M

    AI-driven lightweight Kubernetes dashboard with integrated MCP and multi-cluster management.

    K8M is an AI-enabled mini Kubernetes dashboard built with a focus on simplifying cluster management and enhancing user experience. Utilizing the Model Context Protocol (MCP), K8M offers visual management for MCP, allowing AI models to interact with Kubernetes resources and tools easily, supporting over 49 built-in MCP tools. It enables powerful multi-cluster management, integrates advanced AI capabilities such as chat-driven resource explanation and diagnostics, and supports custom large model integration including private deployments and models like Ollama.

    • ⭐ 702
    • MCP
    • weibaohui/k8m
  • mcp-confluent

    mcp-confluent

    MCP server for managing Confluent Cloud resources via natural language.

    mcp-confluent is a Model Context Protocol (MCP) server implementation designed to enable natural language interaction with Confluent Cloud REST APIs. It integrates with AI tools such as Claude Desktop and Goose CLI, allowing users to manage Kafka topics, connectors, and Flink SQL statements conversationally. The project offers flexible configuration, CLI usage, and supports various transports for secure and customizable operations.

    • ⭐ 115
    • MCP
    • confluentinc/mcp-confluent
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results