MCP server enabling secure remote SSH command execution on Linux and Windows with password or key authentication.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We ran the install command below but it didn't respond within our test window β this can mean a slow first-time install rather than a real problem.
npx -y ssh-mcpNo response to initialize.
This is an experimental automated check and can have false negatives β missing environment variables, a slow cold install, etc. It doesnβt necessarily mean somethingβs wrong. Last checked 1mo ago.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Ssh MCP.
list-connectionsDiscover available hosts and connection status
list-sessionsList active sessions per host
open-sessionCreate a named interactive (stateful) or background session
close-sessionClose a session. A background session's command is signalled (INT/TERM/KILL) before its channel is dropped
read-session-outputRead output from background sessions (e.g., `tail -f`)
read-commandExecute allowlisted read-only commands (`ls`, `cat`, `grep`, ...)
SSH MCP Server is a security-first Model Context Protocol server that gives LLM agents controlled SSH access to remote hosts β with command classification, policy-based authorization, human-in-the-loop approval, and full audit logging.
The risk this server exists to manage. Giving an LLM shell access on a remote host puts private data, untrusted input and network egress in one place β Simon Willison's "lethal trifecta". Prompt injection has no general fix, so ssh-mcp assumes any command may be attacker-influenced: it classifies before executing, authorizes against a role Γ host-group matrix, gates destructive work behind approval, and records the decision either way. That narrows the blast radius; it does not remove the risk. Two things stay yours: never point it at a root account, and never set
autoapproval on a production profile. SECURITY.md has the full threat model.
Without a config the server still starts, so a client or directory can complete the MCP
handshake and read tools/list β but every tool call is refused until you configure it,
with a message naming the path below. Nothing runs on a host until this step is done.
Create the config file at the path for your platform:
| Platform | Path |
|---|---|
| Linux | ~/.config/ssh-mcp/config.toml (or $XDG_CONFIG_HOME/ssh-mcp/config.toml) |
| macOS | ~/Library/Application Support/ssh-mcp/config.toml |
| Windows | %APPDATA%\ssh-mcp\config.toml |
The config decides which hosts, roles and policy rules this server honours, so it checks that nobody but you can read it β and treats the two platforms differently, because the question has a much clearer answer on one of them.
Linux and macOS: enforced. The mode check above, on the file and the directory β
which is why chmod 700 is in that command, since mkdir -p under the default umask
leaves the directory 0755. The server refuses to start otherwise. "Only the owner" is
unambiguous here and chmod is a one-line fix.
Windows: split by what the ACL actually allows. There are no mode bits, so the ACL is read instead β and read exposure and write exposure are not treated alike, because Windows is much clearer about one of them than the other.
| The ACL lets another account⦠| Default |
|---|---|
| only read the config | reported, and the server starts |
| change the config | refused |
| nothing (no ACL at all) | refused β that is full control for everyone |
| β¦and if the ACL could not be read | refused, except when icacls is absent or the check timed out |
A config under %APPDATA% inherits access for you, SYSTEM and Administrators and needs
nothing done to it. One created elsewhere does not: a file under C:\ inherits read for
every local account and modify for every authenticated one. The message names the two
icacls commands that fix it either way.
Read exposure is reported rather than refused because that is where Windows is genuinely muddier than POSIX, and refusing over it blocked a config at the documented location (#138). Write exposure is refused because it is not muddy at all: another account being able to rewrite the file that decides which hosts, roles and approval policy this server honours is an authorization bypass, not a disclosure.
Two flags move the whole thing: --strictConfigAcl refuses everything the check objects
to, read-only grants included; --allowUncheckedConfigAcl reports everything and refuses
nothing. Neither combination leaves you without an exit, which is the lesson of #138.
| Status | Meaning |
|---|---|
0 | Clean shutdown |
1 | A defect in the server β printed with a stack trace; please report it |
2 | How it was invoked or configured β printed as a message, no stack |
A supervisor that treats any non-zero status as a failure needs no change. One
that matched on 1 to detect a startup problem should match on 2 as well.
Starting with nothing configured is not an exit-2 condition, as of the release that
added introspection without a config: the server starts so it can be described, and
refuses each tool call instead. A supervisor that used a non-zero exit to catch an
unconfigured deployment should watch for starting unconfigured on stderr, or read
configured from GET /health when running the HTTP transport.
Claude Code:
Claude Desktop / Cursor / Windsurf:
Never pass passwords as CLI arguments β they're visible via ps aux. Use env vars, config files, SSH agent, or OS keychain.
| Tool | Purpose | readOnly | destructive |
|---|---|---|---|
list-connections | Discover available hosts and connection status | β | β |
list-sessions | List active sessions per host | β | β |
open-session | Create a named interactive (stateful) or background session | β | β |
close-session | Close a session. A background session's command is signalled (INT/TERM/KILL) before its channel is dropped | β | β |
read-session-output | Read output from background sessions (e.g., tail -f) | β | β |
read-command | Execute allowlisted read-only commands (ls, cat, grep, ...) | β | β |
run-command | Execute arbitrary commands (destructive/privileged need approval, unless approvalPolicy = "auto") | β | β |
privileged-command | Execute with sudo (needs approval, unless approvalPolicy = "auto") | β | β |
sftp-upload | Upload a file via SFTP | β | β |
sftp-download | Download a file via SFTP | β | β |
signal-process | Send INT/TERM/KILL to a remote PID | β | β |
Sessions maintain state (CWD, environment variables) between commands:
Long-running processes (logs, builds):
Tested against Linux (Debian/bash, Alpine/busybox ash), Dropbear, and Windows OpenSSH on Windows 11.
| Linux / BSD / macOS | Windows OpenSSH | |
|---|---|---|
read-command, run-command, privileged-command, signal-process | β | β |
sftp-upload, sftp-download | β | β |
| Background sessions | β | β |
| Interactive sessions | β | β |
Interactive sessions require a POSIX shell (sh, bash, ash, zsh). They work by
bracketing each command with printf markers and reading $? and $PWD from a
trailer β none of which exist in cmd.exe, the default shell for Windows
OpenSSH. Opening one against such a host fails immediately with an explicit
error rather than timing out; everything else works normally.
Setting PowerShell as the OpenSSH DefaultShell does not help: the protocol is
POSIX-specific, not merely non-cmd.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/tufantunc-ssh-mcp)<a href="https://allmcps.com/mcp/tufantunc-ssh-mcp"><img src="https://allmcps.com/api/badge/tufantunc-ssh-mcp?style=directory" alt="Ssh MCP on AllMCPs" /></a>