Skip to main content
Glama

MCP Tunnel

by leomercier

MCP隧道

一个简单的 MCP(模型上下文协议)服务器,允许访问虚拟机的命令行。启动后,它还会将主机连接到 Web,以便可以通过 MCP 进行访问。

特征

  • 通过 MCP 在虚拟机上执行 shell 命令
  • 基于 Web 的虚拟机交互终端界面
  • 自动隧道使虚拟机可以从任何地方访问
  • 基于WebSocket的实时通信

先决条件

  • 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

用法

  1. 启动 MCP 服务器:
# Start with automatic tunneling npm start # Start without automatic tunneling npm start -- --no-tunnel

这将构建项目并启动服务器。默认情况下,将自动创建隧道。使用--no-tunnel标志可禁用自动隧道。

  1. 服务器将启动并在 stderr 上提供输出(以避免干扰 stdout 上的 MCP 通信)
  2. 使用 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

安全注意事项

此工具可直接访问虚拟机的命令行。请考虑以下安全措施:

  • 在暴露隧道之前使用强大的身份验证机制
  • 通过适当的验证来限制可以执行的命令
  • 考虑在受限环境中运行
  • 不要通过隧道泄露敏感信息
-
security - not tested
F
license - not found
-
quality - not tested

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。

  1. 特征
    1. 先决条件
      1. 安装和使用
        1. 使用 npx 运行(无需安装)
        2. 全局安装
        3. 本地开发
      2. 发展
        1. 建筑
          1. 用法
            1. 可用的 MCP 工具
          2. Web 界面
            1. 环境变量
              1. 安全注意事项

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  An MCP server to run commands.
                  Last updated -
                  2
                  265
                  150
                  TypeScript
                  MIT License
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  An MCP server that allows managing Docker containers through natural language, enabling users to compose, introspect, and debug containers without running commands themselves.
                  Last updated -
                  468
                  Python
                  GPL 3.0
                  • Apple
                • -
                  security
                  -
                  license
                  -
                  quality
                  A secure server that implements the Model Context Protocol (MCP) to enable controlled execution of authorized shell commands with stdin support.
                  Last updated -
                  Python
                • A
                  security
                  A
                  license
                  A
                  quality
                  A server that uses the Model Context Protocol (MCP) to allow AI agents to safely execute shell commands on a host system.
                  Last updated -
                  1
                  76
                  2
                  TypeScript
                  MIT License
                  • Linux
                  • Apple

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/leomercier/mcp-tunnel'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server