k8s-mcp-server
by reza-gholizade·★ 156·Score 50
A Go-based MCP server that provides comprehensive Kubernetes cluster management tools through MCP protocol.
Overview
The k8s-mcp-server is a full-featured implementation of the Model Context Protocol for Kubernetes cluster management. It provides extensive functionality including resource discovery, listing, details retrieval, pod logs access, node metrics, event listing, and resource creation/deletion operations. The server supports multiple deployment modes including stdio, SSE, and streamable-http, making it versatile for both CLI and web application integrations. It also offers robust security features with multiple authentication methods and a read-only mode for safe exploration of clusters.
Try asking AI
After installing, here are 7 things you can ask your AI assistant:
When to choose this
Choose this when you need comprehensive Kubernetes management through AI interfaces and already have existing Kubernetes infrastructure to integrate with.
When NOT to choose this
Avoid if you need fine-grained RBAC control beyond what's provided, or if you're working with non-Kubernetes container orchestration platforms.
Tools this server exposes
12 tools extracted from the READMEgetAPIResourcesGet all available API resources in your Kubernetes cluster
listResourcesList resources of any type with optional namespace and label filtering
getResourceGet detailed information about specific Kubernetes resources
describeResourceGet comprehensive descriptions of Kubernetes resources, similar to kubectl describe
getPodsLogsRetrieve logs from specific pods
getNodeMetricsGet resource usage metrics for specific nodes
getPodMetricsGet CPU and Memory metrics for specific pods
getEventsList events within a namespace or for a specific resource
createResourceCreate new Kubernetes resources or update existing ones from a YAML or JSON manifest
deleteResourceDelete a resource in the Kubernetes cluster based on the provided namespace and kind
helmListList all Helm releases in a namespace
helmInstallInstall a new Helm chart in the cluster
Comparable tools
Installation
Installation
From Source
git clone https://github.com/reza-gholizade/k8s-mcp-server.git
cd k8s-mcp-server
go mod download
go build -o k8s-mcp-server main.goUsing Docker
docker pull ginnux/k8s-mcp-server:latest
docker run -p 8080:8080 -v ~/.kube/config:/home/appuser/.kube/config:ro ginnux/k8s-mcp-server:latestClaude Desktop Configuration
Add to your Claude Desktop config.json:
{
"mcpServers": {
"kubernetes": {
"command": "k8s-mcp-server",
"args": ["--mode", "stdio"],
"env": {
"KUBECONFIG": "/path/to/your/kubeconfig"
}
}
}
}FAQ
- What authentication methods does this server support?
- The server supports multiple authentication methods in priority order: kubeconfig content from environment variable, API server URL and token, in-cluster service account authentication, and kubeconfig file path.
- Can I run this in read-only mode?
- Yes, use the --read-only flag to disable all write operations, making it safer to explore and monitor your Kubernetes cluster without making changes.
- What are the different server modes?
- The server supports three modes: stdio for CLI integrations, SSE for web applications with Server-Sent Events, and streamable-http for web applications with MCP HTTP transport.
Compare k8s-mcp-server with
Last updated · Auto-generated from public README + GitHub signals.