Run command in persistent SSH session
ssh_runRun non-interactive commands in a persistent remote shell, retaining working directory and environment across calls. Supports waiting and timeout for long-running tasks.
Instructions
Start a non-interactive command in the same persistent shell identified by id. cwd and environment changes persist. The call waits at most wait_sec (default 10 seconds); if the command is still active it returns status=running without stopping it. Commands have no automatic execution timeout by default. Only an explicitly provided timeout_sec sends Ctrl-C at that deadline. Never retry a running command: poll with ssh_peek(wait_sec=...) so the MCP call blocks until idle or the wait expires; do not spam peeks with wait_sec=0. Call ssh_interrupt to stop it, or open another session for concurrent work. Only one foreground command may run per id. Do not use vim, top, password prompts, or other interactive TUI/input flows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| command | Yes | ||
| wait_sec | No | ||
| timeout_sec | No |