
Ssh Client Mcp Server
io.github.jordanburke由 GitHub 帳號 jordanburke 發布v1.6.0更新於 Nov 5, 2026
MCP server for executing shell commands on remote hosts via SSH.
概覽
本機 MCP 伺服器,讓助理透過 SSH 在遠端主機上執行 shell 指令,並可用 tmux 工作階段維持長時間執行的程序。
- 可以做什麼
- 在已設定的遠端 SSH 主機上執行 shell 指令,並回傳結束狀態、標準輸出與標準錯誤。
- 操作遠端主機上的常駐 tmux 工作階段:列出工作階段、輸入內容、讀取最近的窗格輸出、送出控制鍵或特殊按鍵。
- 透過 info 工具回報伺服器本身的名稱、版本、執行環境與已註冊工具數量。
- 適用情境
- 適合需要檢查或操作遠端 Linux、macOS 或安裝 OpenSSH 的 Windows 機器的情境,例如查看日誌、執行部署或腳本,或讓互動式遠端程序在多次呼叫之間保持運作。它面向單一已設定主機,適合單機工作流程而非多機機群管理。
- 執行需求
- 需在本機執行 Node.js 22 或更新版本(Linux、macOS、Windows),通常透過 npx 或全域 npm 安裝啟動。需要可連線的 SSH 伺服器,並以命令列參數提供連線資訊:主機,可選的使用者名稱與連接埠,以及一種驗證方式(密碼、金鑰檔案路徑、由指定環境變數提供的金鑰,或系統 ssh-agent 通訊端)。tmux 工具要求遠端主機已安裝 tmux。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Ssh Client Mcp Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
SSH Client MCP Server
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 on the MCP TypeScript SDK 2.x, with telemetry and introspection.
Contents
Monorepo
This repository is a pnpm monorepo with three packages:
For the fleet server, start with its README: first run, fleet_setup, audit log, policy, CA mode, and running on several machines (where to register it, installing on a hub, per-hub keys versus CA mode, macOS hosts).
Run the full validation suite across all packages:
Quick Start
- Configure your MCP client (Claude Desktop, Cursor, Cline, etc.) to launch this server via
npx— see Client Setup. - Ask your LLM to run shell commands on the target host.
No global install required — npx fetches and runs the latest published version.
Features
- Single
exectool — runs a shell command on the remote host. A non-zero exit is the failure; a command that exits 0 succeeds even if it wrote to stderr, and its stderr follows stdout under a[stderr]marker. A failure readsexit <code>:then stderr, then stdout under[stdout]; a command a signal ended readsexit 137 (signal KILL). - Four auth modes — password, key file, key from environment variable (e.g. injected by envpkt, Vault, Doppler), or
SSH_AUTH_SOCK(system ssh-agent, 1Password, Bitwarden Desktop, KeePassXC). - Smart path expansion —
--keysupports~,$VAR,${VAR}, and relative paths viafunctype-os. Unresolved variables fail fast with a typed error. - OS-user fallback —
--userdefaults to the current OS username when omitted. - Fail-fast auth — the SSH key is loaded and validated at server startup, not on the first
execcall. - Introspection out-of-the-box — an
infotool, auto-registered by somamcp, reports the server's name, version, runtime, and tool counts. - Cross-platform — runs on Linux, macOS, Windows (anywhere Node 22+ runs).
Tools
Persistent sessions (tmux)
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? })— typeinputintosession(created if absent); presses Enter unlesssubmit: false.tmux_read({ session?, lines? })— return the recent pane transcript (linesdefault 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.
Installation
Run via npx (recommended)
No install step — your MCP client launches it on demand. See Client Setup.
Global install
From source (for contributors)
Configuration
The server reads SSH connection info from CLI flags:
*Auth precedence is --password → --key → --key-env → --agent. If none are set the server starts but ssh2 will fail to authenticate on first exec.
Pulling keys from a password manager (Bitwarden / 1Password / KeePassXC)
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.
Pulling keys from envpkt (or any tool that injects env vars)
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.
Client Setup
Claude Desktop (claude_desktop_config.json)
Password auth
Replace the --key arg with --password=hunter2. Avoid checking this into version control.
Using the current OS user
Omit --user entirely — the server defaults to your local username.
Other MCP clients
Any client that speaks the stdio MCP transport works. Same command / args shape.
Testing
Against a published build
Against a local build (after pnpm build)
This builds and launches the MCP Inspector pointed at dist/index.js.
Development
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).
Disclaimer
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.
Contributing
Issues and PRs welcome at jordanburke/ssh-client-mcp-server. Please run pnpm validate before submitting.
來源:README.md,提交 b21391c
工具
0版本歷史
2- v1.6.0最新Nov 5, 2026
- v1.5.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分