ssh_exec
Execute arbitrary commands on a running Vast.ai instance over SSH. Resolves host and port automatically while keeping your private key secure locally.
Instructions
Execute a command on a running instance over SSH (paramiko).
Resolves the instance's ssh_host/ssh_port automatically. The private
key stays local — never sent to the Vast.ai API.
key_path defaults to the VASTAI_MCP_SSH_KEY_PATH env var if set.
Examples: ssh_exec(instance_id=12345, command="nvidia-smi") ssh_exec(instance_id=12345, command="ls /workspace", key_path="/home/me/.ssh/id_ed25519") ssh_exec(instance_id=12345, command="python train.py", user="root", timeout=300)
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": {
"instance_id": "<instance_id>",
"command": "<command>"
},
"name": "ssh_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | root | |
| command | Yes | ||
| timeout | No | ||
| key_path | No | ||
| instance_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||