k8s
K8s-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 systems to assist with cluster management, troubleshooting, and deployments
claude mcp add --transport stdio alexei-led-k8s-mcp-server docker run -i --rm -v /Users/YOUR_USER_NAME/.kube:/home/appuser/.kube:ro ghcr.io/alexei-led/k8s-mcp-server:latest \ --env K8S_MCP_TRANSPORT="transport type (stdio, streamable-http, or sse). default is stdio"
How to use
The K8s MCP Server runs Kubernetes CLI tools (kubectl, helm, istioctl, and argocd) inside a secure container and exposes them to Claude via the MCP protocol. This enables you to ask natural language questions about your Kubernetes clusters and have Claude execute the appropriate commands through the MCP server, then receive formatted results and explanations. The server is designed to run in a Docker container and uses your local kubeconfig to access your cluster, so you can manage contexts, pods, deployments, services, and Helm releases without leaving your Claude session. Tools available include kubectl for cluster operations, helm for package management, istioctl for service mesh tasks, and argocd for GitOps workflows. Transport options allow you to choose how results are streamed back to Claude (stdio by default, with streamable-http and SSE as alternatives).
How to install
Prerequisites:
- Docker installed and running on your host
- Access to your Kubernetes cluster (kubeconfig)
Installation steps:
- Ensure Docker is installed and running on your machine.
- Pull the MCP server image (optional if you use the docker run command directly): docker pull ghcr.io/alexei-led/k8s-mcp-server:latest
- Run the MCP server with your kubeconfig mounted:
docker run -i --rm
-v ~/.kube:/home/appuser/.kube:ro
ghcr.io/alexei-led/k8s-mcp-server:latest Note: If you follow the exact example from the README Quick Start, you can use: docker run -i --rm -v /Users/YOUR_USER_NAME/.kube:/home/appuser/.kube:ro ghcr.io/alexei-led/k8s-mcp-server:latest - (Optional) Configure Claude Desktop to point to the MCP server using the provided example configuration snippet under the kubernetes key.
- Start Claude Desktop and test a simple command like: kubectl get pods --all-namespaces to verify the integration.
Tips:
- If you use streamable-http or SSE transports, set K8S_MCP_TRANSPORT accordingly in the environment.
- Ensure your kubeconfig path is correct and accessible inside the container mount.
- Use the exact image tag (latest or a specific version) as needed.
Additional notes
Tips and troubleshooting:
- Transport behavior: stdio is the default and simplest; streamable-http is recommended for remote clients, and SSE is deprecated. When using HTTP transports in Docker, the server binds to 0.0.0.0 for proper port mapping.
- Security: The MCP server runs CLI tools inside a container. Ensure your kubeconfig permissions are appropriate and limit access to the Claude integration.
- Volume mounts: Mount your kubeconfig as read-only to prevent accidental modifications from the MCP environment.
- Troubleshooting: If kubectl commands fail, verify kubeconfig context availability inside the container (kubectl config view) and ensure the MCP process has network access to the Kubernetes API server.
- Claude Integration: The Quick Start example shows how to configure Claude Desktop to reference the MCP server under the kubernetes key. You can customize the server name as needed in Claude’s config.
Related MCP Servers
kubefwd
Bulk port forwarding Kubernetes services for local development.
mcpcan
MCPCAN is a centralized management platform for MCP services. It deploys each MCP service using a container deployment method. The platform supports container monitoring and MCP service token verification, solving security risks and enabling rapid deployment of MCP services. It uses SSE, STDIO, and STREAMABLEHTTP access protocols to deploy MCP。
mcp-for-argocd
An implementation of Model Context Protocol (MCP) server for Argo CD.
aws
A 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.
kubeview
A fast, read-only MCP server enabling code-driven AI analysis of Kubernetes clusters
bitbucket-automatic-pr-reviewer
🤖 Automated PR reviews using Claude CLI with Bitbucket webhooks. Features sequential processing, MCP integration, Prometheus metrics, and secure webhook validation. Perfect for teams wanting AI-powered code reviews without API costs.