ssh-remote-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SSH_REMOTE_MCP_DEBUG | No | Set to '1' to print diagnostic lifecycle logs to stderr. | |
| SSH_REMOTE_MCP_CONFIG | No | Custom path to hosts.json. | |
| SSH_REMOTE_MCP_SECRETS | No | Custom path to secrets.json. | |
| SSH_REMOTE_MCP_AUDIT_LOG | No | Custom audit JSONL path, or 'off' to disable audit logging. | |
| SSH_REMOTE_MCP_SSH_CONFIG | No | Override the default OpenSSH config file (-F). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
ssh-remote-mcp: Multi-host SSH MCP server for production Linux/Unix and Windows servers.
Usage rules:
No ssh_connect required first: call ssh_read/ssh_edit/ssh_exec/ssh_upload/ssh_download directly with explicit
target(connections are pooled and reused lazily).All remote paths MUST be explicit absolute paths (/etc/..., C:...) or home-relative ~/... paths.
ssh_exec and ssh_bg_start require explicit
cwd(use '~' for system-wide commands like systemctl/df). Execution aborts if cwd does not exist.ssh_write, ssh_upload, and ssh_download default to overwrite=false; set overwrite=true explicitly only when intentionally replacing an existing file.
Before editing production configs with ssh_edit, read with ssh_read first and pass
expected_sha256(usedry_run: truefor high-risk changes).On [TRANSPORT_LOST_IN_FLIGHT], NEVER blindly retry non-idempotent commands or writes; inspect remote state first.
Tool bug reporting (IMPORTANT):
If any tool returns [MCP_INTERNAL_ERROR], explicitly report the tool name, ref ID (req-xxxxxx), sanitized arguments, and error text to the user at the end of your reply (issues: https://github.com/wcbup/ssh-remote-mcp/issues).
If a dedicated tool (ssh_read, ssh_write, ssh_edit, ssh_ls, ssh_find, ssh_grep, ssh_upload, ssh_download, ssh_bg_*) behaves unexpectedly or returns suspicious output and you fall back to ssh_exec as a workaround, DO NOT stay silent: append a brief 'SSH MCP Feedback' note at the end of your reply explaining what failed and how you worked around it.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ssh_hostsA | List SSH host aliases from ~/.ssh/config, local policy entries (read-only flags, descriptions, whether credentials are configured), and currently active pooled connections. |
| ssh_connectA | Explicitly establish, reconnect, or health-probe a pooled SSH connection. Returns remote OS platform, shell, home directory, active transport, read-only status, and latency. Note: other SSH tools also auto-connect lazily. |
| ssh_disconnectA | Close and remove a specific target's pooled SSH connection, or omit target to close all pooled connections. |
| ssh_readA | Read a remote text file with line numbers, EOL detection, and SHA-256 content hash (for optimistic locking in ssh_edit). Large files (>2 MiB) are sliced on the remote host without downloading the entire file. Binary files are rejected (use ssh_download instead). |
| ssh_writeA | Atomically write a remote file via a same-directory temp file and rename. Defaults to overwrite=false to protect production files; pass overwrite=true explicitly to replace an existing file. |
| ssh_editA | Apply one or more exact-match text replacements atomically on a remote file, preserving original permissions and CRLF/LF line endings. Supports expected_sha256 optimistic concurrency lock and dry_run diff preview. |
| ssh_lsA | List files and directories at an explicit remote path with type, size, permissions, and modified time. |
| ssh_findA | Find files/directories matching a glob pattern under a remote directory. Automatically excludes .git and node_modules; prefers ripgrep (rg) on Unix when installed. |
| ssh_grepA | Search text across remote files or a single file using regex or literal matching. Excludes .git and node_modules; uses ripgrep (rg) on Unix when installed. |
| ssh_execA | Execute a command synchronously on a remote Unix (bash/zsh/sh) or Windows (pwsh/powershell) host. Requires an explicit cwd (absolute path or '~'); aborts cleanly if cwd does not exist. Kills the remote process tree on timeout or cancellation. |
| ssh_uploadA | Stream a local file or directory directly to a remote host without passing file bytes through the LLM context. Uses SFTP over the pooled connection with automatic pipe fallback for hosts without sftp-server. Defaults to overwrite=false and verifies SHA-256 on single files. |
| ssh_downloadA | Stream a remote file or directory directly to the local filesystem without passing file bytes through the LLM context. Uses SFTP with automatic pipe fallback, defends against path traversal/symlinks, defaults to overwrite=false, and verifies SHA-256 on single files. Permitted even on read-only targets. |
| ssh_bg_startA | Start a non-interactive detached background command on a remote Unix or Windows server. Output is logged to a private remote temp file so the job and logs survive SSH disconnects. Requires explicit cwd. |
| ssh_bg_statusA | Check live running status, exit code, and tail/incremental logs of a background job by job_id. Omit job_id to list all tracked background jobs. |
| ssh_bg_killA | Deliver a signal to a remote background job's real process group (Unix) or validated process tree (Windows taskkill /T /F), and optionally clean up its remote temp log directory. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 15 tools
Most tools target clearly distinct resource+action pairs (read vs grep vs find, connect vs disconnect, bg_start vs bg_status vs bg_kill). The only mild overlaps are ssh_read vs ssh_download (text vs binary/streaming) and ssh_write vs ssh_upload (content vs streaming), but the descriptions explicitly disambiguate these ('binary rejected, use ssh_download', 'without passing bytes through LLM context').
Every tool follows the ssh_ prefix + verb_noun pattern in consistent snake_case, including the grouped ssh_bg_start/ssh_bg_status/ssh_bg_kill family. No mixing of conventions.
15 tools is a well-scoped set that maps cleanly onto the domain's facets: connection management, file I/O, search, exec, and background jobs. Each tool earns its place with no obvious redundancy.
File read/write/edit/list/find/grep/upload/download, exec, connection lifecycle, and full background-job lifecycle are covered. The main gap is a dedicated delete/move/mkdir operation, though these are workable via ssh_exec (rm/mv/mkdir).