kubefwd forwards many cluster services to unique loopback IPs and updates hosts so in-cluster hostnames work locally. It offers a TUI, auto-reconnect, REST API, and MCP integration.
Overview
kubefwd is a command-line utility for developers who need cluster services on a laptop without rewriting connection strings. It discovers services in selected namespaces, assigns each a distinct 127.x.x.x address, writes matching names to the hosts file, and maintains port forwards through the Kubernetes API.
Compared to single-service kubectl port-forward, it forwards an entire namespace at once, avoids port clashes via separate IPs, reconnects after pod changes, and can stream pod logs and traffic metrics in an interactive terminal UI. Label and field selectors, multi-namespace and multi-cluster use, headless services, and port mapping are supported.
Installation paths include Homebrew on macOS, Linux packages, Windows, and Docker. Operation requires kubectl access and elevated privileges for hosts and network interface changes. A REST API with many endpoints and an MCP server allow scripting and AI assistant control.
Documentation contrasts behavior with kubectl port-forward, Telepresence, and mirrord.
Key features
- Bulk namespace port forwarding
- Unique loopback IP per service
- Automatic hosts file updates
- Interactive TUI with metrics
- Auto-reconnect on pod churn
- REST API control
- MCP server for AI tools
- Multi-namespace and multi-cluster
Use cases
- Local apps using cluster DB hostnames
- Develop APIs against staging services
- Avoid per-service kubectl forwards
- Script forwards via REST API
- Connect from Cursor or Claude via MCP