Kubernetes MCP server in Go

Kubernetes MCP server in Go

kubernetes-mcp•byhsn0918

A Go-based Model Context Protocol server that exposes Kubernetes operations as MCP tools with stdio, SSE, and StreamableHTTP transport support.

License: Not specified•Runtime: Awaiting documentation review•Category: cloud devops

WHAT IT DOES

  • •Exposes generic Kubernetes resource operations (list, get, describe, create, update, delete) as MCP tools under the K8S prefix.
  • •Provides core cluster utilities such as listing namespaces and nodes, fetching pod logs, and analyzing pod logs.
  • •Offers utility tools for cluster info, events, resource search/explain, and manifest apply, validate, and diff.
  • •Includes metrics tools for node, pod, and resource metrics and top consumers.

BEST FOR

  • •Connecting MCP-capable assistants to a Kubernetes cluster for resource management and inspection.
  • •Troubleshooting pods, nodes, and networking through dedicated prompt tools and event retrieval.
  • •Deploying as an in-cluster service using HTTP transports with health endpoints.

ABOUT KUBERNETES-MCP

Kubernetes MCP server in Go is cataloged as an MCP server attributed to hsn0918. A Go-based Model Context Protocol server that exposes Kubernetes operations as MCP tools with stdio, SSE, and StreamableHTTP transport support. It is categorized under cloud devops. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Kubernetes MCP server in Go are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which transports can the server use?

It supports stdio, SSE, and StreamableHTTP transports, with a StreamableHTTP MCP endpoint at POST /mcp.

How does the server authenticate to the cluster?

It can use either a local kubeconfig passed via --kubeconfig or an in-cluster service account.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 9fdf7232170d · 采集于 2026-11-13 09:46:42 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Kubernetes MCP

Kubernetes MCP Logo

English | 中文

A Kubernetes-focused Model Context Protocol (MCP) server built in Go. It exposes Kubernetes operations as MCP tools and supports stdio, sse, and streamable transports.

Why This Project

  • Unified MCP interface for Kubernetes operations
  • Works with both local kubeconfig and in-cluster configuration
  • Multiple transports for different integration modes
  • Generic resource CRUD + utility tools + prompts + metrics
  • slog-based logging with configurable level/format

Requirements

  • Go 1.24+
  • Access to a Kubernetes cluster
    • via --kubeconfig, or
    • via in-cluster service account

Quick Start

Build

git clone https://github.com/HSn0918/kubernetes-mcp.git
cd kubernetes-mcp
go build -o kubernetes-mcp ./cmd/kubernetes-mcp

Run (stdio)

./kubernetes-mcp server transport stdio --kubeconfig ~/.kube/config

Run (SSE)

./kubernetes-mcp server transport sse \
  --port 8080 \
  --health-port 8081 \
  --allow-origins "*" \
  --base-url "http://localhost:8080" \
  --kubeconfig ~/.kube/config

Run (StreamableHTTP)

./kubernetes-mcp server transport streamable \
  --port 8080 \
  --health-port 8081 \
  --allow-origins "*" \
  --kubeconfig ~/.kube/config

CLI Structure

kubernetes-mcp
├── server
│   └── transport
│       ├── stdio
│       ├── sse
│       └── streamable
└── version

Configuration Flags

Global flags:

  • --log-level (debug|info|warn|error, default info)
  • --log-format (console|json, default console)
  • --kubeconfig (optional)

Network transport flags (sse, streamable):

  • --port (default 8080)
  • --health-port (default 8081)
  • --allow-origins (default *)

SSE-only flags:

  • --base-url (default http://localhost:<port>)

Transport Endpoints

  • StreamableHTTP MCP endpoint: POST /mcp
  • Health endpoints (SSE/Streamable only):
    • GET /healthz
    • GET /readyz

Tooling Overview

1. Generic Resource Operations

For each API group prefix, the server exposes:

  • LIST_<PREFIX>_RESOURCES
  • GET_<PREFIX>_RESOURCE
  • DESCRIBE_<PREFIX>_RESOURCE
  • CREATE_<PREFIX>_RESOURCE
  • UPDATE_<PREFIX>_RESOURCE
  • DELETE_<PREFIX>_RESOURCE

Registered prefixes:

  • K8S

2. Core/Cluster Utilities

  • LIST_NAMESPACES
  • LIST_NODES
  • GET_POD_LOGS
  • ANALYZE_POD_LOGS

3. Utility Tools

  • GET_CURRENT_TIME
  • GET_CLUSTER_INFO
  • GET_API_RESOURCES
  • SEARCH_RESOURCES
  • EXPLAIN_RESOURCE
  • APPLY_MANIFEST
  • VALIDATE_MANIFEST
  • DIFF_MANIFEST
  • GET_EVENTS

4. Prompt Tools

  • KUBERNETES_YAML_PROMPT
  • KUBERNETES_QUERY_PROMPT
  • TROUBLESHOOT_PODS_PROMPT
  • TROUBLESHOOT_NODES_PROMPT
  • TROUBLESHOOT_NETWORK_PROMPT

5. Metrics Tools

  • GET_NODE_METRICS
  • GET_POD_METRICS
  • GET_RESOURCE_METRICS
  • GET_TOP_CONSUMERS

Architecture (k8s-style group/version)

cmd/kubernetes-mcp/
  main.go
  app/
pkg/
  client/kubernetes/
  config/
  handlers/
    apis/
      core/v1/
      apps/v1/
    base/
    tool/
    prompt/
    metrics/
  server/
  health/
  logger/

Docker

Build:

docker build -t kubernetes-mcp:latest .

Run with explicit transport command:

docker run --rm -it \
  -v ~/.kube:/root/.kube \
  kubernetes-mcp:latest \
  server transport stdio --kubeconfig /root/.kube/config

Kubernetes Deployment

Deployment manifests are in /deploy/kubernetes.

make k8s-deploy
# or
make k8s-deploy-kustomize

Development

make build
make test

Justfile + One-Click Skill Install

This repo includes a project usage skill at skills/kubernetes-mcp-usage.

# list just tasks
just

# common dev tasks
just build
just test

# install the project skill into Codex
just skill-install

# overwrite existing install
just skill-install-force

Skill install destination: $CODEX_HOME/skills/kubernetes-mcp-usage (or ~/.codex/skills/kubernetes-mcp-usage when CODEX_HOME is not set).

After installing, restart Codex to pick up the skill.

Notes

  • Resource operations depend on your cluster API availability and RBAC permissions.
  • For network transports behind ingress/reverse proxy, set --base-url correctly for SSE.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Kubernetes MCP server in Go from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/kubernetes-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related cloud devops MCP Servers

Alternative and complementary servers in the same category

View all in cloud devops →
Huawei MCP Server
mcp-server-huaweiclouddeveloper•huaweiclouddeveloper

A Model Context Protocol server built on Huawei Cloud services that enables AI assistants to operate Huawei Cloud resources within conversational workflows, supporting ECS, OBS, GaussDB, and other cloud products.

Repository stats unavailable
Cloud & DevOps
Coolify MCP Server
coolify-mcp-server•wrediam

An MCP server that exposes the Coolify v4.3.1 REST API so AI clients can manage applications, databases, services, servers, deployments, and more.

Repository stats unavailable
Cloud & DevOps

A deprecated Model Context Protocol server for interacting with Kong Konnect APIs, enabling AI assistants to query and analyze Kong Gateway configurations, traffic, and analytics.

Repository stats unavailable
Cloud & DevOps