kubefwd
Bulk port forwarding Kubernetes services for local development.
claude mcp add --transport stdio txn2-kubefwd docker run -i txn2/kubefwd services -n default --tui
How to use
kubefwd is a Kubernetes-focused port-forwarding utility that bulk forwards all services in a namespace to your local machine, assigning each service a unique loopback IP address. This enables you to interact with cluster services as if they were running locally, using the service names (for example http://api-service:8080 or mysql -h database). The MCP integration adds AI-assisted automation and control capabilities, allowing you to query or control port-forwarding behavior via an API, enabling workflows driven by an AI assistant. Use the interactive TUI mode to monitor traffic, view per-service metrics, and reconnect automatically when pods restart. You can also run kubefwd via Docker, providing a portable way to forward services without installing binaries locally.
How to install
Prerequisites:
- Docker installed and running (for the Docker-based usage shown in the MCP config).
- kubectl configured to access your Kubernetes cluster.
- Optional: root/sudo access if using host network changes or editing /etc/hosts.
Installation options:
Option A: Docker (recommended for MCP integration)
- Install Docker on your machine.
- Run kubefwd via Docker (as configured in this MCP setup):
# From the MCP manifest above, the server is wired to run the Docker image txn2/kubefwd with the following command:
# docker run -i txn2/kubefwd services -n default --tui
Option B: Prebuilt binaries (local if you prefer to install a binary directly)
- Visit the kubefwd releases page and download the appropriate binary for your OS.
- Place the binary in a directory on your PATH, e.g. /usr/local/bin.
- Run: kubefwd svc -n <namespace> --tui
Option C: Homebrew (macOS)
- brew install kubefwd
- Run: kubefwd svc -n <namespace> --tui
Note: If you’re using MCP integration, ensure the environment is configured to allow REST API access to kubefwd’s MCP endpoints as documented by the project.
Additional notes
Tips:
- The unique IP per service (127.x.x.x) means you usually won’t encounter port conflicts when multiple services are forwarded.
- kubefwd updates /etc/hosts to resolve service names as in-cluster DNS names; ensure your /etc/hosts is writable by the process (use sudo if needed).
- If pods restart or connections drop, kubefwd’s auto-reconnect will re-establish forwards automatically.
- When using the MCP integration, you can manage forwards and retrieve status through the provided REST API endpoints; consult the MCP integration documentation for commands and auth requirements.
- For Windows users, consider using the Docker approach or Windows-compatible binaries to run the tool.
- If you run into permission or network issues, verify that required ports are not blocked by your firewall and that your kubeconfig allows API access.
Related MCP Servers
shellfirm
Terminal guardrails for humans and AI agents — intercepts dangerous commands with context-aware challenges before the damage is done.
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
k8s-pilot
Kubernetes Control Plane Server for Managing Multiple Clusters – the central pilot for your k8s fleets✈️✈️
mcp-ecosystem-platform
🚀 Ultimate Developer Productivity Suite - 11 specialized MCP servers for AI-powered code analysis, security scanning, browser automation, and workflow orchestration. FastAPI + React + TypeScript + Docker ready.
cybermem
Remote Self-hosted Memory MCP Server
rancher
MCP server for Rancher - Kubernetes management and deployment platform