# k8s-port-forward-mcp [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/oijusti/k8s-port-forward-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 171  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/k8s-port-forward-mcp

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

## Tools
Capabilities this server exposes over MCP:

- **namespace**
- **services**
- **serviceName**
- **list_k8s_services**
- **localPort**
- **remotePort**
- **environment**
- **dev**
- **qa**
- **stg**
- **prod**
- **includeLogs**

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

## Documentation

## What k8s-port-forward-mcp does

The k8s-port-forward-mcp MCP server adds an MCP interface to a Kubernetes port-forward workflow. It can inspect running pods to discover available services, relate short service names to environments and namespaces, and launch `kubectl port-forward` sessions on the developer's machine.

The service-discovery flow is intended for situations where an agent does not already know the exact namespace, pod, or port mapping. A client can ask for available Kubernetes services, then use the returned information to construct a port-forward request. Multiple services can be started through one request, and each entry can specify its own namespace, environment, local port, and remote port.

Optional log handling starts `kubectl logs -f` in a separate operating-system terminal window for each service. This keeps the forwarded connection and its live logs available as separate local processes or windows.

## How it works

The server runs as a local MCP process and translates structured tool calls into Kubernetes discovery and `kubectl` operations. Kubernetes access is not provided by the package itself: the host must already have `kubectl` installed and configured with permission to access the target cluster.

The main port-forward operation accepts an array of service configurations, which lets an MCP client request different ports or environments in the same call. A typical workflow is to list services, choose a service and environment, start a forward such as a local port mapped to a remote port, and then open the returned local URL.

Compared with running `kubectl port-forward` directly, k8s-port-forward-mcp is aimed at agent-driven discovery and structured requests. Direct kubectl remains the better fit when the operator already knows the exact namespace, pod, and ports and wants manual control.

## Setup and configuration

The runtime requires Node.js 18 or newer and a working `kubectl` installation with cluster access. A standard stdio configuration launches the package through npm's executor:

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

Add this configuration to an MCP client that supports local stdio servers. The README provides client-specific instructions for VS Code, Cursor, Windsurf, Claude Desktop, Cline, Claude Code, Codex, Gemini CLI, and LM Studio, among others. No server-specific environment variables are documented.

## Tools and capabilities

Supported operations and inputs documented for the server include:

- Listing Kubernetes services and discovering namespaces.
- Starting Kubernetes port-forwards through the `start_k8s_port_forward` operation.
- Supplying `serviceName`, `namespace`, `environment`, `localPort`, and `remotePort` for each requested forward.
- Starting multiple forwards in one MCP call.
- Requesting optional live logs with `includeLogs`.
- Selecting environment values such as `dev`, `qa`, `stg`, or `prod` where applicable.

The tool interface is designed for natural-language requests that an MCP client can convert into structured arguments. The server then uses the local Kubernetes context and kubectl configuration to perform the requested work.

_Full upstream README: https://allmcps.com/mcp/k8s-port-forward-mcp/readme_

