MCP Tunnel is a simple MCP (Model Context Protocol) server that allows accessing the command line of a VM machine. It also tunnels the host to the web, making it accessible via MCP.
npx mcp-cli
npm install -g mcp-cli
mcp-cli
# Clone repository
git clone [repository-url]
cd mcp-cli
# Install dependencies
npm install
Run the development server with hot-reloading for both backend and frontend:
npm run dev
Build both the frontend and backend for production:
npm run build-all
# Start with automatic tunneling
npm start
# Start without automatic tunneling
npm start -- --no-tunnel
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:
execute_command
: Run a shell command on the VM{ "command": "your shell command" }
start_tunnel
: Create a web tunnel to access the VM interface{ "port": 8080, "subdomain": "optional-subdomain" }
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
Create a .env
file to configure the server:
# Server configuration
PORT=8080
# Localtunnel configuration
LOCALTUNNEL_SUBDOMAIN=your-preferred-subdomain
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
MCP server for accessing VM command line with web tunneling
No releases published
No packages published