MCP SSH Proxy
A human-in-the-loop SSH bridge for AI agents that requires approval for every command before execution on configured servers.
README
MCP SSH Proxy
A human-in-the-loop SSH bridge for AI agents. It exposes an MCP server with two tools — ssh_list_hosts and ssh_exec — but every command an agent wants to run is held for your review in a desktop app before it touches a server. You see the exact command and the target host, then click Run, edit it, or Reject it.
Servers are configured only in the app's UI — nothing is hardcoded, and credentials are encrypted at rest with the OS keystore (Windows DPAPI via Electron safeStorage).
Sibling project to MCP SQL Proxy — same approval-loop architecture, applied to SSH instead of SQL.
Features
- 🔐 Human-in-the-loop approval — every agent command is shown for review (Run / edit / Reject) before it runs; the result is returned to the agent automatically.
- ⚙️ Per-command confirm modes — a global confirm-each ⟷ auto-run switch, overridable per server (
always confirm/auto). - 🖥️ Built-in interactive terminals — full PuTTY-style xterm.js shells, multiple servers at once in tabs; type freely, see colors/vim/live output. Agent commands are echoed into the matching server's terminal as a labelled blue bar.
- 🗂️ Multi-server aware — pending requests are scoped to the selected server with a
!badge on the others; idle target servers are auto-connected on demand. - 📤 SFTP file transfer —
ssh_upload/ssh_downloadmove files to/from a server (inline content or a local path), each approved in the app. - 🔑 Any key format — OpenSSH, PEM/PKCS#8, and PuTTY
.ppk(v2 & v3) are detected and converted automatically; key, password, or ssh-agent auth. - 📥 PuTTY session import — pull saved sessions (host/port/user/key) straight from the Windows registry.
- 🕑 Persistent per-server history — every executed command is stored across sessions.
- 🛑 Danger mode — destructive commands (
rm,dd,shutdown,sudo,systemctl stop, redirects into/, …) flash the window red.
Why
Letting an agent run arbitrary shell commands on a production server is risky. This proxy keeps a person in the loop: the agent proposes, you approve. Destructive commands (rm, dd, shutdown, sudo, systemctl stop, redirects into /, …) light the whole window up in danger mode so a careless approval is hard.
Architecture
Claude / MCP client ──stdio──► MCP server ──WebSocket(127.0.0.1:52346)──► Electron app
(ssh_exec) (dist/mcp/server.js) (approval UI + ssh2)
- MCP server (
src/mcp/server.ts) — speaks MCP over stdio, forwards each request to the desktop app and waits for the result. Auto-launches the app if it isn't running. - Electron app (
src/electron/main.ts) — holds the server list, renders the approval queue, and runs approved commands viassh2. Single-instance: many MCP clients share one window. - Renderer (
src/renderer/index.html) — the UI: server list, per-server approval panel, tabbed interactive terminals (xterm.js), and all-server history.
Nothing binds to anything but 127.0.0.1.
Tools
| Tool | Approval? | Description |
|---|---|---|
ssh_list_hosts |
no | Returns the configured host names (+ address/user/auth). No secrets. Call this first. |
ssh_exec |
yes | Runs a command on a host (by name). You approve/edit/reject in the app. Returns stdout, stderr, exit code. |
ssh_upload |
yes | Uploads a file via SFTP — inline content (text/base64) or a local_path on the proxy machine → remote_path. |
ssh_download |
yes | Downloads a file via SFTP — returned inline (UTF-8 or base64, capped) or saved to a local_path. |
Install & build
npm install
npm run build
Run the desktop app standalone
npm start
Open Servers → + Add and configure a host:
- Name — the handle the agent uses (e.g.
web-01) - User / Host / Port
- Authentication — Private Key (with optional passphrase), Password, or SSH Agent
Hit Test Connection to verify. Secrets you type are encrypted before they are stored; the UI never reads them back in clear text (leave a secret field blank when editing to keep the stored value).
Register as an MCP server
Point your MCP client at the built server entry (dist/mcp/server.js). For Claude Code:
claude mcp add ssh-proxy -- node /absolute/path/to/McpSshProxy/dist/mcp/server.js
Or in a client config:
{
"mcpServers": {
"ssh-proxy": {
"command": "node",
"args": ["/absolute/path/to/McpSshProxy/dist/mcp/server.js"]
}
}
}
The first ssh_exec call auto-launches the approval window.
Security notes
- All traffic is loopback-only (
127.0.0.1:52346). - Passwords and key passphrases are encrypted with the OS keystore (
safeStorage). On platforms without an available keystore they fall back to obfuscated-but-not-encrypted local storage — prefer key/agent auth there. - The agent can only target servers you have configured by name. An
ssh_execfor an unknown host is refused. - This is an approval tool, not a sandbox: once you click Run, the command executes with the configured user's privileges. Review before approving.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。