ssh-admin
v0.2.0MCP server for SSH remote server management
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
registry_add_server Add Server
Adds a host to hosts.json. Credentials come from env or key files; never stored.
| Parameter | Type | Description |
|---|---|---|
alias * | string | Unique alias (e.g., 'prod-web') |
authMethod * | string | Auth method |
host * | string | Hostname or IP address |
username * | string | SSH username |
keyPath | string | Private key file path (key auth) |
port | number | SSH port (default: 22) |
registry_list_servers
Lists hosts from hosts.json without credentials.
registry_get_server Get Server
Gets one registered server by alias.
| Parameter | Type | Description |
|---|---|---|
alias * | string | Alias |
registry_update_server Update Server
Updates username, auth method, or key path; host and port are not changeable here.
| Parameter | Type | Description |
|---|---|---|
alias * | string | Alias to update |
authMethod | string | New auth method |
keyPath | string | New key path |
username | string | New username |
registry_delete_server Delete Server
Removes a server from hosts.json.
| Parameter | Type | Description |
|---|---|---|
alias * | string | Alias to delete |
connection_open Open Connection
Opens or reuses the live session per host; returns its sessionId (verified against the registry).
| Parameter | Type | Description |
|---|---|---|
alias * | string | Alias from registry |
timeout | number | Timeout in ms (default: 5000) |
connection_close Close Session
Closes an open SSH session by sessionId.
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | Session ID to close |
connection_list
Lists live SSH sessions.
command_execute_whitelisted Execute Command
Runs allowlisted read-only commands on an open SSH session without approval; other commands are refused (use command_execute_with_approval).
| Parameter | Type | Description |
|---|---|---|
command * | string | Shell command |
sessionId * | string | Session ID from connection_open |
timeout | number | Timeout in ms (default: 60000) |
command_execute_with_approval Execute Write Command
Runs a command that modifies the system (for use after user/client approval); appends an audit changelog entry. Read-only: use command_execute_whitelisted.
| Parameter | Type | Description |
|---|---|---|
command * | string | Shell command |
sessionId * | string | Session ID from connection_open |
timeout | number | Timeout in ms (default: 60000) |
file_edit Edit File
Applies a targeted edit to an existing file; makes a backup. dryRun previews the diff.
| Parameter | Type | Description |
|---|---|---|
mode * | string | 'replace' (exact text swap) or 'range' (line span) |
path * | string | Absolute path of the remote file |
replace * | string | Replacement text; empty string deletes the match or lines. |
sessionId * | string | Session ID from connection_open |
all | boolean | mode=replace: replace all matches (default false: exactly one required) |
dryRun | boolean | Preview as diff without writing (default false) |
endLine | integer | mode=range: last line (inclusive, >= startLine) |
find | string | mode=replace: exact single-line text; must match once unless all is set. |
startLine | integer | mode=range: first line (1-based, inclusive) |
timeout | number | Timeout in ms (default: 60000) |
get_agent_instructions Instruction
Must be called before any other tool; returns the agent instructions.