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 Server?

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

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

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

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
list_k8s_namespacesTitle: List namespaces
ParametersNone
Read-onlyfalse
list_k8s_servicesTitle: List services
Parameters:services (array, required): List of service configs.
start_k8s_port_forwardTitle: Start port-forward
serviceNamestring, required): Short name of the service. (Call list_k8s_services first.)
localPortnumber, required): Local port to bind (1-65535).
namespacestring, optional): Namespace to target.
remotePortnumber, optional): Remote (cluster) port.
environmentstring, optional): dev | qa | stg | prod.
includeLogsboolean, optional): Whether to open logs in a separate window (default: true).
stop_k8s_port_forwardTitle: Stop port-forward

How to install the K8s Port Forward MCP Server

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

From the project documentation. Replace placeholders and example paths before connecting.

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

Kubernetes Port Forward — MCP Server: port-forward Kubernetes services with terminal integration Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.