MCP Tunnel
MCP隧道
一个简单的 MCP(模型上下文协议)服务器,允许访问虚拟机的命令行。启动后,它还会将主机连接到 Web,以便可以通过 MCP 进行访问。
特征
通过 MCP 在虚拟机上执行 shell 命令
基于 Web 的虚拟机交互终端界面
自动隧道使虚拟机可以从任何地方访问
基于WebSocket的实时通信
Related MCP server: MCP Shell Server
先决条件
Node.js(v18 或更高版本)
安装和使用
使用 npx 运行(无需安装)
npx mcp-cli全局安装
npm install -g mcp-cli
mcp-cli本地开发
# Clone repository
git clone [repository-url]
cd mcp-cli
# Install dependencies
npm install发展
运行开发服务器,对后端和前端进行热重载:
npm run dev建筑
构建用于生产的前端和后端:
npm run build-all用法
启动 MCP 服务器:
# Start with automatic tunneling
npm start
# Start without automatic tunneling
npm start -- --no-tunnel这将构建项目并启动服务器。默认情况下,将自动创建隧道。使用--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文件来配置服务器:
# Server configuration
PORT=8080
# Localtunnel configuration
LOCALTUNNEL_SUBDOMAIN=your-preferred-subdomain安全注意事项
此工具可直接访问虚拟机的命令行。请考虑以下安全措施:
在暴露隧道之前使用强大的身份验证机制
通过适当的验证来限制可以执行的命令
考虑在受限环境中运行
不要通过隧道泄露敏感信息
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
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).
SSH client, server management and one remote MCP URL for your machines, with human approvals.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Secure and manage MCP servers through the Speakeasy AI Control Plane from your agent.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA simple MCP Server with shell execution capabilities that can be run locally with Ngrok tunneling or hosted in an Ubuntu 24 Docker container.4MIT
- FlicenseNot gradedqualityNot gradedmaintenanceA simple MCP server that provides a terminal tool for executing shell commands with safety features like timeouts and error handling.-
- FlicenseBqualityDmaintenanceAn MCP server that enables users to execute arbitrary shell commands on their local machine and receive the output. It provides a terminal tool for running system commands through MCP-compatible clients using the Python SDK.1-
- FlicenseNot gradedqualityDmaintenanceMCP server that enables SSH access and terminal commands for Railway containers and local shell execution.-