Kubernetes CLI Bridge
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,
What is Kubernetes CLI Bridge?
Kubernetes CLI Bridge is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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 kuber...
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,
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- K8s-mcp-server is a Model Context Protocol (MCP) server that
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx k8sConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Kubernetes CLI Bridge
k8s-mcp-server is a Model Context Protocol server that gives AI assistants like Claude secure, structured access to Kubernetes cluster operations through a bridge to kubectl, helm, istioctl, and argocd CLI tools. It exposes a rich set of tools covering cluster discovery, pod operations, resource management, monitoring, Helm chart lifecycle, and YAML/JSON manifest operations — all executable through natural language without requiring the user to remember complex kubectl syntax. Teams use it to inspect cluster health, troubleshoot failing pods, manage Helm releases, and perform rolling restarts directly from their AI client, with support for read-only mode to prevent accidental modifications in production environments.
Prerequisites
- Go 1.23+ (if building from source) OR Docker (for container deployment)
- A configured kubeconfig file at ~/.kube/config with access to your target cluster
- kubectl installed and in PATH (for stdio mode), OR access to a Kubernetes API server
- An MCP-compatible client such as Claude Desktop or VS Code with MCP support
- Helm installed in PATH if you want to use Helm management tools
Build the server from source
Clone the repository and build the Go binary. Requires Go 1.23 or higher.
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.goAlternative: Run with Docker
Use the pre-built Docker image, mounting your local kubeconfig into the container.
docker pull ginnux/k8s-mcp-server:latest
docker run -p 8080:8080 \
-v ~/.kube/config:/home/appuser/.kube/config:ro \
ginnux/k8s-mcp-server:latestTest the binary in stdio mode
Verify the binary works by running it in stdio mode. This is the mode used by Claude Desktop for direct process communication.
./k8s-mcp-server --mode stdio --read-onlyConfigure Claude Desktop
Add the k8s-mcp-server to your claude_desktop_config.json. Use --read-only for production clusters to prevent accidental mutations.
{
"mcpServers": {
"k8s": {
"command": "/path/to/k8s-mcp-server",
"args": ["--mode", "stdio", "--read-only"],
"env": {
"KUBECONFIG": "/Users/yourname/.kube/config"
}
}
}
}Configure for remote cluster access
For clusters where you don't have a local kubeconfig, set environment variables to authenticate directly against the Kubernetes API.
{
"mcpServers": {
"k8s": {
"command": "/path/to/k8s-mcp-server",
"args": ["--mode", "stdio"],
"env": {
"KUBERNETES_SERVER": "https://your-cluster-api:6443",
"KUBERNETES_TOKEN": "your-bearer-token",
"KUBERNETES_INSECURE": "false"
}
}
}
}Kubernetes CLI Bridge Examples
Client configuration
Standard claude_desktop_config.json setup using the local kubeconfig file with read-only mode enabled for safety.
{
"mcpServers": {
"k8s": {
"command": "/usr/local/bin/k8s-mcp-server",
"args": ["--mode", "stdio", "--read-only"],
"env": {
"KUBECONFIG": "/Users/yourname/.kube/config"
}
}
}
}Prompts to try
These prompts cover cluster inspection, pod troubleshooting, Helm management, and resource operations through the k8s-mcp-server tools.
- "Show me all pods in the production namespace and their current status"
- "Get the logs from the payment-service pod in the last 100 lines"
- "Describe the failing pod api-gateway-7d9f8b in the staging namespace"
- "List all Helm releases installed in the cluster"
- "Get CPU and memory usage for all nodes in the cluster"
- "Trigger a rolling restart of the deployment named web-frontend in production"Troubleshooting Kubernetes CLI Bridge
Server starts but cannot connect to the cluster
Verify your kubeconfig is valid by running kubectl get nodes in a terminal. Check that the KUBECONFIG environment variable in your MCP config points to the correct file. For remote clusters, verify KUBERNETES_SERVER and KUBERNETES_TOKEN are correct and the token has the necessary RBAC permissions.
Helm tools return 'command not found'
Ensure helm is installed and available in PATH on the machine running k8s-mcp-server. If you do not use Helm, add the --no-helm flag to the args array in your MCP config to disable Helm tools and eliminate the error.
Read-only mode still allows mutations
The --read-only flag disables write tools like createOrUpdateResource, deleteResource, and rolloutRestart at the server level. If mutations are still occurring, verify --read-only is in the args array of your MCP client config and that you restarted the client after making changes.
Frequently Asked Questions about Kubernetes CLI Bridge
What is Kubernetes CLI Bridge?
Kubernetes CLI Bridge is a Model Context Protocol (MCP) server that 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, It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Kubernetes CLI Bridge?
Follow the installation instructions on the Kubernetes CLI Bridge GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Kubernetes CLI Bridge?
Kubernetes CLI Bridge works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Kubernetes CLI Bridge free to use?
Yes, Kubernetes CLI Bridge is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Kubernetes CLI Bridge Alternatives — Similar Cloud Services Servers
Looking for alternatives to Kubernetes CLI Bridge? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
Browse More Cloud Services MCP Servers
Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Kubernetes CLI Bridge in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Kubernetes CLI Bridge?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.