MCP server for executing shell commands on remote hosts via SSH.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
SSH Client MCP Server is a local Model Context Protocol (MCP) server that lets LLMs and other MCP clients execute shell commands on remote hosts over SSH. It runs from Linux, macOS, or Windows and targets any reachable SSH server (Linux, macOS, Windows with OpenSSH, etc.).
Built on somamcp β a functional MCP framework over FastMCP with telemetry, introspection, and backend abstraction.
This repository is a pnpm monorepo with three packages:
| Package | npm name | Role |
|---|---|---|
packages/core | @ssh-mcp/core (private) | Shared SSH pool, tmux command builders, and auth resolution. Bundled into the other packages; not published separately. |
packages/connector | ssh-client-mcp-server | Single-host MCP server (the original package). exec + tmux_* tools for one configured SSH host. |
packages/orchestrator | ssh-fleet-mcp-server | Multi-host fleet MCP server. Host-routed exec + tmux_* tools driven by a TOML fleet config. |
Run the full validation suite across all packages:
npx β see Client Setup.No global install required β npx fetches and runs the latest published version.
exec tool β runs a shell command on the remote host, returns stdout. stderr surfaces as a structured error.SSH_AUTH_SOCK (system ssh-agent, 1Password, Bitwarden Desktop, KeePassXC).--key supports ~, $VAR, ${VAR}, and relative paths via functype-os. Unresolved variables fail fast with a typed error.--user defaults to the current OS username when omitted.exec call.soma_health, soma_capabilities, soma_connections auto-registered by somamcp.| Tool | Description |
|---|---|
exec | Execute a shell command on the remote SSH server and return stdout. |
soma_health | Server uptime, status, active session count. |
soma_capabilities | Enumerate registered tools, resources, and prompts. |
soma_connections | Gateway connection status (unused here). |
For driving long-running interactive processes (e.g. a remote coding agent) across calls, the server exposes tmux-backed tools. tmux must be installed on the remote host.
tmux_list β list live tmux sessions.tmux_send({ session?, input, submit? }) β type input into session (created if absent); presses Enter unless submit: false.tmux_read({ session?, lines? }) β return the recent pane transcript (lines default 200, max 2000).tmux_keys({ session?, keys }) β send control/special keys, e.g. { keys: ["C-c"] }.session defaults to --tmux-session (default agent). Tip: run agents in a line-oriented mode (not a full-screen TUI) so tmux_read returns a clean transcript.
npx (recommended)No install step β your MCP client launches it on demand. See Client Setup.
The server reads SSH connection info from CLI flags:
| Flag | Required | Default | Description |
|---|---|---|---|
--host | yes | β | Hostname or IP of the remote SSH server. |
--user | no | OS username | SSH username. Falls back to the local OS user (whoami) when omitted. |
--port | no | 22 | SSH port. |
--password | no* | β | SSH password. |
--key | no* | β | Path to a private SSH key. Supports ~, $VAR, ${VAR}, and relative paths. |
--key-env | no* | β | Name of an env var holding the private key PEM (e.g. injected by envpkt, Vault, Doppler). |
--agent | no* | β | Set to true to use SSH_AUTH_SOCK (system ssh-agent, 1Password, Bitwarden Desktop, KeePassXC). |
*Auth precedence is --password β --key β --key-env β --agent. If none are set the server starts but ssh2 will fail to authenticate on first exec.
Each of these can expose your SSH keys via SSH_AUTH_SOCK. Unlock the vault, confirm the agent is enabled, then run with --agent=true β the server never sees the private key.
For Bitwarden Desktop β₯ 2024.12: enable Settings β SSH agent, then on macOS confirm launchctl getenv SSH_AUTH_SOCK points at Bitwarden's socket.
Store the PEM as a sealed value in envpkt.toml, then launch via envpkt exec:
Same pattern works for HashiCorp Vault, Doppler, Infisical, AWS Secrets Manager, or any wrapper that lands the key in process.env.
claude_desktop_config.json)Replace the --key arg with --password=hunter2. Avoid checking this into version control.
Omit --user entirely β the server defaults to your local username.
Any client that speaks the stdio MCP transport works. Same command / args shape.
pnpm build)This builds and launches the MCP Inspector pointed at dist/index.js.
All tooling is delegated to ts-builds:
Pure helpers (parseArgv, validateConfig, resolveAuth, effectiveUser) live in src/config.ts and are covered by test/config.spec.ts (18 cases, including tempfile-backed key reads and env-var expansion).
Provided under the MIT License. Use at your own risk. Not affiliated with or endorsed by any SSH vendor or MCP provider. Be careful granting LLMs shell access β audit commands, restrict target-account privileges, and consider a jump box.
Issues and PRs welcome at jordanburke/ssh-client-mcp-server. Please run pnpm validate before submitting.
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/ssh-client-mcp-server)<a href="https://allmcps.com/mcp/ssh-client-mcp-server"><img src="https://allmcps.com/api/badge/ssh-client-mcp-server?style=directory" alt="Ssh Client MCP Server on AllMCPs" /></a>