ssh_exec
Run a one-off command on a configured remote server over SSH in a fresh, stateless session and return stdout, stderr, and exit status.
Instructions
Run a command on a server via an exec channel (stateless, fresh environment per call; connects lazily). Returns stdout, a "--- stderr ---" section only when stderr is non-empty, and [exit: N]. Output is capped (head+tail kept). Exit 1 is not flagged as an error. Use ssh_stream_* for stateful/interactive work.
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": {
"server": "<server>",
"command": "<command>"
},
"name": "ssh_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pty | No | Allocate a PTY (default false; stderr is merged into stdout when true) | |
| sudo | No | Run as root via sudo using the password stored in the OS credential store (Windows Credential Manager / macOS Keychain / Linux Secret Service) for the server user from config (never pass a password yourself). Runs bash -c on the remote (bash required); command stdin is EOF; not allowed for root users or with pty:true. | |
| server | Yes | Server alias from config.json (case-insensitive). Known aliases: (none configured) | |
| command | Yes | Command to execute | |
| timeout | No | Timeout in ms (default 30000) |