3.1 KiB
3.1 KiB
name, description
| name | description |
|---|---|
| mcp-ssh-server | Use an MCP SSH Server exposed to Codex for remote SSH operations. Use when Codex needs to run bounded remote commands, manage an interactive SSH terminal session, list remote directories, download files, or upload files through the mcp-ssh tools: ssh_exec, ssh_terminal_start, ssh_terminal_write, ssh_terminal_read, ssh_terminal_stop, sftp_list, sftp_get, and sftp_put. |
MCP SSH Server
Overview
Use this skill when an MCP SSH server is available and the task requires remote shell or file-transfer work. The server accepts direct SSH connection inputs and uses key-file authentication; it does not resolve OpenSSH aliases or use an SSH agent in the current tool surface.
For detailed inputs and examples, read references/tool-usage.md.
Workflow
- Identify the narrowest operation. Use
ssh_execfor one command, terminal tools for interactive/stateful work,sftp_listfor remote directory listing, andsftp_get/sftp_putfor file transfer. - Collect connection inputs before calling a tool:
host,username, optionalport, optionalkeyPath, and optionalkeyPassphrase. - Treat
hostas a direct hostname or IP address. Do not pass OpenSSH aliases unless the user confirms they resolve directly for this server. - Prefer explicit bounds for risky operations:
timeoutSecondsfor commands,idleTimeoutSecondsfor terminals, andmaxBytesfor transfers. - Keep secrets out of visible text. Use
keyPassphraseonly when required and never echo or store it. - Stop terminal sessions when finished with
ssh_terminal_stop.
Tool Selection
- Use
ssh_execfor checks, deployments, service commands, one-shot scripts, and commands where stdout/stderr and exit code matter. - Use
ssh_terminal_startplusssh_terminal_writeandssh_terminal_readfor REPLs, long-running interactive tools, TTY-sensitive commands, or workflows that need shell state. - Use
sftp_listto inspect remote directories. - Use
sftp_getto download a remote file into the MCP server working directory. - Use
sftp_putto upload a local file from the MCP server working directory to the remote host.
Safety Rules
- Set
timeoutSecondsfor commands that might hang. The default is bounded, but explicit values make intent clear. - Use
cwdwithssh_execinstead of shelling throughcd ... && ...when the tool supports it. - For terminal sessions, read output after writes and stop the session when done.
- For downloads and uploads, remember local paths must stay inside the MCP server process working directory.
- Leave
overwritefalse unless the user asked to replace an existing local or remote file. - For large files, set
maxBytesdeliberately.
Current Limits
- SSH agent auth is not part of the current tool inputs.
- OpenSSH config aliases,
ssh -G, ProxyJump, ProxyCommand, and known-host policy controls are not part of the current tool inputs. - Directory upload/download is not exposed; transfer individual files.
sftp_listhas no SCP fallback.sftp_getandsftp_putsilently fall back to SCP when SFTP is unavailable.