Skip to content

v1.23.0

Choose a tag to compare

@rohitg00 rohitg00 released this 03 Feb 10:48

Fix: In-Cluster Kubernetes Config

Resolves the HTTPConnectionPool(host='localhost', port=80): Max retries exceeded error when the server is deployed inside a Kubernetes cluster (#61).

What Changed

  • Fixed config loading_patched_load_kube_config no longer short-circuits calls with explicit arguments (config_file, context, client_configuration), which was preventing the kubernetes client from loading the correct API server address
  • In-cluster fallback — The kubeconfig provider now automatically falls back to in-cluster config when no kubeconfig file exists in the container
  • Actionable errors — Raises ProviderError with clear remediation steps when neither kubeconfig nor in-cluster config is available, instead of silently falling back to localhost:80
  • Deployment manifest — Added MCP_K8S_PROVIDER=in-cluster and KUBERNETES_SERVICE_PORT=443 env vars

Deployment

For in-cluster deployments, ensure these env vars are set:

env:
  - name: MCP_K8S_PROVIDER
    value: "in-cluster"
  - name: KUBERNETES_SERVICE_HOST
    value: "kubernetes.default.svc"
  - name: KUBERNETES_SERVICE_PORT
    value: "443"

Reference manifests: deploy/kubernetes/

Install

pip install kubectl-mcp-server==1.23.0
# or
npx kubectl-mcp-server@1.23.0
# or
docker pull rohitghumare64/kubectl-mcp-server:1.23.0