Cover image
Try Now
2025-03-18

MCP服务器,用于使用Web隧道访问VM命令行

3 years

Works with Finder

1

Github Watches

1

Github Forks

2

Github Stars

MCP Tunnel

A simple MCP (Model Context Protocol) server that allows accessing the command line of a VM machine. When started, it also tunnels the host to the web so it can be accessed via MCP.

Features

  • Execute shell commands on a VM through MCP
  • Web-based terminal interface for VM interaction
  • Automatic tunneling to make the VM accessible from anywhere
  • WebSocket-based real-time communication

Prerequisites

  • Node.js (v18 or newer)

Installation and Usage

Running with npx (no installation)

npx mcp-cli

Global Installation

npm install -g mcp-cli
mcp-cli

Local Development

# Clone repository
git clone [repository-url]
cd mcp-cli

# Install dependencies
npm install

Development

Run the development server with hot-reloading for both backend and frontend:

npm run dev

Building

Build both the frontend and backend for production:

npm run build-all

Usage

  1. Start the MCP server:
# Start with automatic tunneling
npm start

# Start without automatic tunneling
npm start -- --no-tunnel

This will build the project and start the server. By default, a tunnel will be created automatically. Use the --no-tunnel flag to disable automatic tunneling.

  1. The server will start and provide output on stderr (to avoid interfering with MCP communication on stdout)

  2. Use MCP to interact with the server using the following tools:

Available MCP Tools

  • execute_command: Run a shell command on the VM
    • Parameters: { "command": "your shell command" }
  • start_tunnel: Create a web tunnel to access the VM interface
    • Parameters: { "port": 8080, "subdomain": "optional-subdomain" }

Web Interface

After starting the tunnel, you can access the web-based terminal interface at the URL provided by the tunnel. This interface allows you to:

  • Execute commands directly in the VM
  • See command outputs in real-time
  • Interact with the VM from any device with web access

Environment Variables

Create a .env file to configure the server:

# Server configuration
PORT=8080

# Localtunnel configuration
LOCALTUNNEL_SUBDOMAIN=your-preferred-subdomain

Security Considerations

This tool provides direct access to your VM's command line. Consider these security practices:

  • Use strong authentication mechanisms before exposing the tunnel
  • Limit the commands that can be executed through proper validation
  • Consider running in a restricted environment
  • Do not expose sensitive information through the tunnel

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Lists Tailwind CSS classes in monospaced font

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    1 (1)
    Avatar
    user_PwaStelE
    2025-04-16

    As a dedicated user of the Anki MCP Server by johwiebe, I've found it to be an invaluable tool for managing my Anki flashcards efficiently. The seamless integration and intuitive interface significantly streamline the process, making my study sessions more productive. I highly recommend this server to anyone looking to optimize their Anki experience.