sshcode-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sshcode-mcplist files in the home directory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sshcode-mcp
SSH Remote AI Development Tool — 通过 SSH 让 AI 在远程计算机上进行开发操作。
基于 MCP (Model Context Protocol) 标准协议,可作为 opencode、Claude Desktop 等 MCP 客户端的工具服务。
功能
工具 | 说明 |
| 在远程服务器执行 shell 命令 |
| 读取远程文件内容 |
| 写入/覆盖远程文件 |
| 编辑远程文件指定行(按行号) |
| 列出远程目录内容 |
| 创建远程目录 |
| 删除远程文件/目录 |
| 重命名/移动远程文件/目录 |
| 获取远程文件元数据 |
| 在远程服务器搜索文件(glob 模式) |
| 获取远程系统信息 |
| 获取连接池/缓存统计 |
Related MCP server: mcp-ssh-multi
快速开始
# 安装依赖
npm install
# 密码认证
node bin/sshcode.js ubuntu@192.168.1.5 -P 123
# 密钥认证
node bin/sshcode.js ubuntu@192.168.1.5 -i ~/.ssh/id_rsa
# 自定义端口
node bin/sshcode.js ubuntu@192.168.1.5 -p 2222 -P 123环境变量模式(MCP 推荐)
export SSHCODE_HOST=192.168.1.5
export SSHCODE_USER=ubuntu
export SSHCODE_PASSWORD=123
node bin/sshcode.js配置为 opencode MCP 服务
在 ~/.config/opencode/opencode.jsonc 或项目 .opencode.jsonc 中添加:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"sshcode": {
"type": "local",
"command": ["node", "/path/to/sshcode_mcp/bin/sshcode.js"],
"environment": {
"SSHCODE_HOST": "192.168.1.5",
"SSHCODE_USER": "ubuntu",
"SSHCODE_PASSWORD": "123",
"SSHCODE_PORT": "22"
},
"timeout": 15000
}
}
}架构
AI (MCP Client) <-> stdio JSON-RPC <-> sshcode-mcp <-> SSH <-> Remote Server性能优化
连接池: 复用 SSH 连接(最多 5 个),避免重复握手
文件缓存: LRU 缓存(最多 50 个文件,TTL 60s)
命令超时: 默认 30s,防止长时间卡住
并发控制: 最多 10 个并发命令
输出截断: 超过 10MB 自动截断
SFTP 复用: 在同一连接内复用 SFTP 通道
ssh 压缩: 强制开启压缩减少带宽
配置
# 查看配置
node bin/sshcode.js config
# 修改配置
node bin/sshcode.js config set pool.maxSize 10
node bin/sshcode.js config set command.defaultTimeout 60000许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI assistants full SSH/SFTP remote operations — session management, command execution, interactive shells, file transfers, port forwarding, and system diagnostics.2MIT
- AlicenseAqualityBmaintenanceMCP server for managing multiple SSH servers via AI assistants, offering tools for remote command execution, file operations, and system monitoring.111MIT
- AlicenseNot gradedqualityAmaintenanceMCP 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 MCP server that lets an AI assistant run commands and transfer files over SSH without exposing connection details.5MIT