remote-ssh-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@remote-ssh-mcp check disk space usage on the remote server"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
remote-ssh-mcp
Generic MCP server for connecting an MCP client to a remote Linux or Unix host over SSH.
It provides remote shell commands, directory listing, text and binary file access, SSH
port forwarding, and VS Code Remote-SSH URI generation. The server runs locally and
reuses the OpenSSH installation, configuration, keys, agents, and ProxyJump settings
already available on the user's machine.
Network Model
This MCP server is useful when the remote server cannot access the internet, or when you do not want the remote server to use its own outbound network connection.
The MCP client and remote-ssh-mcp process run on your local computer. Requests are
sent from the local computer to the remote server through SSH, so the remote server
does not need internet access for MCP communication. The only network requirement is
that your local computer can reach the server's SSH address and port.
This does not give remote commands internet access. Commands such as curl, wget,
git clone, npm install, or pip install still run on the remote server and require
network access from that server. To fetch files or data through the local computer,
download them locally first and then use remote_ssh_write_file_base64, or use an SSH
port forward where appropriate.
Related MCP server: ssh-mcp
Quick Setup
Clone the repository, install dependencies, and run the interactive setup wizard:
git clone https://github.com/bbt567/remote-ssh-mcp.git
cd remote-ssh-mcp
npm ci
npm run setupThe wizard:
Lists saved server profiles or creates a new profile.
Asks for the server IP/hostname, SSH user, port, and private-key path.
Detects an existing SSH key or generates an Ed25519 key.
Tests public-key authentication.
Offers to install the public key on the server. OpenSSH may request the server password once; the wizard never reads or stores it.
Saves the profile in
~/.remote-ssh-mcp/profiles.json.Installs a profile-specific MCP entry into Codex Desktop/CLI and/or Claude Code.
Generates a profile-specific JSON config as a portable backup.
Restart the selected clients after setup. Codex Desktop and Codex CLI share the same
~/.codex/config.toml, so installing into either Codex surface enables both.
Chinese instructions are available in docs/SETUP.zh-CN.md.
Multiple Servers
Run npm run setup again to add another server. Saved profiles are displayed before
the connection questions, so an existing server can be selected without re-entering
its address, user, port, or key path.
The default profile is installed as remote-ssh. Other profiles use distinct MCP
server names:
default -> remote-ssh
production -> remote-ssh-production
staging -> remote-ssh-stagingList saved profiles:
npm run profilesRemove a local profile:
npm run profiles -- remove stagingRemoving a profile does not remove its Codex or Claude Code MCP entry.
Requirements
Node.js 20 or newer
OpenSSH client available as
sshSSH public-key authentication configured for the target host
A local MCP client that supports stdio servers
Verify SSH before configuring the MCP client:
ssh 192.0.2.10 "hostname && whoami && pwd"If your SSH setup needs a username or a non-default port, use the environment variables
shown below or configure them in ~/.ssh/config.
Install From Source
git clone https://github.com/bbt567/remote-ssh-mcp.git
cd remote-ssh-mcp
npm ci
npm run setupThe repository does not store SSH passwords, private keys, or tokens.
MCP Client Configuration
The setup wizard installs clients using a profile name and profiles file:
{
"mcpServers": {
"remote-ssh": {
"command": "node",
"args": [
"C:\\path\\to\\remote-ssh-mcp\\dist\\index.js"
],
"env": {
"REMOTE_SSH_PROFILE": "production",
"REMOTE_SSH_PROFILES_FILE": "C:\\Users\\your-name\\.remote-ssh-mcp\\profiles.json"
}
}
}
}Direct SSH_HOST, SSH_USER, SSH_PORT, and SSH_IDENTITY_FILE configuration remains
supported for compatibility. Explicit environment variables override profile values.
REMOTE_SSH_* variables are supported as the explicit namespaced equivalents. When
both forms are present, REMOTE_SSH_* takes precedence.
Tools
remote_ssh_check: Check the SSH connection and return remote identity details.remote_ssh_local_diagnostics: Inspect the local OpenSSH environment and connection.remote_ssh_exec: Run a shell command with optional working directory and environment.remote_ssh_list_dir: List a remote directory withls -la.remote_ssh_read_text: Read a remote text file with a byte limit.remote_ssh_read_file_base64: Read a small remote binary file as base64.remote_ssh_write_text: Write UTF-8 text to a remote file.remote_ssh_write_file_base64: Decode base64 and write a remote file.remote_ssh_start_port_forward: Start a local SSH-Lport forward.remote_ssh_list_port_forwards: List port forwards created by this process.remote_ssh_stop_port_forward: Stop a port forward created by this process.remote_ssh_uri: Generate a VS Code Remote-SSH URI and CLI command.
Every remote tool accepts an optional host field that overrides the configured target
for that call. The command and file-write tools are intentionally powerful; review
tool calls before approving them in your MCP client.
Environment Variables
Variable | Default | Description |
| none | Saved profile to load |
|
| Local profiles file |
| none | Default hostname, alias, or IP address |
| OpenSSH default | Username added to |
| OpenSSH default | SSH TCP port |
| platform OpenSSH | SSH executable path |
| OpenSSH default | Private-key path passed to OpenSSH |
| none | Namespaced equivalent of |
| OpenSSH default | Namespaced equivalent of |
| OpenSSH default | Namespaced equivalent of |
| platform OpenSSH | Namespaced equivalent of |
| OpenSSH default | Namespaced equivalent of |
|
| Default command timeout |
|
| Default captured bytes per output stream |
Development
npm run typecheck
npm run build
npm run dev
npm run setup
npm run profilesThe MCP server uses stdio. Logs are written to stderr so the MCP protocol stream remains clean.
License
MIT. See LICENSE.
Available Tools
12 toolsremote_ssh_checkCheck SSH ConnectionARead-only
Check that the configured SSH host is reachable and print basic remote identity details.
Inputs: host, timeoutMs.
remote_ssh_execRun Remote CommandADestructive
Run a shell command on the configured SSH host. Reuses your local OpenSSH config and keys.
Inputs: command (required), cwd, env, host, +2 more.
remote_ssh_list_dirList Remote DirectoryARead-only
List a directory on the configured SSH host using ls -la.
Inputs: path (required), host, timeoutMs, maxOutputBytes.
remote_ssh_list_port_forwardsList SSH Port ForwardsARead-only
List SSH tunnels started by this MCP server process.
Inputs: no named parameters.
remote_ssh_local_diagnosticsLocal SSH DiagnosticsARead-only
Diagnose the local MCP server process and its ability to launch OpenSSH.
Inputs: host, timeoutMs.
remote_ssh_read_file_base64Read Remote File Base64ARead-only
Read a file from the configured SSH host as base64. Use this for small binary files.
Inputs: path (required), host, maxBytes, timeoutMs.
remote_ssh_read_textRead Remote TextARead-only
Read a text file from the configured SSH host. Large files are clipped by maxBytes.
Inputs: path (required), host, maxBytes, timeoutMs.
remote_ssh_start_port_forwardStart SSH Port ForwardA
Start a local SSH -L tunnel through the configured SSH host. The tunnel stays alive while this MCP server process is alive.
Inputs: localPort (required), remotePort (required), host, localHost, +2 more.
remote_ssh_stop_port_forwardStop SSH Port ForwardA
Stop a tunnel created by remote_ssh_start_port_forward.
Inputs: id (required).
remote_ssh_uriRemote SSH URIARead-only
Return a VS Code Remote-SSH URI and CLI command for the configured SSH host.
Inputs: host, path.
remote_ssh_write_file_base64Write Remote File Base64ADestructive
Decode base64 and write the bytes to a file on the configured SSH host.
Inputs: path (required), base64 (required), host, mode, +2 more.
remote_ssh_write_textWrite Remote TextADestructive
Write UTF-8 text to a file on the configured SSH host through SSH stdin.
Inputs: path (required), content (required), host, mode, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct action (check, diagnose, exec, list, read, write, forward, stop, URI). The read/write tools are clearly split by text vs binary, and check vs local_diagnostics separate remote vs local concerns.
Tools follow a consistent remote_ssh_ prefix, but the action part mixes verbs (exec, list, read, write, start, stop) with noun phrases (local_diagnostics, uri). This is a minor inconsistency in an otherwise readable pattern.
12 tools is well-scoped for an SSH remote server, covering connection, diagnostics, command execution, file operations, port forwarding, and URI generation without bloat.
Core remote SSH workflows are covered: connectivity, exec, file read/write (text and binary), directory listing, port forwarding management. Minor gaps like file delete/rename are absent but not critical for typical remote SSH usage.
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
Use a person's computer after they approve it there: files, Terminal, browser, local MCP.
Use a person's computer after they approve it there: files, Terminal, browser, local MCP.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) SSH client server that provides autonomous SSH operations for GitHub Copilot and VS Code. Enable natural language SSH automation without manual prompts or GUI interactions.202MIT
- AlicenseAqualityDmaintenanceEnables reading, writing, editing, searching, running commands, transferring files, and using git on a remote Linux server over SSH via MCP tools.223AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to operate on a remote Linux server over MCP, allowing shell command execution, file editing, package installation, project builds, and service management.MIT
- AlicenseAqualityCmaintenanceEnables remote command execution and SFTP file upload or download from any MCP client without a local SSH client, SCP, or PuTTY installed. Supports password or private key authentication with SHA256 host fingerprint verification, timeouts, output limits, and multiple configured server instances.525 npmMIT