Execute Remote Command
ssh_execRun a command synchronously on a remote Unix or Windows host over SSH with an explicit working directory, timeout, and output cap. Aborts cleanly if the directory is missing and kills the process tree on timeout or cancellation.
Instructions
Execute a command synchronously on a remote Unix (bash/zsh/sh) or Windows (pwsh/powershell) host. Requires an explicit cwd (absolute path or '~'); aborts cleanly if cwd does not exist. Kills the remote process tree on timeout or cancellation.
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": {
"target": "<target>",
"cwd": "<cwd>",
"command": "<command>"
},
"name": "ssh_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Required remote working directory: explicit absolute path (e.g. /srv/app or C:\Services\app) or '~' for system-wide commands. Command aborts if cwd does not exist. | |
| shell | No | Optional shell override for this single command | |
| target | Yes | SSH target as configured host alias, host, user@host, user@host:port, or [ipv6]:port. Never include remote paths in target. | |
| command | Yes | Command to run in the remote shell | |
| timeout_seconds | No | Timeout in seconds (default: 60, max: 600) | |
| max_output_bytes | No | Max stdout/stderr bytes captured per stream (default: 262144) |