Connect via SSH
ssh_connectCreates a reusable SSH connection to a specified host using key, agent, or environment-variable password auth, returning a connection ID for subsequent remote commands and SFTP transfers.
Instructions
Connects to any host supplied by the caller (no application-level allowlist) and returns a connectionId; later exec/SFTP calls reuse the same SSH session. Auth supports a private key path, SSH Agent, or a password held in a local environment variable; passwords never appear in tool arguments. The host key must already exist in known_hosts; unknown or changed keys are always rejected (first-use keys are never trusted automatically). This tool lets the server process connect to any address reachable on the network (including localhost and private networks); the actual scope is bounded by the host firewall.
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>",
"auth": "<auth>"
},
"name": "ssh_connect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auth | Yes | ||
| host | Yes | Target hostname, IPv4, or IPv6 (IPv6 may be written as [::1]) | |
| port | No | ||
| username | Yes | ||
| connectTimeoutMs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| port | Yes | ||
| state | Yes | ||
| reused | Yes | ||
| authType | Yes | ||
| username | Yes | ||
| connectionId | Yes | ||
| serverFingerprint | Yes |