The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the MCP Remote Ssh listing page.
MCP server giving AI agents full SSH access -- persistent sessions, structured command output, SFTP file transfer, port forwarding, session transcript recording, and secret-safe environment variable injection with automatic output redaction.
Every other SSH MCP server is missing something: no password auth, no persistent sessions, no SFTP, no port forwarding, or no structured exit codes. This one has all of them -- plus the only MCP-level secret management that prevents AI agents from ever seeing your credentials.
The problem: When an AI agent needs to use API tokens, passwords, or keys on a remote server, the standard approach exposes secrets in the LLM's context window. The agent either reads the secret file (now it's in the conversation) or runs echo $TOKEN and sees the value in the output.
The solution: ssh_load_env_file reads secrets from a local file on your machine, injects them into the remote SSH session, and registers them for automatic output redaction. The AI agent can use the variables freely -- every tool response is scrubbed before it reaches the LLM.
read -r VAR <<< 'value' && export VAR (no process tree exposure)ssh_execute feeds secrets via stdin to a bash wrapper, so they never appear in /proc/*/cmdlinessh_execute, ssh_shell_send, ssh_shell_read, ssh_read_remote_file) is scrubbed before reaching the LLMabc123 is replaced before abc)| Threat | Mitigated? | How |
|---|---|---|
| Secret in LLM context window | Yes | Output redaction replaces values with *** |
| Secret in remote process tree (shell) | Yes | Shell builtins (read/export) don't fork |
| Secret in remote process tree (exec) | Yes | Secrets fed via stdin, never in /proc/*/cmdline |
LLM tries cat on the env file | N/A | File is local-only, doesn't exist on remote |
LLM tries echo $VAR | Yes | Output is redacted |
| Encoded/transformed secret (base64) | No | Only literal matches are redacted |
| MITM on first SSH connection | Accepted | AutoAddPolicy used — see note below |
This server uses Paramiko's AutoAddPolicy — unknown host keys are accepted without prompting. This is intentional for QE/lab environments where hosts are ephemeral (Beaker, cloud instances, CI machines). The trade-off:
If you operate on untrusted networks, consider wrapping connections through a VPN or SSH bastion with pre-distributed host keys. A host_key_policy parameter may be added in a future release for strict environments.
Standard .env format:
Recording is off by default. Enable it per session when you need an audit log of what the agent actually ran — useful for bug reproductions and test campaigns.
ssh_save_transcript or ssh_get_transcript first| Tool | Description |
|---|---|
ssh_connect | Connect with password, key, or agent auth. Optional record=True to start a transcript immediately. Returns session_id |
ssh_list_sessions | List active sessions |
ssh_close_session | Close a session and release resources |
| Tool | Description |
|---|---|
ssh_execute | Run a command, returns {stdout, stderr, exit_code} |
ssh_sudo_execute | Run with sudo elevation |
| Tool | Description |
|---|---|
ssh_shell_open | Open persistent shell (preserves cwd, env, processes) |
ssh_shell_send | Send text (with optional Enter) |
ssh_shell_read | Read current output buffer |
ssh_shell_send_control | Send Ctrl+C, Ctrl+D, etc. |
ssh_shell_wait | Wait for a pattern or output to stabilize |
| Tool | Description |
|---|---|
ssh_load_env_file | Load secrets from a local env file; values never returned to the LLM |
ssh_clear_secrets | Clear redaction registry (values become visible again) |
| Tool | Description |
|---|---|
ssh_start_recording | Start recording execute/sudo/shell I/O for this session |
ssh_stop_recording | Stop recording; transcript stays available until the session is closed |
ssh_get_transcript | Return the transcript as text or JSONL (last_n optional) |
ssh_save_transcript | Write the transcript to a local file on the MCP host |
| Tool | Description |
|---|---|
ssh_upload_file | Upload local file to remote host |
ssh_download_file | Download remote file to local machine |
ssh_read_remote_file | Read a remote text file |
ssh_write_remote_file | Write/append to a remote file |
ssh_list_remote_dir | List directory with metadata |
| Tool | Description |
|---|---|
ssh_forward_port | Create SSH tunnel (local -> remote) |
ssh_list_forwards | List active tunnels |
ssh_close_forward | Close a tunnel |
Built on Paramiko (SSH) + FastMCP (MCP protocol).
ssh_execute uses exec_command() for clean structured output with real exit codesssh_execute feeds exports via stdin to a bash wrapper, then execs the actual command -- secrets never appear in the process treessh_shell_* uses invoke_shell() for persistent interactive sessionsrun_in_executor to stay asyncshell_read pollingMIT