Kubernetes Port Forward – Mcp Server
About
MCP server that provides tools for managing Kubernetes port-forwarding sessions.
Details
- Author
- oijusti
- Downloads
- 257
- Categories
- Developer Tools, Other, Infrastructure, Cloud Service
Jump to
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Kubernetes Port Forward – Mcp ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
{
"mcpServers": {
"k8s-port-forward-mcp": {
"command": "npx",
"args": [
"-y",
"k8s-port-forward-mcp"
]
}
}
}
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"kubernetes port forward \u2013 mcp server": {
"k8s-port-forward-mcp": {
"command": "npx",
"args": [
"-y",
"k8s-port-forward-mcp"
]
}
}
}
}
McpServers
{
"k8s-port-forward-mcp": {
"command": "npx",
"args": [
"-y",
"k8s-port-forward-mcp"
]
}
}
MCP server that provides tools for managing Kubernetes port-forwarding sessions.
A Model Context Protocol (MCP) server that provides tools for discovering Kubernetes services and runningkubectl port-forwardsessions (optionally with separate log windows). It is designed for MCP clients/LLMs that translate natural language into structured tool calls.
Kubernetes Port Forward MCP vskubectl port-forward
This package provides anMCP interfaceon top of the standardkubectlworkflow.
- 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.
- 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: openkubectl logs -fin a separate OS-level terminal window per service.
- Requirements
- Quick Start
- Getting Started
- Examples
- Tools
- Output and Logs
- Configuration
- Validation and Debugging
- Node.js 18 or newer
- kubectlinstalled and configured with access to your cluster
- VS Code, Cursor, Windsurf, Claude Desktop, Cline, or any other MCP client
- Add this server to your MCP client (use the config in Getting Started below).
- Ask your assistant: "List available Kubernetes services."
- Ask your assistant: "Run api service on local port 3002."
- Open the returned URL (for examplehttp://localhost:3002).
- When finished, ask: "Stop all port-forwards."
First, install the Kubernetes Port Forward MCP server with your client.
Standard configworks in most MCP clients:
{ "mcpServers": { "k8s-port-forward": { "command": "npx", "args": ["-y", "k8s-port-forward-mcp@latest"] } } }
Add via the Amp VS Code extension settings screen or by updating your settings.json file:
"amp.mcpServers": { "k8s-port-forward": { "command": "npx", "args": [ "-y", "k8s-port-forward-mcp@latest" ] } }
amp mcp add k8s-port-forward -- npx -y k8s-port-forward-mcp@latest
Add via the Antigravity settings or by updating your configuration file:
{ "mcpServers": { "k8s-port-forward": { "command": "npx", "args": ["-y", "k8s-port-forward-mcp@latest"] } } }
Use the Claude Code CLI to add the Kubernetes Port Forward MCP server:
claude mcp add k8s-port-forward npx -y k8s-port-forward-mcp@latest
Follow the MCP installguide, use the standard config above.
Follow the instruction in the sectionConfiguring MCP Servers
Add the following to yourcline_mcp_settings.jsonfile:
{ "mcpServers": { "k8s-port-forward": { "type": "stdio", "command": "npx", "timeout": 30, "args": ["-y", "k8s-port-forward-mcp@latest"], "disabled": false } } }
Use the Codex CLI to add the Kubernetes Port Forward MCP server:
codex mcp add k8s-port-forward npx "-y" "k8s-port-forward-mcp@latest"
Alternatively, create or edit the configuration file~/.codex/config.tomland add:
[mcp_servers.k8s-port-forward] command = "npx" args = ["-y", "k8s-port-forward-mcp@latest"]
For more information, see theCodex MCP documentation.
Use the Copilot CLI to interactively add the Kubernetes Port Forward MCP server:
Alternatively, create or edit the configuration file~/.copilot/mcp-config.jsonand add:
{ "mcpServers": { "k8s-port-forward": { "type": "local", "command": "npx", "tools": [""], "args": ["-y", "k8s-port-forward-mcp@latest"] } } }
For more information, see theCopilot CLI documentation.
Go toCursor Settings->MCP->Add new MCP Server. Name to your liking, usecommandtype with the commandnpx -y k8s-port-forward-mcp@latest. You can also verify config or add command arguments via clickingEdit.
Use the Factory CLI to add the Kubernetes Port Forward MCP server:
droid mcp add k8s-port-forward "npx -y k8s-port-forward-mcp@latest"
Alternatively, type/mcpwithin Factory droid to open an interactive UI for managing MCP servers.
For more information, see theFactory MCP documentation.
Follow the MCP installguide, use the standard config above.
Go toAdvanced settings->Extensions->Add custom extension. Name to your liking, use typeSTDIO, and set thecommandtonpx -y k8s-port-forward-mcp@latest. Click "Add Extension".
Follow the MCP Serversdocumentation. For example in.kiro/settings/mcp.json:
{ "mcpServers": { "k8s-port-forward": { "command": "npx", "args": ["-y", "k8s-port-forward-mcp@latest"] } } }
Go toProgramin the right sidebar ->Install->Edit mcp.json. Use the standard config above.
Follow the MCP Serversdocumentation. For example in~/.config/opencode/opencode.json:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "k8s-port-forward": { "type": "local", "command": ["npx", "-y", "k8s-port-forward-mcp@latest"], "enabled": true } } }
Follow the MCP installguide, use the standard config above. You can also install the Kubernetes Port Forward MCP server using the VS Code CLI:
# For VS Code code --add-mcp '{"name":"k8s-port-forward","command":"npx","args":["-y","k8s-port-forward-mcp@latest"]}'
After installation, the Kubernetes Port Forward MCP server will be available for use with your GitHub Copilot agent in VS Code.
Go toSettings->AI->Manage MCP Servers->+ Addtoadd an MCP Server. Use the standard config above.
Alternatively, use the slash command/add-mcpin the Warp prompt and paste the standard config from above:
{ "mcpServers": { "k8s-port-forward": { "command": "npx", "args": [ "-y", "k8s-port-forward-mcp@latest" ] } } }
Follow Windsurf MCPdocumentation. Use the standard config above.
Quick reference (natural language → tool calls)
-
"Run api and auth services on local ports 3002, 3003"
→list_k8s_services({})thenstart_k8s_port_forward({ services: [{ serviceName: "api", localPort: 3002 }, { serviceName: "auth", localPort: 3003 }] })
"Run order service from shared services namespace in local port 3000"
→start_k8s_port_forward({ services: [{ serviceName: "order", namespace: "shared-services", localPort: 3000 }] })
"Run order service from shared services namespace and remote port 3000 in local port 3000"
→start_k8s_port_forward({ services: [{ serviceName: "order", namespace: "shared-services", localPort: 3000, remotePort: 3000 }] })
"Run api service in qa environment on local port 3001"
→start_k8s_port_forward({ services: [{ serviceName: "api", environment: "qa", localPort: 3001 }] })
"Run auth service in prod environment from production namespace on local port 3002"
→start_k8s_port_forward({ services: [{ serviceName: "auth", environment: "prod", namespace: "production", localPort: 3002 }] })
"Stop all port-forwards"
→stop_k8s_port_forward({})
User:"Run the frontend service in qa on port 3001"*
- Calllist_k8s_services({})to find the exact service name.
- Receive list containing e.g.frontend: qa (ns: ...), dev (ns: ...).
- Callstart_k8s_port_forward({ services: [{ serviceName: "frontend", environment: "qa", localPort: 3001 }] }).
- Result: port-forwards run in the MCP server process; ifincludeLogsis true, logs open in a separate window. The tool result includeshttp://localhost:3001and the exact kubectl commands.
- Title: List namespaces
- Description: List all available Kubernetes namespaces.
- Parameters: None
- Read-only:true
- Title: List services
- Description: List available services grouped by short name and environment.
- Parameters:
- namespace(string, optional): Filter results to a namespace.
- Title: Start port-forward
- Description: Start port-forwarding for one or more services.
- Parameters:
- services(array, required): List of service configs.
- serviceName(string, required): Short name of the service. (Calllist_k8s_servicesfirst.)
- localPort(number, required): Local port to bind (1-65535).
- namespace(string, optional): Namespace to target.
- remotePort(number, optional): Remote (cluster) port.
- environment(string, optional):dev|qa|stg|prod.
- includeLogs(boolean, optional): Whether to open logs in a separate window (default: true).
- Title: Stop port-forward
- Description: Stop all active port-forward processes started by this MCP server.
- Parameters: None
- Read-only:false
Since the MCP server spawns actualkubectlprocesses in the background, you may want to verify what's running and see the exact commands being executed.
# List all kubectl processes tasklist /fi "imagename eq kubectl.exe" # See the exact commands with process IDs Get-CimInstance Win32_Process -Filter "Name='kubectl.exe'" | Select-Object ProcessId,CommandLine
# List all kubectl processes ps aux | grep kubectl # See the exact commands with process IDs ps -ef | grep kubectl
- Verify port-forwards are actually running
- See the exact namespaces and ports being used
- Identify stuck processes that might need manual termination
- Debug connectivity issues by examining the actual commands
- Port already in use: choose another local port or stop the conflicting process.
- Connection refused: verify service name, namespace, and selected environment.
- No logs window: setincludeLogs: truein the port-forward request.
- Stuck process: terminate by PID (taskkill /PID <pid>on Windows,kill <pid>on Linux/macOS).
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Run and interpret Kubernetes commands interactively with a provided kubeconfig.
Tilt MCP is a Model Context Protocol server that integrates with Tilt to provide programmatic access to Tilt resources, logs, and management operations for Kubernetes development environments
All Azure MCP tools in a single server. The Azure MCP Server implements the MCP specification to create a seamless connection between AI agents and Azure services. Azure MCP Server can be used alone or with the GitHub Copilot for Azure extension in VS Code.
The Railway MCP Server enables natural language interaction with your Railway projects and infrastructure. Ask your IDE or AI assistant to create projects, deploy templates, manage environments, pull variables, redeploy services, and more.
The Shipyard CLI provides an MCP server for agents to manage Shipyard environments directly: by pulling logs, comparing branches, running tests, and stopping/starting environments..
Secure virtual machines for agents hosted by Superserve
A MCP server for managing Brev development environments using the Brev CLI.
Provides an offline AWS CDK API reference.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





