ssh_run_command
Run shell commands on remote hosts via SSH and get stdout, stderr, and exit code.
Instructions
SSH into a remote host and run an arbitrary shell command. Returns stdout, stderr and the 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_run_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Remote hostname or IP address | |
| port | No | SSH port (default 22) | |
| command | Yes | Shell command to run on the remote host | |
| password | No | SSH password (if not using a key) | |
| username | Yes | SSH username | |
| passphrase | No | Passphrase for the private key | |
| privateKey | No | PEM-encoded private key content | |
| privateKeyPath | No | Path to private key file (e.g. ~/.ssh/id_rsa) |