
K8s Port Forward Mcp
This server wraps kubectl port-forward into a set of MCP tools so Claude can discover services in your cluster and spin up local tunnels without you copying pod names or namespaces. It exposes tools to list namespaces, infer service names from running pods, and start multiple port-forwards in one call with custom local and remote ports. You can optionally open separate terminal windows streaming kubectl logs for each service. It's built for workflows where you want to ask "forward the api service to port 3002" instead of hunting down the exact pod and typing the kubectl command yourself. Requires Node.js and a configured kubectl context.
- tools
- 4
- transport
- STDIO
- last updated
- Feb 24, 2026
Tools
4 toolsPublic tool metadata for what this MCP can expose to an agent.
list_k8s_namespacesList all available Kubernetes namespaces.
List all available Kubernetes namespaces.
No parameter schema in public metadata yet.
list_k8s_servicesList available services grouped by short name and environment.
List available services grouped by short name and environment.
No parameter schema in public metadata yet.
start_k8s_port_forwardStart port-forwarding for one or more services.
Start port-forwarding for one or more services.
No parameter schema in public metadata yet.
stop_k8s_port_forwardStop all active port-forward processes started by this MCP server.
Stop all active port-forward processes started by this MCP server.
No parameter schema in public metadata yet.
Sponsors
Readme
Kubernetes Port Forward MCP
A Model Context Protocol (MCP) server that provides tools for discovering Kubernetes services and running kubectl port-forward sessions (optionally with separate log windows). It is designed for MCP clients/LLMs that translate natural language into structured tool calls.
Kubernetes Port Forward MCP vs kubectl port-forward
This package provides an MCP interface on top of the standard kubectl workflow.
kubectl: Best when you already know exact namespace/pod/ports and prefer manual control.- MCP: Best when an agent should discover services and run one or many port-forwards via tool calls.
Key Features
- Service discovery: list namespaces and infer services (short name → environments → namespace) from running pods.
- Multi-service in one session: start multiple port-forwards with one tool call.
- LLM-friendly API:
start_k8s_port_forwardaccepts an array so each service can use differentnamespace,environment,localPort, andremotePort. - Optional logs: open
kubectl logs -fin a separate OS-level terminal window per service.
Table of Contents
Details
- Repository
- github.com/oijusti/k8s-port-forward-mcp
- Categories
- Cloud & Infrastructure, Developer Tools
- Package
k8s-port-forward-mcp- Transport
- STDIO
- Registry
- MCP registry, active