Kubernetes MCP Server
@reza-gholizade
关于 Kubernetes MCP Server
Manage Your Kubernetes Cluster with k8s mcp-server
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"k8s-tools": {
"command": "/PATH_TO_MCP_SERVER/k8s-mcp-server",
"args": []
}
}
}工具
未检测到工具
工具是从 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
FAQ from Kubernetes MCP Server
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.
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.
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.
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.
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.
云与基础设施 分类下的更多 MCP 服务器
MCP Server Kubernetes
Flux159MCP Server for kubernetes management commands
Terraform MCP Server
hashicorpThe Terraform MCP Server provides seamless integration with Terraform ecosystem, enabling advanced automation and interaction capabilities for Infrastructure as Code (IaC) development.
Supabase MCP Server
coleam00Supabase MCP server created in Python.
Azure DevOps MCP Server
Tiberriver256An MCP server for Azure DevOps
🐳 docker-mcp
QuantGeekDevA docker MCP Server (modelcontextprotocol)
评论