Provides Docker environment management for remote servers, enabling execution of commands within containers.
Supports connection and command execution on Linux-based remote servers through SSH.
Enables remote terminal access and command execution on macOS systems.
Requires Node.js environment for running the MCP server with support for Node.js version 14.0.0+.
Provides GPU monitoring capabilities for NVIDIA GPUs, including usage statistics and management on remote servers.
Requires Python 3.8+ for the MCP server with support for executing Python scripts on remote servers.
Supports running PyTorch training scripts on remote GPU servers, particularly for AI development workflows.
Supports monitoring and management of Tesla GPU servers (A100, V100) for high-performance computing tasks.
Provides comprehensive tmux session management for persistent terminal sessions on remote servers.
Uses YAML for configuration files, including server definitions and connection settings.
Remote Terminal MCP for Cursor
🚀 一个专为Cursor设计的远程终端MCP工具,让你在Cursor中轻松管理和连接远程服务器,支持SSH直连、跳板机中继、Docker容器等多种连接方式。
✨ 主要特性
- 🎯 专为Cursor优化:完美集成Cursor的MCP架构
- 🔗 多种连接方式:SSH直连、跳板机中继、Docker容器
- 🛠️ 智能配置管理:交互式配置向导,支持模板和自定义
- 📦 一键安装:NPM包管理,开箱即用
- 🔧 强大的服务器管理:增删改查服务器配置
- 💻 远程命令执行:在Cursor中直接执行远程命令
- 🐳 Docker支持:完整的Docker容器管理
- 🔄 会话管理:基于tmux的持久化会话
🚀 快速开始
1. 在Cursor中配置MCP
在Cursor中,打开设置并编辑MCP配置文件(.cursor/mcp.json
):
💡 提示:使用
npx
会自动下载最新版本,无需手动安装NPM包。如果你偏好手动管理,也可以先运行npm install -g @xuyehua/remote-terminal-mcp
然后将command
改为包的绝对路径。
2. 启用MCP服务
配置完成后,你需要让MCP服务生效:
- 方式1:在Cursor中刷新MCP服务(推荐)
- 方式2:重启Cursor应用
配置生效后,你就可以开始使用了!
🎯 在Cursor中使用
📋 查看可用服务器
在Cursor中询问AI:
AI会使用list_servers
工具显示所有配置的服务器。
⚙️ 配置新服务器
在Cursor中说:
AI会启动交互式配置向导,引导你完成服务器配置:
- 🎯 智能向导:根据你的需求选择最适合的配置方式
- 🔧 多种模式:支持SSH直连、跳板机中继、Docker容器等
- 📝 逐步指导:清晰的步骤说明,向导会询问所需的配置信息
- ✅ 即时验证:配置完成后自动测试连接
🔗 连接服务器
在Cursor中请求:
AI会使用connect_server
工具建立连接。
💻 执行远程命令
连接后,你可以说:
AI会使用execute_command
工具执行命令并返回结果。
🗑️ 删除服务器配置
AI会使用管理工具安全删除服务器配置。
🛠️ 配置管理
交互式配置向导
在Cursor中直接说:
AI会自动启动配置向导,无需手动运行命令。向导包括:
- 🚀 快速配置:适合常见场景的一键配置
- 🎯 向导配置:详细的分步指导
- 📋 模板配置:基于预设模板快速创建
- ⚙️ 高级配置:完全自定义的配置选项
支持的连接类型
1. SSH直连
2. 跳板机中继
跳板机中继支持一级跳板和二级跳板两种模式,适用于复杂的网络环境。
一级跳板机配置
通过单个跳板机连接目标服务器:
二级跳板机配置
通过两级跳板机连接目标服务器(跳板机→二级跳板机→目标服务器):
配置说明
参数 | 说明 | 示例 |
---|---|---|
jumphost | 一级跳板机地址 | jumphost.com |
jumphost_user | 一级跳板机用户名 | admin |
secondary_jump.host | 二级跳板机地址 | secondary-jumphost.com |
secondary_jump.username | 二级跳板机用户名 | root |
target.host | 最终目标服务器地址 | target-server.com |
target.username | 目标服务器用户名 | ubuntu |
tool | 连接工具类型 | relay-cli |
跳板机连接原理
跳板机连接通过建立多级SSH隧道来实现安全的远程访问:
连接流程:
- 首先连接到一级跳板机(jumphost)
- 在一级跳板机上建立到二级跳板机的连接(如果配置了二级跳板)
- 最后从二级跳板机连接到目标服务器
- 所有数据通过这个安全隧道传输
适用场景:
- 🏢 企业内网访问:通过公司跳板机访问内网服务器
- 🔒 安全隔离环境:生产环境需要多层安全验证
- 🌐 跨网络访问:不同网络段之间的服务器访问
- 🛡️ 合规要求:满足安全审计和访问控制要求
3. Docker容器
🔧 MCP工具详细说明
本工具提供11个专业的MCP工具,通过Cursor的AI助手,你可以用自然语言轻松管理远程服务器。
🔍 服务器查询与状态工具
工具名称 | 功能描述 | Cursor使用示例 |
---|---|---|
list_servers | 列出所有配置的服务器 | "显示所有远程服务器列表" |
get_server_info | 获取特定服务器的详细信息 | "查看production服务器的详细配置" |
get_server_status | 检查服务器连接状态 | "检查所有服务器的连接状态" |
🔗 连接与命令执行工具
工具名称 | 功能描述 | Cursor使用示例 |
---|---|---|
connect_server | 连接到指定服务器 | "连接到production服务器" |
disconnect_server | 断开服务器连接并清理资源 | "断开production服务器的连接" |
execute_command | 在远程服务器执行命令 | "在服务器上运行docker ps命令" |
run_local_command | 在本地系统执行命令 | "在本地运行ls -la命令" |
⚙️ 服务器配置管理工具
工具名称 | 功能描述 | Cursor使用示例 |
---|---|---|
create_server_config | 创建新的服务器配置(交互式) | "我想新增一个远程服务器" |
update_server_config | 更新现有服务器配置(交互式) | "我想修改production服务器的配置" |
delete_server_config | 删除服务器配置 | "删除名为test-server的配置" |
🔧 诊断与故障排除工具
工具名称 | 功能描述 | Cursor使用示例 |
---|---|---|
diagnose_connection | 诊断连接问题并提供解决方案 | "诊断production服务器的连接问题" |
🎯 智能交互特性
1. 自动工具选择
你无需记住具体的工具名称,只需用自然语言描述需求:
2. 交互式配置体验
配置管理工具提供两种交互模式:
🖥️ 终端交互模式(默认)
- 自动弹出Terminal窗口
- 彩色表单界面
- 实时输入验证
- 智能默认值推荐
💬 聊天界面模式(可选)
- 直接在Cursor聊天界面配置
- 分步骤引导配置
- 无需切换窗口
3. 预填充参数支持
你可以在请求中提供部分参数,工具会自动预填充:
4. Docker配置自动化
支持完整的Docker容器管理:
5. 智能错误处理
工具提供详细的错误诊断和解决建议:
📝 使用场景示例
场景1:开发环境管理
场景2:跳板机配置
场景3:Docker容器配置
场景4:多服务器监控
🔍 故障排除
常见问题
1. MCP服务器无法启动
2. 服务器连接失败
在Cursor中说:
3. 配置文件问题
调试模式
启用详细日志:
🔐 安全注意事项
- SSH密钥管理:建议使用SSH密钥而非密码认证
- 配置文件权限:确保配置文件权限设置正确(600)
- 跳板机安全:使用跳板机时确保跳板机的安全性
- 网络安全:在不安全网络中使用VPN
🤝 贡献指南
欢迎提交Issue和Pull Request!
开发环境设置
测试
📄 许可证
MIT License - 详见 LICENSE 文件
🔗 相关链接
📊 版本历史
v0.15.0 (最新) - 2024年12月22日
- 🎯 重大功能升级:完整的11个MCP工具集成
- ✨ 交互式配置体验:支持Terminal和聊天界面两种配置模式
- 🐳 Docker配置自动化:完整的Docker容器管理和自动创建
- 🔧 智能参数预填充:配置时支持参数预填充和智能默认值
- 🛠️ 强化错误处理:完善的连接诊断和故障排除机制
- 📝 全面测试覆盖:39项回归测试确保稳定性
- 🔄 配置同步机制:update_server_config与create保持一致的交互体验
v0.8.3
- 🐛 修复服务器删除功能的逻辑问题
- ✨ 改进配置备份机制
- 📝 完善文档和使用指南
v0.8.2
- ✨ 增强配置管理功能
- 🐳 完善Docker支持
- 🔧 优化连接稳定性
💡 提示:这个工具专为Cursor设计,通过AI助手的自然语言交互,让远程服务器管理变得简单直观。开始使用时,只需要告诉AI你想做什么,它会自动选择合适的工具来完成任务!
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A unified remote terminal management server that simplifies complex SSH connections and server management through MCP protocol, allowing users to control multiple remote servers with natural language commands as easily as local operations.
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface for LLMs.Last updated -1058PythonMIT License
- -securityFlicense-qualityA simple MCP server that allows accessing and executing shell commands on a VM machine through a web-based terminal interface, with automatic tunneling to make the VM accessible from anywhere.Last updated -392JavaScript
- AsecurityFlicenseAqualityA server that enables remote command execution over SSH through the Model Context Protocol (MCP), supporting both password and private key authentication.Last updated -1501JavaScript
- AsecurityAlicenseAqualityA unified control center for managing MCP servers, providing tooling for environment variable management, profile-based configurations, and local package installation automation.Last updated -24TypeScriptMIT License