portal_host
Manage the SSH host registry by listing, registering, or removing hosts with optional tags for group-based task execution.
Instructions
Manage the SSH host registry.
Modes
action="list": list all known hosts. Includes hosts.yaml / runtime- registered entries AND every
Hostalias discoverable in the OpenSSH client config (~/.ssh/config+ system-wide fallback; or only$PORTAL_SSH_CONFIGwhen it is an absolute path; or none of them when it is "none" — thessh -F noneanalogue), resolving real HostName/User/Port. Each entry has asourcefield: "hosts.yaml", "runtime", "ssh-config", or a "…+ssh-config" overlay (metadata from the declared origin, connection params from ssh config). Example: portal_host(action="list")action="register": add a host to the registry. Pass
host(ip/hostname), or justnameif ~/.ssh/config has a matching Host alias (registers a use_ssh_config overlay). Optional: user (default root), port (default 22), key_path (else asyncssh falls back to ~/.ssh/id_* or ssh-agent), tags (comma-separated, used by portal_exec's group_tag). Example: portal_host(action="register", name="web01", host="10.0.0.1", user="ubuntu", tags="web,prod")action="remove": remove a host from the registry. Required: name. Example: portal_host(action="remove", name="web01")
Hosts already defined in ~/.ssh/config are auto-resolved on first use; explicit
registration is only needed for tag-based grouping. This MCP tool only
accepts key-based hosts — password auth is intentionally not exposed
here so credentials cannot leak into LLM tool-call traces. To use
password auth, declare the host in hosts.yaml with auth: password and
a password_command:. See README §Authentication.
action="list" may include a per-host warnings array (e.g. a plaintext
password: field in hosts.yaml that is being ignored). When present,
relay these warnings to the user — they flag misconfigurations the user
must fix, and server-side logs are not visible to them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| name | No | ||
| port | No | ||
| tags | No | ||
| user | No | root | |
| action | Yes | ||
| key_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |