Simple SSH MCP Server
一个 MCP 服务器,为 AI 助手提供完整的 SSH/SFTP 远程操作功能——包括会话管理、命令执行、交互式 Shell、文件传输、端口转发和系统诊断。
适用于 Claude Desktop、VS Code + GitHub Copilot 以及任何兼容 MCP 的客户端。
软件包
软件包 | 描述 |
MCP 服务器(49 个工具)——独立 CLI 和 npm 包 | |
VS Code 扩展——自动向 GitHub Copilot 注册服务器 |
Related MCP server: ssh-mcp
功能特性
会话管理 — 通过密码或密钥认证进行连接/断开连接/ping 操作
命令执行 — 执行命令并捕获 stdout/stderr、超时设置和退出代码
Sudo 执行 — 通过 stdin 注入密码(从不记录日志)执行提权命令
后台作业 — 支持轮询和取消的长时运行命令
交互式 Shell — 支持读/写/调整大小的 PTY Shell
SFTP 操作 — 上传、下载、读取、写入、删除、列出、查看状态
端口转发 — 本地 (-L) 和远程 (-R) SSH 隧道
系统诊断 — 操作系统、CPU、内存、磁盘、网络、负载、进程信息
文件搜索与分析 — 查找文件、grep 内容、diff、tail、校验和
服务器管理 — 服务、进程、cron、网络诊断、用户管理
多主机工作流 — 广播命令、主机间文件传输、跳板机/堡垒机连接、脚本执行
会话智能 — 系统快照、快照差异对比、连接书签
容器感知 — Docker/Podman 容器的列表、日志、exec 操作
审计日志 — 带有过滤功能的 NDJSON 结构化日志
快速入门
独立运行 (npm)
npm install -g simple-ssh-mcp-serverClaude Desktop
添加到 claude_desktop_config.json:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": ["ssh-mcp-server"],
"env": {
"SSH_MCP_MAX_CONNECTIONS": "10",
"SSH_MCP_HOST_KEY_MODE": "accept"
}
}
}
}VS Code + GitHub Copilot
安装 SSH MCP VS Code 扩展 —— 服务器会在 VS Code 启动时自动运行。需要 VS Code 1.99+ 和 GitHub Copilot。
工具 (49)
类别 | 工具 |
会话 |
|
执行 |
|
后台 |
|
Shell |
|
SFTP |
|
端口转发 |
|
文件搜索 |
|
服务器管理 |
|
多主机 |
|
会话智能 |
|
容器 |
|
诊断 |
|
配置
所有设置均通过环境变量进行:
变量 | 默认值 | 描述 |
|
| 最大并发 SSH 会话数 |
|
| 审计日志目录 |
|
| PTY Shell 的默认 TERM |
|
| 终端宽度 |
|
| 终端高度 |
|
| 命令超时时间 (ms) |
|
| 主机密钥模式: |
|
|
|
请参阅 服务器 README 获取完整的配置参考。
安全性
Sudo 密码通过 stdin 注入,从不记录日志
从输出中剥离 ANSI 转义序列
输出截断防止内存溢出
SSH keepalive 检测死连接
CI 中集成了 ESLint 安全插件 + Gitleaks + CodeQL + Trivy
许可证
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP server giving AI agents full SSH access with persistent sessions, structured command output, SFTP file transfer, and port forwarding.1868 PyPI12MIT
- AlicenseAqualityBmaintenanceAn MCP server that gives AI agents SSH access to remote machines through your local OpenSSH client, enabling remote command execution, file transfer, persistent shell sessions, and port forwarding.17521 PyPI33MIT
- AlicenseNot gradedqualityBmaintenanceMCP server enabling AI assistants to securely operate remote servers via persistent SSH sessions, with tools for command execution, file transfer, directory listing, and system monitoring.4MIT
- AlicenseAqualityCmaintenanceAn open MCP server that gives any AI agent SSH access to remote Linux/Unix machines — shell commands, file read/write, and SFTP transfers.1143 PyPIMIT