Skip to main content
Glama

MCP Command Proxy

by Hormold

MCP コマンドプロキシ

CLI コマンドのプロキシとして機能する MCP (Model Context Protocol) サーバー。Expo 開発用に特別に設計されていますが、あらゆるコマンドライン アプリケーションに適応できます。

カーソルでの使い方(Expoの例)

  1. Expoプロジェクトのディレクトリに移動します
  2. npx mcp-command-proxy --prefix "ExpoServer" --command "expo start" --port 8383実行します。
  3. 次のように、カーソル設定 -> MCP -> +新しい MCP サーバーの追加に移動します。
    add\_mcp\_server
  4. 名前を「ExpoServer」、タイプを「SSE」、URLをhttp://localhost:8383/sseに設定します。
  5. 「保存」をクリックすると、CursorでMCPサーバーを使用できるようになります。以下のようになります。mcp\_server\_in\_cursor

他のサーバーとの競合を避けるため、 --port 8383フラグの使用を推奨します。また、.cursorrules ファイルに以下の指示を追加することもできます。

You can use MCP getRecentLogs tool to get the most recent logs from Expo server. And if needed, you can send key presses to the running process using sendKeyPress tool.

特徴

  • コマンドプロキシ: MCPサーバーを介して任意のCLIコマンドを実行します。
  • ログ収集: 実行中のプロセスからログをキャプチャして保存します (バッファ サイズは設定可能)
  • キー押下転送: クライアントから実行中のプロセスにキー押下を転送します
  • 透過的なエクスペリエンス:エンドユーザーは、コマンドを直接実行した場合とまったく同じようにコマンドの出力を見ることができます。
  • 対話型コマンド: Expo のような対話型 CLI ツールで動作します
  • MCP 統合: Claude やその他の MCP 対応 AI アシスタントとの簡単な統合のために MCP SDK を使用して構築されています

仕組み

  1. サーバーは擬似端末(PTY)で指定されたコマンドを開始します。
  2. すべての stdout/stderr 出力は次のとおりです。
    • リアルタイムでクライアントにストリーミング
    • 循環バッファに保存されます(サイズは設定可能、デフォルトは300行)
  3. クライアントからのキー入力は実行中のプロセスに転送されます
  4. サーバーは次のツールを提供します:
    • 収集されたログを表示する
    • キーの押下をプロセスに送信する
    • プロセスの現在の状態を取得する

ユースケース

  • Expo 開発: expo startを実行し、ログを収集しながら操作します。
  • ビルドプロセス: ビルドプロセスを監視し、ログを分析する
  • 長期実行サービス: サービスを監視し、最近のログ履歴を保持します
  • リモートコマンド実行: リモートクライアントからのコマンドの実行と監視

要件

  • Node.js 18歳以上
  • タイプスクリプト
  • pnpm(推奨)またはnpm

インストール

# Install dependencies pnpm install # Build the project pnpm build # Run directly pnpm start -- --prefix "MyServer" --command "expo start" # Or install globally pnpm install -g mcp-command-proxy --prefix "MyServer" --command "expo start"

使用法

基本的な使い方

# Using the CLI mcp-command-proxy --prefix "ExpoServer" --command "expo start" # Or programmatically import { createServer } from 'mcp-command-proxy'; const server = await createServer({ prefix: 'ExpoServer', command: 'expo start', bufferSize: 500, port: 8080 }); // To stop the server later server.stop();

オプション

  • --prefix, -p : サーバーの名前/プレフィックス (デフォルト: "CommandProxy")
  • --command, -c : 実行するコマンド(必須)
  • --buffer-size, -b : メモリに保持するログ行数(デフォルト: 300)
  • --port : HTTPサーバーのポート(デフォルト: 8080)
  • --help, -h : ヘルプを表示

MCP統合

このサーバーは、次の MCP ツールを実装します。

  1. getRecentLogs : バッファから最新のログを返します
    • パラメータ:
      • limit (オプション): 返されるログの数 (デフォルト: 100)
      • types (オプション): 含めるログの種類 (stdout、stderr、system) (デフォルト: all)
  2. sendKeyPress : 実行中のプロセスにキー押下を送信します
    • パラメータ:
      • key : 送信するキー(例:「enter」、「a」、「1」、「space」)
  3. getProcessStatus : プロセスの現在のステータスを返します
    • パラメータ: なし

ランニングエキスポスタート

mcp-command-proxy -p "ExpoServer" -c "expo start" -b 500

クロードと一緒に使う

  1. Claude をこの MCP サーバーに接続するように設定します (SSE エンドポイント: http://localhost:8080/sse )
  2. ClaudeにExpoやその他のコマンドを実行してもらう
  3. クロードはログを分析し、問題のトラブルシューティングを支援できます

発達

# Clone the repository git clone https://github.com/hormold/mcp-command-proxy.git cd mcp-command-proxy # Install dependencies pnpm install # Build the project pnpm build # Run in development mode pnpm dev

ライセンス

マサチューセッツ工科大学

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

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

AI アシスタントがモデル コンテキスト プロトコル (MCP) を介して Expo などのコマンドライン アプリケーションを実行および操作し、ログをキャプチャしてキー押下転送を可能にするプロキシ サーバー。

  1. カーソルでの使い方(Expoの例)
    1. 特徴
      1. 仕組み
        1. ユースケース
          1. 要件
            1. インストール
              1. 使用法
                1. 基本的な使い方
                2. オプション
                3. MCP統合
                1. ランニングエキスポスタート
                2. クロードと一緒に使う
              2. 発達
                1. ライセンス

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
                    Last updated -
                    1
                    6,082
                    1,925
                    TypeScript
                    MIT License
                    • Apple
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A proxy server that bridges AI agents and external APIs by dynamically translating OpenAPI specifications into standardized MCP tools, enabling seamless interaction without custom integration code.
                    Last updated -
                    52
                    Python
                    MIT License
                    • Linux
                    • Apple
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A server that enables AI assistants to execute terminal commands and retrieve outputs via the Model Context Protocol (MCP).
                    Last updated -
                    3
                    13
                    Python
                    MIT License
                    • Apple
                    • Linux
                  • -
                    security
                    A
                    license
                    -
                    quality
                    An MCP server that enables AI assistants to control a web browser through natural language commands, allowing them to navigate websites and extract information via SSE transport.
                    Last updated -
                    648
                    Python
                    MIT License
                    • Apple

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hormold/mcp-command-proxy'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server