Get the FREE Ultimate OpenClaw Setup Guide →

kubefwd

Bulk port forwarding Kubernetes services for local development.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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)

  1. Install Docker on your machine.
  2. 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)

  1. Visit the kubefwd releases page and download the appropriate binary for your OS.
  2. Place the binary in a directory on your PATH, e.g. /usr/local/bin.
  3. Run: kubefwd svc -n <namespace> --tui

Option C: Homebrew (macOS)

  1. brew install kubefwd
  2. 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

Sponsor this space

Reach thousands of developers