list_k8s_namespacesLABSCO SUMMARY
Discovery first, then forwarding — which is the part kubectl makes you do by hand.
The two read-only tools exist so a model can turn "the auth service in qa" into a real namespace and pod before forwarding anything, and the start call takes an array so a whole stack comes up in one request. Because it shells out to kubectl, you can always confirm what is running by listing processes yourself.
What it is
A wrapper around kubectl port-forward built for agents. It discovers services by short name from the pods that are actually running, then starts one or several forwards in a single call.
What you get
- Every namespace the cluster exposes to you (list_k8s_namespaces)
- Services grouped by short name and environment, inferred from running pods, so you can ask for a service without knowing where it lives (list_k8s_services)
- Several port-forwards started at once, each with its own namespace, environment, local port and remote port (start_k8s_port_forward)
- The URL to open and the exact kubectl command that was run, returned with the result
- Log tailing per forwarded service, opened in its own terminal window when you want it
- Every forward this server started, stopped in one call (stop_k8s_port_forward)
Requirements
Node.js and a kubectl already configured against your cluster — the server spawns real kubectl processes, so whatever kubectl can reach, this can reach. Runs from the published npm package, and the same configuration works across the common MCP clients.
Setup effort
One command — npx -y k8s-port-forward-mcp@latest
USE CASES
Bringing up a local stack for the afternoon
Ask for several services at once, each on its own local port, in a single request.
Reaching a service when you do not know its namespace
List services by short name and environment first, then forward the one that matches.
Watching logs while you test
Ask for logs alongside the forward and each service tails in its own window.
Clearing everything out
Stop every forward this server started, so no kubectl processes are left holding ports.
4 tools
Listed in project docs. Your client may show a different list.
list_k8s_servicesstart_k8s_port_forwardstop_k8s_port_forwardBEFORE YOU INSTALL
What to know first
Tools you get
4 tools named in the project's documentation.
Requires
- npx on PATH
- Node.js 18 or later
INSTALLATION
Connect your client
Server setup
npx -y k8s-port-forward-mcp@latestMCP Clients
Amp
{
"amp.mcpServers": {
"k8s-port-forward": {
"command": "npx",
"args": [
"-y",
"k8s-port-forward-mcp@latest"
]
}
}
}Antigravity, Claude Desktop, Gemini CLI, Kiro, LM Studio, Qodo Gen, Warp, Windsurf
{
"mcpServers": {
"k8s-port-forward": {
"command": "npx",
"args": [
"-y",
"k8s-port-forward-mcp@latest"
]
}
}
}Claude Code
claude mcp add k8s-port-forward -- npx -y k8s-port-forward-mcp@latestCline
{
"mcpServers": {
"k8s-port-forward": {
"type": "stdio",
"command": "npx",
"timeout": 30,
"args": [
"-y",
"k8s-port-forward-mcp@latest"
],
"disabled": false
}
}
}Codex
[mcp_servers.k8s-port-forward]
command = "npx"
args = ["-y", "k8s-port-forward-mcp@latest"]GitHub Copilot
{
"mcpServers": {
"k8s-port-forward": {
"type": "local",
"command": "npx",
"tools": [
"*"
],
"args": [
"-y",
"k8s-port-forward-mcp@latest"
]
}
}
}Factory Droid
droid mcp add k8s-port-forward "npx -y k8s-port-forward-mcp@latest"Goose
In Goose, go to Advanced settings → Extensions → Add custom extension
Name it to your liking, choose type STDIO, and set the command to npx -y k8s-port-forward-mcp@latest
Click "Add Extension"
OpenCode
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"k8s-port-forward": {
"type": "local",
"command": [
"npx",
"-y",
"k8s-port-forward-mcp@latest"
],
"enabled": true
}
}
}VS Code
code --add-mcp '{"name":"k8s-port-forward","command":"npx","args":["-y","k8s-port-forward-mcp@latest"]}'