MCP Tunnel logo

MCP Tunnel

by leomercier

MCP Tunnel is a simple server that allows accessing a VM's command line through the Model Context Protocol. It also tunnels the host to the web for remote access.

View on GitHub

Last updated: N/A

What is MCP Tunnel?

MCP Tunnel is a server that enables remote command-line access to a virtual machine (VM) via the Model Context Protocol (MCP). It provides a web-based terminal interface and automatic tunneling for accessibility from anywhere.

How to use MCP Tunnel?

  1. Install Node.js (v18 or newer). 2. Install the package globally with npm install -g mcp-cli or use npx mcp-cli. 3. Start the server using npm start (with or without the --no-tunnel flag to control automatic tunneling). 4. Interact with the server using MCP tools like execute_command and start_tunnel.

Key features of MCP Tunnel

  • 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

Use cases of MCP Tunnel

  • Remote VM management

  • Troubleshooting VMs from anywhere

  • Automated VM configuration

  • Accessing VMs behind firewalls

FAQ from MCP Tunnel

What is MCP?

MCP stands for Model Context Protocol. It is a protocol used for communication and interaction with systems, in this case, a VM's command line.

How do I disable automatic tunneling?

Use the --no-tunnel flag when starting the server: npm start -- --no-tunnel.

What are the available MCP tools?

The available MCP tools are execute_command for running shell commands and start_tunnel for creating a web tunnel.

How do I access the web interface?

After starting the tunnel, the server will provide a URL. Use this URL to access the web-based terminal interface.

What security considerations should I keep in mind?

This tool provides direct access to your VM's command line. Use strong authentication, limit executable commands, consider running in a restricted environment, and avoid exposing sensitive information.