ssh-admin

v0.2.0
ssh-admin Checked 2 hours ago Published 1 month ago

MCP 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.

ParameterTypeDescription
alias *stringUnique alias (e.g., 'prod-web')
authMethod *stringAuth method
host *stringHostname or IP address
username *stringSSH username
keyPathstringPrivate key file path (key auth)
portnumberSSH port (default: 22)

registry_list_servers

Lists hosts from hosts.json without credentials.

registry_get_server Get Server

Gets one registered server by alias.

ParameterTypeDescription
alias *stringAlias

registry_update_server Update Server

Updates username, auth method, or key path; host and port are not changeable here.

ParameterTypeDescription
alias *stringAlias to update
authMethodstringNew auth method
keyPathstringNew key path
usernamestringNew username

registry_delete_server Delete Server

Removes a server from hosts.json.

ParameterTypeDescription
alias *stringAlias to delete

connection_open Open Connection

Opens or reuses the live session per host; returns its sessionId (verified against the registry).

ParameterTypeDescription
alias *stringAlias from registry
timeoutnumberTimeout in ms (default: 5000)

connection_close Close Session

Closes an open SSH session by sessionId.

ParameterTypeDescription
sessionId *stringSession 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).

ParameterTypeDescription
command *stringShell command
sessionId *stringSession ID from connection_open
timeoutnumberTimeout 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.

ParameterTypeDescription
command *stringShell command
sessionId *stringSession ID from connection_open
timeoutnumberTimeout in ms (default: 60000)

file_edit Edit File

Applies a targeted edit to an existing file; makes a backup. dryRun previews the diff.

ParameterTypeDescription
mode *string'replace' (exact text swap) or 'range' (line span)
path *stringAbsolute path of the remote file
replace *stringReplacement text; empty string deletes the match or lines.
sessionId *stringSession ID from connection_open
allbooleanmode=replace: replace all matches (default false: exactly one required)
dryRunbooleanPreview as diff without writing (default false)
endLineintegermode=range: last line (inclusive, >= startLine)
findstringmode=replace: exact single-line text; must match once unless all is set.
startLineintegermode=range: first line (1-based, inclusive)
timeoutnumberTimeout in ms (default: 60000)

get_agent_instructions Instruction

Must be called before any other tool; returns the agent instructions.