Kubernetes MCP Server
@reza-gholizade
About Kubernetes MCP Server
Manage Your Kubernetes Cluster with k8s mcp-server
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"k8s-tools": {
"command": "/PATH_TO_MCP_SERVER/k8s-mcp-server",
"args": []
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
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.
Frequently asked questions
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](https://fronteir.ai/mcp/reza-gholizade-k8s-mcp-server).
Basic information
Category
Cloud & Infrastructure
License
MIT
Transports
stdio
Author
reza-gholizade
Submitted by
reza gholizade
More Cloud & Infrastructure MCP servers
🐳 docker-mcp
QuantGeekDevA docker MCP Server (modelcontextprotocol)
K8s MCP Server
alexei-ledK8s-mcp-server is a Model Context Protocol (MCP) server that enables AI assistants like Claude to securely execute Kubernetes commands. It provides a bridge between language models and essential Kubernetes CLI tools including kubectl, helm, istioctl, and argocd, allowing AI syste
AWS Model Context Protocol (MCP) Server
alexei-ledA lightweight service that enables AI assistants to execute AWS CLI commands (in safe containerized environment) through the Model Context Protocol (MCP). Bridges Claude, Cursor, and other MCP-aware AI tools with AWS CLI for enhanced cloud infrastructure management.
aws-finops-mcp-server
ravikiranvmAn MCP (Model Context Protocol) server that brings powerful AWS FinOps capabilities directly into your AI assistant. Analyze cloud costs, audit for waste, and get budget insights using natural language, all while keeping your credentials secure on your local machine.
Supabase MCP Server
supabase-communityConnect Supabase to your AI assistants
Comments