K8s Port Forward MCP Server

Kubernetes Port Forward — MCP Server: port-forward Kubernetes services with terminal integration

Local serverstdioGo

What is the K8s Port Forward MCP MCP server?

Kubernetes Port Forward — MCP Server: port-forward Kubernetes services with terminal integration. That is what the k8s port forward mcp mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

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.

  • 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_forward accepts an array so each service can use different namespace, environment, localPort, and remotePort
  • Optional logs — open kubectl logs -f in a separate OS-level terminal window per service

The tools it exposes

The server publishes 7 tools. What each one is for:

  • list_k8s_namespaces — Title: List namespaces
  • Description — List all available Kubernetes namespaces
  • Parameters — None
  • Read-onlytrue
  • list_k8s_services — Title: List services
  • start_k8s_port_forward — Title: Start port-forward
  • stop_k8s_port_forward — Title: Stop port-forward

What it needs from you

  • Node.js 18 or newer - kubectl installed and configured with access to your cluster - VS Code, Cursor, Windsurf, Claude Desktop, Cline, or any other MCP client

Getting it running

k8s-port-forward-mcp on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

How it compares

This sits in the cloud and infrastructure group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. K8s Port Forward MCP's toolset — list_k8s_namespaces, Description, Parameters and 4 more — is a fair guide to whether it matches your workflow. It is maintained by oijusti; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
list_k8s_namespacesTitle: List namespaces
DescriptionList all available Kubernetes namespaces.
ParametersNone
Read-only**true**
list_k8s_servicesTitle: List services
start_k8s_port_forwardTitle: Start port-forward
stop_k8s_port_forwardTitle: Stop port-forward

How to install the K8s Port Forward MCP MCP server

{
  "mcpServers": {
    "k8s-port-forward": {
      "command": "npx",
      "args": ["-y", "k8s-port-forward-mcp"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Node.js 18 or newer - kubectl installed and configured with access to your cluster - VS Code, Cursor, Windsurf, Claude Desktop, Cline, or any other MCP client

Example prompts to try

  • Use K8s Port Forward MCP to list k8s namespaces.
  • Use K8s Port Forward MCP to Description.
  • Use K8s Port Forward MCP to Parameters.

Frequently asked questions

It connects K8s Port Forward MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 7 tools (list_k8s_namespaces, Description, Parameters, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with K8s Port Forward MCP directly.