← Back to directory
S

SSH MCP Server

Community
Manage remote SSH hosts through MCP.
Category
Dev Tools #357 of 751
Stars
★ 1.1k Very popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Node.js
Credentials
API key / credential required
License
ISC
Last commit
Tools
10
51FMRS · D

This project provides SSH command execution, SFTP file operations, and background task tools over stdio or Streamable HTTP. It can access remote hosts and run commands, so restrict command and file-path permissions before deployment and protect SSH credentials.

Strongest · Documentation 15/20 Weakest · Maintenance 7/20

Reliability
8/20
Security and permissions
8/20
Maintenance
7/20
Documentation
15/20
Setup experience
13/20
Why each score
Reliability 8/20
The README lists command execution, file transfer, file read/write, and background job tools, and describes timeouts, output limits, and some error behavior, showing consideration of key paths. It provides no verifiable CI, tests, or evidence of the initialization and tool-list handshake. Static documentation alone cannot confirm that implementation matches the declarations, so the score is reduced.
Security and permissions 8/20
The documentation describes locally managed credentials, command allow/block lists, HTTP tokens, and path restrictions. It also states that without an allowlist arbitrary remote commands can run, remote file paths are unrestricted by default, and rate limiting is absent. Tools can execute commands and write remote files, with no per-operation confirmation documented; these incomplete permission boundaries warrant deductions. The credential values shown are examples, and the supplied material gives no evidence of a red-line issue.
Maintenance 7/20
The repository has an ISC license and is not archived, and the README displays an npm version badge. The supplied material contains no verifiable commit history, recent release activity, issue response, dependency updates, or security response channel, so sustained maintenance cannot be established.
Documentation 15/20
The README provides setup examples for several authentication methods, proxies, multiple connections, transport modes, and HTTP, and explains tool purposes, timeouts, output limits, and some security boundaries. It does not provide complete parameter schemas for every tool, detailed troubleshooting, platform compatibility evidence, or cost information. Documentation claims also cannot substitute for implementation evidence, so full marks are not justified.
Setup experience 13/20
The README gives an npx-based configuration for a mainstream MCP client and covers password, key, SSH config, multiple connections, and HTTP access, making the setup path fairly clear. Users still need to prepare Node.js, SSH access, and credentials. The supplied material shows no platform compatibility validation or CI/test evidence, so the static calibration limits the score.

Static review · not runReviewed 2026-11-29

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesRuns commands or codeUses the network

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 and side effects

  • 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.

Setup

Before you start

Runtime:Node.js

SSH_MCP_2FA_CODE optionalsecret Set this to the verification code before starting the server when SSH requires keyboard-interactive 2FA/MFA.
SSH_MCP_HTTP_TOKEN optionalsecret Bearer token for HTTP transport; set a long random token and send it in the client’s Authorization header.

Add the server entry from the JSON example to your MCP client configuration, replacing the host, port, username, and authentication values. The example uses stdio and npx; you can also start a Streamable HTTP service with --mcp-transport http.

MCP config · JSON
{
  "mcpServers": {
    "ssh-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@fangjunjie/ssh-mcp-server",
        "--host",
        "192.168.1.1",
        "--port",
        "22",
        "--username",
        "root",
        "--password",
        "pwd123456"
      ]
    }
  }
}

Works in clients that read an "mcpServers" key. For clients such as VS Code that use a different key, the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "ssh-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@fangjunjie/ssh-mcp-server",
        "--host",
        "192.168.1.1",
        "--port",
        "22",
        "--username",
        "root",
        "--password",
        "pwd123456"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.ssh-mcp-server]
command = "npx"
args = ["-y", "@fangjunjie/ssh-mcp-server", "--host", "192.168.1.1", "--port", "22", "--username", "root", "--password", "pwd123456"]

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

Terminal
claude mcp add ssh-mcp-server -- npx -y @fangjunjie/ssh-mcp-server --host 192.168.1.1 --port 22 --username root --password pwd123456

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

After starting the MCP client, confirm that `execute-command` and `list-servers` appear in its tool list. Call `list-servers` to inspect configured SSH servers, then run a read-only command with `execute-command` and confirm it returns remote output.

Troubleshooting

  1. Check the host, port, username, and authentication settings; for SSH aliases, verify the SSH config path and entry.
  2. If commands fail in exec mode despite a successful login, check whether the target requires an interactive shell; shell mode does not provide upload or download.
  3. Check that allowlist or denylist regular expressions are valid and that the command passes them; with an allowlist enabled, command chaining, pipes, and redirection are rejected.
  4. Use the background job tools for long-running tasks; check command and connection timeouts and whether the remote host supports the required POSIX sh.
  5. For SFTP failures, check local and remote path restrictions, SFTP permissions, and transfer timeouts.

Things to try

Once connected, you can ask your AI assistant things like:

  • Run `df -h` on the default SSH server and summarize disk usage.
  • Read the remote server’s `/etc/hostname` file.
  • Upload the local `report.txt` to `/tmp/report.txt` on the remote server.
  • Start a background task running `ping -c 10 127.0.0.1`, then check its status.

Tools 10

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

Use cases

Run restricted remote maintenance commands from an MCP-enabled AI client.
Read, write, upload, or download remote files over SFTP.
Start and poll longer-running background tasks such as builds or deployments.
Manage multiple SSH hosts through named connections.

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.

Similar servers

Source revision ff97574651f6 Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/ssh-mcp-server.svg)](https://followmcp.com/en/servers/ssh-mcp-server)