Mcp Ssh Server — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Mcp Ssh Server (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Model Context Protocol (MCP) server for SSH remote access. Gives AI assistants the ability to execute commands, transfer files via SFTP, generate SSH key pairs, and set up port forwarding on any SSH-accessible server.
Before installing, ensure you have:
node --versionwinget install OpenJS.NodeJS.LTS or download from nodejs.orgnpm install -g @anthropic-ai/claude-codeclaude --versionThis server uses the ssh2 library (pure JavaScript) for all SSH operations. No native SSH binary is needed — it works identically across all platforms.
Typical flow:
ssh_connect with host and credentials (key or password)connectionId for all subsequent operationsssh_exec, transfers files with sftp_* toolsssh_disconnect or 30 min idle timeoutImportant: All commands executed viassh_execmust be non-interactive. Do NOT run commands that require user input (e.g.apt upgradewithout-y, interactive editors likevimornano,passwdwithout piping input). Always use non-interactive flags:apt install -y,DEBIAN_FRONTEND=noninteractive,yes |, etc.
Choose your environment:
The standard config works across most MCP clients:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["-y", "mcp-server-ssh"]
}
}
}No environment variables are required. Authentication is provided per-connection via tool calls.
<details> <summary>Claude Code</summary>
claude mcp add ssh -- npx -y mcp-server-ssh</details>
<details> <summary>Claude Code for VS Code Extension</summary>
This section is for the Claude Code VS Code extension, not GitHub Copilot. If you use VS Code with GitHub Copilot, see the VS Code with GitHub Copilot section instead.
Step 1: Install Claude Code CLI globally (required for the extension):
npm install -g @anthropic-ai/claude-codeStep 2: Add the MCP server via CLI:
claude mcp add ssh -- npx -y mcp-server-sshStep 3: Restart VS Code completely (Ctrl+Shift+P > "Reload Window" or close and reopen).
Step 4: Verify by asking Claude: "List SSH connections"
Windows users: Use PowerShell or CMD (not Git Bash) when running claude mcp add commands.The code --add-mcp command does NOT work with Claude Code extension — that's for VS Code Copilot only.</details>
<details> <summary>Claude Desktop</summary>
Follow the MCP install guide, use the standard config above.
</details>
<details> <summary>Cline</summary>
Open Cline MCP settings and add to your cline_mcp_settings.json:
{
"mcpServers": {
"ssh": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-server-ssh"],
"disabled": false
}
}
}</details>
<details> <summary>Codex</summary>
Use the Codex CLI:
codex mcp add ssh -- npx -y mcp-server-sshOr edit ~/.codex/config.toml:
[mcp_servers.ssh]
command = "npx"
args = ["-y", "mcp-server-ssh"]If your system's default Node.js is older than 18 (common with nvm — check with node --version), wrap the command so nvm loads the right version:
codex mcp add ssh -- bash -lc 'source ~/.nvm/nvm.sh >/dev/null 2>&1 && nvm use --silent 20 && npx -y mcp-server-ssh'Note: Codex requires network access to install packages via npx. If you run Codex in a restricted sandbox without network, npx installs will fail.
</details>
<details> <summary>Cursor</summary>
Go to Cursor Settings > MCP > Add new MCP Server. Use command type with the command npx -y mcp-server-ssh. Or add manually to .cursor/mcp.json:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["-y", "mcp-server-ssh"]
}
}
}</details>
<details> <summary>Roo Code</summary>
Open Roo Code MCP settings and add to roo_mcp_settings.json:
{
"mcpServers": {
"ssh": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-server-ssh"],
"disabled": false
}
}
}</details>
<details> <summary>VS Code with GitHub Copilot</summary>
Install using the VS Code CLI:
code --add-mcp '{"name":"ssh","command":"npx","args":["-y","mcp-server-ssh"]}'Or add to your VS Code MCP config manually using the standard config above.
This is for GitHub Copilot agent mode in VS Code. For the Claude Code extension, see the Claude Code for VS Code Extension section.
</details>
<details> <summary>Windsurf</summary>
Follow the Windsurf MCP documentation. Use the standard config above.
</details>
claude mcp add commandsC:\Users\<YourUsername>\.claude.jsonwinget install OpenJS.NodeJS.LTS or download from nodejs.orgC:\Users\<YourUsername>\.ssh\All optional. Credentials are provided per-connection via tool calls.
| Variable | Default | Description |
|---|---|---|
SSH_MCP_DEFAULT_USERNAME | — | Default SSH username when not specified in ssh_connect |
SSH_MCP_DEFAULT_KEY | ~/.ssh/id_ed25519 | Default private key path (auto-detects ed25519, rsa, ecdsa) |
SSH_MCP_IDLE_TIMEOUT | 1800000 (30 min) | Connection idle timeout in milliseconds |
SSH_MCP_STRICT_HOST_CHECK | false | Enable strict host key checking |
SSH_MCP_ALLOWED_HOSTS | — | Comma-separated allowed host patterns (e.g. *.example.com,10.0.0.*) |
SSH_MCP_MAX_FILE_SIZE | 1048576 (1MB) | Max file size for sftp_read |
SSH_MCP_EXEC_TIMEOUT | 30000 (30s) | Default command execution timeout |
All commands executed via ssh_exec must be non-interactive. The MCP server cannot handle commands that prompt for user input.
Do:
apt install -y nginx # -y flag for automatic yes
DEBIAN_FRONTEND=noninteractive apt upgrade -y
echo "newpassword" | passwd --stdin user # pipe input
ssh-keygen -t ed25519 -f /root/.ssh/id -N "" # empty passphrase flag
systemctl enable --now nginxDon't:
apt upgrade # prompts for confirmation
vim /etc/nginx.conf # interactive editor
passwd root # prompts for password
mysql_secure_installation # interactive wizard
top # interactive displayFor long-running commands, increase the timeout parameter (default: 30s).
| Tool | Description |
|---|---|
ssh_connect | Open persistent SSH connection (password or key auth). Returns connectionId |
ssh_disconnect | Close a connection by ID, or close all |
ssh_list_connections | List active connections with host/username/timing |
| Tool | Description |
|---|---|
ssh_exec | Execute command, return stdout/stderr/exitCode. Configurable timeout |
ssh_system_info | Quick server overview: OS, kernel, uptime, CPU, memory, disk |
| Tool | Description |
|---|---|
sftp_ls | List directory contents with file metadata |
sftp_read | Read remote file (text or base64). Max 1MB default |
sftp_write | Write/create remote file |
sftp_mkdir | Create directories (with recursive option) |
sftp_rm | Remove file or directory (with recursive option) |
sftp_mv | Move/rename file or directory |
sftp_stat | Get file metadata (size, permissions, owner, timestamps) |
| Tool | Description |
|---|---|
ssh_keygen | Generate key pair (ed25519/rsa/ecdsa). Returns keys as strings, does NOT save to disk. For use with ssh_connect, prefer ecdsa/rsa |
ssh_port_forward | Create local or remote TCP port tunnel |
Port forwarding requirements: The remote server'ssshd_configmust haveAllowTcpForwarding yes(default on most systems). For remote forwards that listen on all interfaces, the server also needsGatewayPorts yesorGatewayPorts clientspecified.
This server pairs with vpsnet-mcp for complete VPS provisioning + configuration:
Combined config:
{
"mcpServers": {
"vpsnet": {
"command": "npx",
"args": ["-y", "vpsnet-mcp"],
"env": {
"VPSNET_API_KEY": "your_api_key_here"
}
},
"ssh": {
"command": "npx",
"args": ["-y", "mcp-server-ssh"]
}
}
}Example workflow:
User: "Create a VPS and install nginx on it"
AI (using vpsnet-mcp):
1. get_order_plans → pick a plan
2. order_service → get VPS IP
AI (using mcp-server-ssh):
3. ssh_connect(host: "185.x.x.x", username: "root", password: "...")
4. ssh_exec("apt update && apt install -y nginx")
5. ssh_exec("systemctl enable --now nginx")npm install -g @anthropic-ai/claude-codeclaude --version should show a version numberclaude mcp add ssh -- npx -y mcp-server-ssh~/.claude.json for correct configurationclaude: command not foundInstall the Claude Code CLI globally:
npm install -g @anthropic-ai/claude-codeVerify your PATH includes npm global packages. On Windows, restart your terminal after installing.
Cannot parse privateKey error with ed25519The ssh2 library's ed25519 support requires a native addon that may not be available in all environments. Switch to ecdsa or rsa:
ssh_keygen(type: "ecdsa", bits: 256)ping <host> or telnet <host> 22fetch is not defined or startup errorsThis server requires Node.js 18+. If your default node is older (common with nvm setups), either:
nvm alias default 20~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.