ensure_forward
Maintain a persistent reverse SSH forward to a remote host and return the remote port that reaches a local 127.0.0.1 service. Call again to renew its keep-alive before reuse.
Instructions
Keep a reverse SSH forward alive for as long as it is needed, and return the port P on that machine that reaches this computer's 127.0.0.1:D. A detached process holds it (it survives this process), re-establishes it when it drops, and keeps the same P while it can. Returns when the forward is ready (30 s, else SEAT_FORWARD_UNAVAILABLE). Call again before the next use: every call keeps it needed for 120 s more, and a session bound to the id keeps it needed. remote.ssh pins the host key file and one identity (paths only; the detached process restarts ssh by itself, so the agent socket must stay stable).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"to": "<to>"
},
"name": "ensure_forward"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Opaque id of this forward (A-Z a-z 0-9 . _ -, 1-64). The id of a registered terminal binding joins that binding's own forward. | |
| to | Yes | Where the forward leads on this computer: 127.0.0.1 and the port D | |
| remote | No | The machine to forward on: {host, user, port?, ssh: {known_hosts_file, host_key_alias?, identity_agent | identity_file}}. Required for an id that is not a terminal binding; ignored for one | |
| remote_port | No | Ask for this port on that machine and never move to another (default: the machine's sshd picks one and it is kept) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| port | Yes | ||
| ready | No | ||
| schema | Yes | ||
| ready_at | Yes |