ssh_exec
Run commands on remote Linux or OpenSSH hosts over SSH without ssh.exe or WSL. Authenticate with a key or password and return stdout, stderr, and exit code.
Instructions
Run a command on a remote host over SSH, fully in-process (no ssh.exe, no WSL — works headless). Use for Linux hosts or any OpenSSH target. Auth via privateKeyPath or password. Returns stdout, stderr, exit code.
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": {
"host": "<host>",
"username": "<username>",
"command": "<command>"
},
"name": "ssh_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Remote host or IP. | |
| port | No | SSH port (default 22). | |
| tail | No | Keep the LAST maxOutputBytes instead of the first (tail) — useful for long logs. | |
| jumps | No | ||
| command | Yes | Command to run on the remote host. | |
| password | No | Password auth (used if no key). | |
| username | Yes | SSH username. | |
| logOutput | No | Opt in to private file-backed raw output logs; may include secrets emitted by command. | |
| timeoutMs | No | Hard timeout in ms (default 60000). Also bounds the connection handshake. | |
| passphrase | No | Passphrase for the private key, if any. | |
| hostKeyPins | No | Explicit SHA256:base64 trusted host key fingerprints; multiple keys permit rotation. | |
| credentialRef | No | Operator-provisioned scoped credential reference, exclusive with raw auth. | |
| logQuotaBytes | No | Combined stdout/stderr quota (default 8 MiB); incomplete beyond quota. | |
| maxOutputBytes | No | Cap captured stdout/stderr per stream (bytes, default 1 MiB). | |
| privateKeyPath | No | Path to a private key file on this Windows host, e.g. C:\\Users\\isak\\.ssh\\id_ed25519. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log | No | ||
| detail | Yes | ||
| stderr | Yes | ||
| stdout | Yes | ||
| target | Yes | ||
| exitCode | Yes | ||
| timedOut | Yes | ||
| transport | Yes | ||
| durationMs | Yes | ||
| truncation | Yes | ||
| executionId | Yes | ||
| errorRecords | No | ||
| schemaVersion | Yes | ||
| terminationStatus | Yes | ||
| terminationCertainty | Yes | ||
| errorRecordsTruncated | No |