oijusti avatar

K8s Port Forward Mcp

oijusti/k8s-port-forward-mcp

This server wraps kubectl port-forward into a set of MCP tools so Claude can discover services in your cluster and spin up local tunnels without you copying pod names or namespaces. It exposes tools to list namespaces, infer service names from running pods, and start multiple port-forwards in one call with custom local and remote ports. You can optionally open separate terminal windows streaming kubectl logs for each service. It's built for workflows where you want to ask "forward the api service to port 3002" instead of hunting down the exact pod and typing the kubectl command yourself. Requires Node.js and a configured kubectl context.

tools
4
transport
STDIO
last updated
Feb 24, 2026

Tools

4 tools

Public tool metadata for what this MCP can expose to an agent.

list_k8s_namespacesList all available Kubernetes namespaces.

List all available Kubernetes namespaces.

No parameter schema in public metadata yet.

list_k8s_servicesList available services grouped by short name and environment.

List available services grouped by short name and environment.

No parameter schema in public metadata yet.

start_k8s_port_forwardStart port-forwarding for one or more services.

Start port-forwarding for one or more services.

No parameter schema in public metadata yet.

stop_k8s_port_forwardStop all active port-forward processes started by this MCP server.

Stop all active port-forward processes started by this MCP server.

No parameter schema in public metadata yet.

Sponsors

Readme

Kubernetes Port Forward MCP

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.

Kubernetes Port Forward MCP vs kubectl port-forward

This package provides an MCP interface on top of the standard kubectl workflow.

  • 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.

Key Features

  • 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.

Table of Contents


View the full README on GitHub

Details

Repository
github.com/oijusti/k8s-port-forward-mcp
Categories
Cloud & Infrastructure, Developer Tools
Package
k8s-port-forward-mcp
Transport
STDIO
Registry
MCP registry, active

Related Cloud & Infrastructure MCP servers

View all
1unbearabledev avatarKubernetes Manifest Auditunbearabledev/k8s-manifest-auditkube-linter audit for Kubernetes manifests — 63 checks: security, availability, RBAC, network.0stars
2yawlabs avatarYaw Labs AWS MCPyawlabs/aws-mcpAWS MCP server — call any AWS API from AI assistants, with first-class SSO re-login5stars
3delega avatardelega.ai for AWS Pricing Calculatorai.delega/aws-pricing-calculatorCreate AWS cost estimates and shareable AWS Pricing Calculator URLs.0stars
4kubedoll-heavy-industries avatarHelm MCPkubedoll-heavy-industries/helm-mcpGive your AI assistant access to real Helm chart data. No more hallucinated values.yaml files.0stars
5cloudflare avatarMcpcloudflare/mcp-server-cloudflareCloudflare MCP servers3.8Kstars
6containers avatarKubernetes Mcp Servercontainers/kubernetes-mcp-serverA Model Context Protocol (MCP) server for Kubernetes and OpenShift2.2Kstars