Skip to content

kubernetes_port_forward

MCP tools › Containers and Kubernetes

Kubernetes port forwards owned by this Ferris IDEA process, shared with the Containers window: list; start runs kubectl port-forward <kind>/<name> <local>:<remote> --address 127.0.0.1 for a Pod, Service, Deployment, StatefulSet or DaemonSet (remote_port defaults to the object's first TCP port, local_port to the same number when free and >= 1024, else a free one) and waits for kubectl's forwarding line; stop ends forward id. start defaults to dry_run=true and returns the command; starting and stopping for real need the user-granted run right and are logged in .ferris-idea/agent-log.jsonl. Forwards listen on 127.0.0.1 only and end with the process.

Capabilitycontainers.kubernetes_port_forward
AreaContainers and Kubernetes
Accesschanges ide, processes
Reachesprocess, network
Rightsrun
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
actionrequiredstringlist, start or stop.
contextstringContext for start (default: the current one).
namespacestringNamespace for start (default: the context's).
kindstringPod, Service, Deployment, StatefulSet or DaemonSet for start.
namestringObject name for start.
remote_portintegerPort of the object (default: its first TCP port).minimum 0 · maximum 65535
local_portintegerPort on 127.0.0.1 (default: the remote port when free and >= 1024, else a free one).minimum 0 · maximum 65535
idintegerForward to stop.minimum 0
dry_runbooleanFor start: only report the command (default true).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project kubernetes_port_forward '{"action":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"action"
],
"properties": {
"action": {
"description": "`list`, `start` or `stop`.",
"type": "string"
},
"context": {
"description": "Context for `start` (default: the current one).",
"type": [
"string",
"null"
]
},
"namespace": {
"description": "Namespace for `start` (default: the context's).",
"type": [
"string",
"null"
]
},
"kind": {
"description": "`Pod`, `Service`, `Deployment`, `StatefulSet` or `DaemonSet` for `start`.",
"type": [
"string",
"null"
]
},
"name": {
"description": "Object name for `start`.",
"type": [
"string",
"null"
]
},
"remote_port": {
"description": "Port of the object (default: its first TCP port).",
"type": [
"integer",
"null"
],
"maximum": 65535,
"minimum": 0
},
"local_port": {
"description": "Port on 127.0.0.1 (default: the remote port when free and >= 1024, else a free one).",
"type": [
"integer",
"null"
],
"maximum": 65535,
"minimum": 0
},
"id": {
"description": "Forward to stop.",
"type": [
"integer",
"null"
],
"minimum": 0
},
"dry_run": {
"description": "For `start`: only report the command (default true).",
"type": [
"boolean",
"null"
]
}
}
}