================== /// MCP /// /// MCP /// ================== [server:online] [protocol:ready]
mcp-k8s
by silenceper
A Kubernetes MCP (Model Control Protocol) server that enables interaction with Kubernetes clusters through MCP tools.
111
24
Open SourceInstallation
1. Prerequisites
• Go 1.21 or newer installed and in PATH
• Access to a running Kubernetes cluster and a valid kubeconfig file (~/.kube/config)
2. Fetch the source & build (recommended)
git clone https://github.com/silenceper/mcp-k8s.git
cd mcp-k8s
go build -o mcp-k8s ./cmd/mcp-k8s
or install directly with Go tooling:
go install github.com/silenceper/mcp-k8s/cmd/mcp-k8s@latest
3. Create an RBAC service-account (cluster-side)
kubectl create serviceaccount mcp-k8s -n kube-system
kubectl create clusterrolebinding mcp-k8s --clusterrole=cluster-admin --serviceaccount=kube-system:mcp-k8s
(Adjust permissions to least privilege for production.)
4. Run the server locally, pointing it to your kubeconfig:
./mcp-k8s --kubeconfig=$HOME/.kube/config --port=8080
Flags accepted typically include:
• --kubeconfig : path to kubeconfig
• --port : HTTP listen port (default 8080)
• --addr : listen address (default 0.0.0.0)
5. Container image (if provided)
If a Dockerfile exists, build & run:
docker build -t silenceper/mcp-k8s:latest .
docker run -p 8080:8080 -v $HOME/.kube/config:/root/.kube/config:ro silenceper/mcp-k8s:latest
6. Kubernetes deployment (optional)
kubectl apply -f deploy/k8s/
Edit values in deploy/k8s/manifest.yml to set service type, image tag, etc.
7. Verify
curl http://localhost:8080/healthz
A 200 OK response confirms the MCP server is up.
Documentation
License: Apache License 2.0
Updated 7/30/2025