
Realssh Mcp
io.github.danielecr由 GitHub 账号 danielecr 发布v1.0.6更新于 Oct 24, 2026
MCP server for SSH remote command execution
概览
本地 MCP 服务器,借助系统 ssh 命令让助手通过 SSH 在远程主机上执行命令。
- 可以做什么
- 通过 SSH 在远程主机执行任意命令,返回标准输出、标准错误和退出码
- 在正式执行前测试到某台主机的 SSH 连通性
- 按调用指定主机、用户名、端口、超时、代理转发和额外 ssh 参数
- 复用已有的 ssh-agent 密钥、~/.ssh/config 别名、跳板机和 ProxyCommand 配置
- 适用场景
- 适合希望助手用你本机现有的 SSH 配置去查看或操作远程服务器的场景,例如在 SSH 配置中列出的主机上检查磁盘占用、服务状态或日志。
- 运行要求
- 以本地 stdio 进程运行,可从 npm 全局安装或从源码构建,npm 包需要 Node.js。系统必须安装 ssh 命令并在 PATH 中(macOS 和 Linux 通常自带)。主机、密钥和跳板机来自现有的 ~/.ssh/config 与 ssh-agent;未声明任何 API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Realssh Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
SSH Real MCP Server
A Model Context Protocol (MCP) server that enables SSH remote command execution by delegating entirely to the system ssh binary. This means ssh-agent, ProxyCommand, ~/.ssh/config, jump hosts, and every other OS-level SSH feature work out of the box — no Node.js crypto, no native addons.
How it works
Instead of implementing the SSH protocol in Node.js, this server spawns ssh as a child process and pipes the output back to the MCP client. Authentication, key discovery, and connection routing are handled by your OS, exactly as if you ran ssh yourself in a terminal.
Requirements: ssh must be installed and available in PATH (standard on macOS and Linux).
Features
- Zero auth config — uses your existing
ssh-agent,~/.ssh/config, and key files automatically - ProxyCommand / jump hosts — works natively, no special parameters needed
- Connectivity test —
ssh_testtool to verify reachability before running commands - Argument injection protection — host and username are validated before being passed to
ssh - Configurable timeout — commands are killed and an error is returned if they exceed the timeout
- Detailed results: stdout, stderr, and exit code
Installation
From npm
From source
VS Code / Copilot configuration
After installing the package globally, add the server to your MCP configuration. In VS Code, open the MCP config file via Command Palette → MCP: Open User Configuration and add:
Then run MCP: List Servers to verify the server is active.
Tools
ssh_execute
Execute a command on a remote server via SSH.
Parameters:
host(string, required): SSH server hostname or IP addresscommand(string, required): Command to execute on the remote serverusername(string, optional): SSH username. Defaults to the current OS userport(number, optional): SSH server port (default: 22)timeout(number, optional): Command timeout in milliseconds (default: 30000)agentForward(boolean, optional): Enable SSH agent forwarding-A(default: false)extraArgs(string[], optional): Extra SSH arguments (e.g.,["-o", "StrictHostKeyChecking=no"])
Example:
ssh_test
Test SSH connectivity to a remote host (runs echo ok and checks the response).
Parameters:
host(string, required): SSH server hostname or IP addressusername(string, optional): SSH usernameport(number, optional): SSH server port (default: 22)extraArgs(string[], optional): Extra SSH arguments
Host configuration
Hosts, aliases, jump hosts, and identity files are configured in ~/.ssh/config — not in the MCP server. This is intentional: the OS ssh binary reads that file natively.
Example ~/.ssh/config:
With the above config, "host": "prod" works with no extra parameters.
Security considerations
- Commands are executed on remote systems with the privileges of the SSH user — ensure proper access controls on the remote side.
BatchMode=yesis set by default, preventing thesshprocess from hanging on interactive prompts.- Host and username inputs are validated to prevent SSH option injection.
- Command output may contain sensitive data; treat it accordingly.
License
MIT
来源:README.md,提交 5fc08f6
工具
0版本历史
1- v1.0.6最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。