# SSH MCP Server

> Manage remote SSH hosts through MCP.

- **URL**: https://followmcp.com/en/servers/ssh-mcp-server
- **Category**: Dev Tools
- **Origin**: Community
- **Stars**: 1.1k
- **FMRS Score**: 51/100 (Grade D)
- **Source**: https://github.com/classfang/ssh-mcp-server
- **Transports**: stdio (local process), Streamable HTTP
- **Runtimes**: Node.js
- **Auth**: API key / credential required

## Overview
SSH MCP Server connects MCP-enabled AI applications to remote SSH hosts for command execution, file operations and transfers, and background task management. It supports password and private-key authentication, along with configurable command and file-path restrictions. It is not an SSH terminal client or a remote command service suited to untrusted users.

## Best for
- Operators and developers who need MCP client access to SSH hosts they manage.
- Trusted environments where command and file-path permissions can be configured.

## Not for
- Tasks requiring direct interactive SSH terminal access.
- Exposing unprotected remote command execution to untrusted users or an open network.
- Using SFTP file tools in shell transport mode.

## Required permissions
- The service needs local access to SSH authentication material such as a password, private key, or SSH agent.
- It needs network access to configured SSH hosts; file tools also need the relevant local file access and remote SFTP permissions.
- Commands run with the privileges of the SSH account and server configuration; allowlists, denylists, and path restrictions can narrow access.

## Risks
- Without a command allowlist, tools can run arbitrary commands remotely, subject to the SSH account's privileges.
- Private keys are read into the service process memory; an insecure host or configuration can expose credentials.
- Without allowed remote paths configured, SFTP tools permit arbitrary remote paths; prompt injection could induce access to sensitive files.
- If HTTP mode listens on a non-local address without a token, clients that can reach the port may run remote commands.
- The service has no built-in rate limiting, so connection requests or large transfers may create denial-of-service risk.

## Client config (JSON)
```json
{
  "mcpServers": {
    "ssh-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@fangjunjie/ssh-mcp-server",
        "--host",
        "192.168.1.1",
        "--port",
        "22",
        "--username",
        "root",
        "--password",
        "pwd123456"
      ]
    }
  }
}
```

## Tools (10)
- `execute-command`: Run an SSH command on a remote server and return its result.
- `upload`: Upload local files or directories to a remote server over SFTP.
- `download`: Download remote files or directories to a local path over SFTP.
- `read-file`: Read a remote text file in byte ranges over SFTP; binary files are rejected.
- `write-file`: Write or append text to a remote file over SFTP.
- `list-servers`: List configured SSH servers.
- `job-start`: Start a background command on a remote server and return its job ID.
- `job-status`: Get a background job's status, exit code, and output.
- `job-kill`: Terminate a background job.
- `job-list`: List recent background jobs and their statuses.
