MCP Tunnel

MCP Tunnel

A simple MCP server that allows accessing and executing shell commands on a VM machine through a web-based terminal interface, with automatic tunneling to make the VM accessible from anywhere.

leomercier

Developer Tools
Visit Server

README

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python