MCP.so
登录

Kubernetes MCP Server

@reza-gholizade

基本信息

分类

云与基础设施

许可证

MIT

传输方式

stdio

作者

reza-gholizade

提交者

reza gholizade

关于 Kubernetes MCP Server

Manage Your Kubernetes Cluster with k8s mcp-server

Kubernetes MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "k8s-tools": {
      "command": "/PATH_TO_MCP_SERVER/k8s-mcp-server",
      "args": []
    }
  }
}

Kubernetes MCP Server 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is Kubernetes MCP Server?

Kubernetes MCP Server is a Model Context Protocol (MCP) server that provides tools for interacting with Kubernetes clusters through a standardized interface. It is designed for developers and operators who need to manage Kubernetes resources, retrieve logs and metrics, and perform Helm operations programmatically via CLI, web applications, or AI assistants.

How to use Kubernetes MCP Server?

Clone the repository, install dependencies with go mod download, build with go build -o k8s-mcp-server main.go, then run the server in one of three modes: stdio, sse, or streamable-http. Authentication can be configured via kubeconfig file, environment variables (KUBECONFIG_DATA, KUBERNETES_SERVER/TOKEN), or in-cluster service account. A Docker image is available on Docker Hub (ginnux/k8s-mcp-server:latest). The server can also be run in read-only mode (--read-only) or with tool categories selectively disabled (--no-k8s, --no-helm).

Key features of Kubernetes MCP Server

  • API Resource Discovery: get all available API resources in the cluster
  • Resource Listing: list resources with optional namespace and label filtering
  • Resource Details: get detailed information about specific resources
  • Pod Logs: retrieve logs from specific pods or containers
  • Node and Pod Metrics: get CPU/Memory usage metrics
  • Event Listing: list events within a namespace or for a resource
  • Resource Creation/Updating/Deletion from YAML or JSON manifests
  • Helm tool support: install, upgrade, uninstall, rollback, and list Helm releases
  • Multiple transport modes: stdio, SSE, and streamable-http
  • Read-only mode disables all write operations for safe exploration
  • Runs as non-root user in Docker containers

Use cases of Kubernetes MCP Server

  • Query and inspect Kubernetes resources (pods, deployments, services) via AI assistants
  • Monitor cluster health by retrieving pod logs, node/pod metrics, and events
  • Automate resource creation, updates, and deletions with YAML/JSON manifests
  • Perform Helm chart lifecycle operations (install, upgrade, uninstall, rollback)
  • Enable safe, read-only exploration of a cluster for auditing or debugging

常见问题

1

What authentication methods does Kubernetes MCP Server support?

The server supports four methods, tried in priority order: (1) kubeconfig content from the `KUBECONFIG_DATA` environment variable, (2) API server URL (`KUBERNETES_SERVER`) and bearer token (`KUBERNETES_TOKEN`), (3) in-cluster service account (automatically detected), and (4) default kubeconfig file at `~/.kube/config` or custom path via `KUBECONFIG`.

2

How do I enable read-only mode?

Pass the `--read-only` flag when starting the server. This disables all write operations, including `createResource`, all Helm write tools (`helmInstall`, `helmUpgrade`, etc.), while keeping read-only operations like listing resources, getting logs, and viewing metrics available.

3

What transport modes are available?

The server supports `stdio` mode (standard input/output for CLI integrations), `sse` mode (HTTP server with Server-Sent Events), and `streamable-http` mode (HTTP server supporting streamable transport per MCP spec). The default mode is SSE on port 8080 if none specified.

4

Can I run Kubernetes MCP Server as a Docker container?

Yes, a pre-built Docker image is available on Docker Hub (`ginnux/k8s-mcp-server:latest`). It runs as a non-root user and supports all three transport modes. You can mount a kubeconfig file or use environment variables for authentication.

5

What are the prerequisites for running the server?

You need Go 1.23 or later, access to a Kubernetes cluster, and `kubectl` configured with appropriate cluster access. The server also supports a hosted deployment on [Fronteir AI](https://fronteir.ai/mcp/reza-gholizade-k8s-mcp-server).

评论

云与基础设施 分类下的更多 MCP 服务器