MCP隧道
一个简单的 MCP(模型上下文协议)服务器,允许访问虚拟机的命令行。启动后,它还会将主机连接到 Web,以便可以通过 MCP 进行访问。
特征
通过 MCP 在虚拟机上执行 shell 命令
基于 Web 的虚拟机交互终端界面
自动隧道使虚拟机可以从任何地方访问
基于WebSocket的实时通信
先决条件
Node.js(v18 或更高版本)
安装和使用
使用 npx 运行(无需安装)
全局安装
本地开发
发展
运行开发服务器,对后端和前端进行热重载:
建筑
构建用于生产的前端和后端:
用法
启动 MCP 服务器:
这将构建项目并启动服务器。默认情况下,将自动创建隧道。使用--no-tunnel
标志可禁用自动隧道。
服务器将启动并在 stderr 上提供输出(以避免干扰 stdout 上的 MCP 通信)
使用 MCP 通过以下工具与服务器进行交互:
可用的 MCP 工具
execute_command
:在虚拟机上运行shell命令参数:
{ "command": "your shell command" }
start_tunnel
:创建 Web 隧道来访问 VM 界面参数:
{ "port": 8080, "subdomain": "optional-subdomain" }
Web 界面
启动隧道后,您可以通过隧道提供的 URL 访问基于 Web 的终端界面。此界面允许您执行以下操作:
直接在虚拟机中执行命令
实时查看命令输出
通过任何具有 Web 访问权限的设备与虚拟机进行交互
环境变量
创建一个.env
文件来配置服务器:
安全注意事项
此工具可直接访问虚拟机的命令行。请考虑以下安全措施:
在暴露隧道之前使用强大的身份验证机制
通过适当的验证来限制可以执行的命令
考虑在受限环境中运行
不要通过隧道泄露敏感信息
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.
一个简单的 MCP 服务器,允许通过基于 Web 的终端界面访问和执行 VM 机器上的 shell 命令,并具有自动隧道功能,可以从任何地方访问 VM。
Related MCP Servers
- -securityFlicense-qualityA simple MCP server that allows running terminal commands with output capture, enabling command execution on the host system from MCP-compatible clients like Claude Desktop.Last updated -1
- AsecurityAlicenseAqualityA server that enables secure interaction with remote SSH hosts through standardized MCP interface, providing functions like listing hosts, executing commands, and transferring files using native SSH tools.Last updated -712029MIT License
- -securityFlicense-qualityA 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.Last updated -123
- -securityFlicense-qualityA simple MCP server that provides a terminal tool for executing shell commands with safety features like timeouts and error handling.Last updated -