Supports configuration of the server through environment variables stored in a .env file.
Used for cloning the repository during local development setup.
Used as the runtime environment for the MCP server, with v18 or newer required for operation.
Provides installation and package management for the MCP server via global or local installation methods.
Enables execution of shell commands on a VM through the MCP interface, allowing remote interaction with the VM's command line.
Implements WebSocket-based real-time communication for the terminal interface.
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
Related MCP server: MCP SSH Agent
Prerequisites
Node.js (v18 or newer)
Installation and Usage
Running with npx (no installation)
Global Installation
Local Development
Development
Run the development server with hot-reloading for both backend and frontend:
Building
Build both the frontend and backend for production:
Usage
Start the MCP server:
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.
The server will start and provide output on stderr (to avoid interfering with MCP communication on stdout)
Use MCP to interact with the server using the following tools:
Available MCP Tools
execute_command: Run a shell command on the VMParameters:
{ "command": "your shell command" }
start_tunnel: Create a web tunnel to access the VM interfaceParameters:
{ "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:
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