ssh_exec
Execute a command on a connected SSH session and return stdout, stderr, and exit code; use timeouts or background jobs for long-running tasks.
Instructions
Execute a command on a connected SSH session. Returns stdout, stderr, and exit code. timeout applies to this call only; on timeout the execution channel is closed and the command is not run again. Set background=true to return a job_id immediately, then use ssh_exec_poll and ssh_exec_cancel. If session_id is omitted, uses the default pre-configured session.
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": {
"command": "<command>"
},
"name": "ssh_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Command to execute on the remote server | |
| timeout | No | Override command timeout in ms. For background jobs this is optional; omit it to keep the command running until it exits or is cancelled. | |
| background | No | Return immediately and keep the command running as a job | |
| session_id | No | Session ID (optional if using pre-configured server) |