MCP Tunnel

by leomercier
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • 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.

MCPトンネル

VMマシンのコマンドラインへのアクセスを可能にするシンプルなMCP(Model Context Protocol)サーバーです。起動すると、ホストをWebにトンネリングし、MCP経由でアクセスできるようになります。

特徴

  • MCP を介して VM 上でシェル コマンドを実行する
  • VMとの対話のためのWebベースの端末インターフェース
  • 自動トンネリングにより、どこからでも VM にアクセス可能
  • WebSocketベースのリアルタイム通信

前提条件

  • Node.js (v18以降)

インストールと使用方法

npx で実行 (インストール不要)

npx mcp-cli

グローバルインストール

npm install -g mcp-cli mcp-cli

地域開発

# Clone repository git clone [repository-url] cd mcp-cli # Install dependencies npm install

発達

バックエンドとフロントエンドの両方でホットリロードを使用して開発サーバーを実行します。

npm run dev

建物

本番環境用にフロントエンドとバックエンドの両方を構築します。

npm run build-all

使用法

  1. MCP サーバーを起動します。
# Start with automatic tunneling npm start # Start without automatic tunneling npm start -- --no-tunnel

プロジェクトがビルドされ、サーバーが起動します。デフォルトでは、トンネルが自動的に作成されます。自動トンネリングを無効にするには、 --no-tunnelフラグを使用してください。

  1. サーバーが起動し、stderr に出力を提供します (stdout での MCP 通信を妨害しないようにするため)
  2. MCP を使用して、次のツールを使用してサーバーと対話します。

利用可能なMCPツール

  • execute_command : VM上でシェルコマンドを実行する
    • パラメータ: { "command": "your shell command" }
  • start_tunnel : VMインターフェースにアクセスするためのWebトンネルを作成する
    • パラメータ: { "port": 8080, "subdomain": "optional-subdomain" }

ウェブインターフェース

トンネルを開始すると、トンネルから提供されたURLでWebベースのターミナルインターフェースにアクセスできます。このインターフェースでは、以下の操作が可能です。

  • VM内で直接コマンドを実行する
  • コマンド出力をリアルタイムで確認
  • ウェブアクセスのあるあらゆるデバイスから VM を操作します

環境変数

サーバーを構成するための.envファイルを作成します。

# Server configuration PORT=8080 # Localtunnel configuration LOCALTUNNEL_SUBDOMAIN=your-preferred-subdomain

セキュリティに関する考慮事項

このツールは、VMのコマンドラインに直接アクセスできるようにします。以下のセキュリティ対策を検討してください。

  • トンネルを公開する前に強力な認証メカニズムを使用する
  • 適切な検証を通じて実行できるコマンドを制限する
  • 制限された環境での実行を検討する
  • トンネルを通じて機密情報を公開しないでください
-
security - not tested
F
license - not found
-
quality - not tested

ウェブベースのターミナル インターフェイスを介して VM マシン上のシェル コマンドにアクセスして実行できるシンプルな MCP サーバーです。自動トンネリングにより、どこからでも VM にアクセスできるようになります。

  1. Features
    1. Prerequisites
      1. Installation and Usage
        1. Running with npx (no installation)
        2. Global Installation
        3. Local Development
      2. Development
        1. Building
          1. Usage
            1. Available MCP Tools
          2. Web Interface
            1. Environment Variables
              1. Security Considerations
                ID: v5ewpac8yz