Kubernetes MCP Server
@reza-gholizade
About Kubernetes MCP Server
Manage Your Kubernetes Cluster with k8s mcp-server
Basic information
Category
Cloud & Infrastructure
License
MIT
Runtime
go
Transports
stdio
Publisher
reza-gholizade
Submitted by
reza gholizade
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.
More Cloud & Infrastructure MCP servers
MCP Server that interacts with Azure AI Foundry (experimental)
azure-ai-foundryA MCP Server for Azure AI Foundry: it's now moved to cloud, check the new Foundry MCP Server
Awesome DevOps MCP Servers
rohitg00A curated list of awesome MCP servers focused on DevOps tools and capabilities.
tfmcp: Terraform Model Context Protocol Tool
nwiizo🌍 Terraform Model Context Protocol (MCP) Tool - An experimental CLI tool that enables AI assistants to manage and operate Terraform environments. Supports reading Terraform configurations, analyzing plans, applying configurations, and managing state with Claude Desktop integrati
container-use
aluzzardiDevelopment environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack.
Kubernetes MCP Server
manusaModel Context Protocol (MCP) server for Kubernetes and OpenShift
Comments