
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 分