MCP Server for iOS Simulator

Integrations

  • Built on top of appium-ios-simulator to provide iOS simulator interaction capabilities for controlling simulator lifecycle and performing actions.

  • Allows programmatic control of iOS simulators, including starting, stopping, booting, installing and launching apps, taking screenshots, and performing taps on coordinates.

  • Interacts with Xcode's iOS simulator infrastructure to manage simulator instances and perform operations on iOS devices.

📱 iOS シミュレータ用 MCP サーバー

iOS シミュレータ用のモデル コンテキスト プロトコル (MCP) を実装するサーバー。appium -ios-simulator上に構築され、 MCP TypeScript SDK を活用しています。

📋 概要

このプロジェクトは、iOSシミュレータとモデルコンテキストプロトコル(MCP)間のブリッジを提供し、iOSシミュレータインスタンスとの標準化された通信を可能にします。MCPプロトコルを活用することで、異なる環境間で一貫したインターフェースを実現しながら、iOSシミュレータをプログラムで制御できます。サーバーはstdioをトランスポートメカニズムとして利用しているため、Claude Desktopやその他のMCP対応クライアントとの統合に最適です。

🎬 デモ

Claude AI Desktop を使用して iOS シミュレーターを起動する方法を示すデモ

🏗️ 建築

サーバーは 3 つの主要コンポーネントで構成されています。

  1. 🔄シミュレータ管理層- iOSシミュレータのライフサイクルとインタラクションを処理します
  2. 🔌 MCP プロトコル実装- TypeScript SDK と stdio トランスポートを使用してモデルコンテキストプロトコルを実装します
  3. 📊 ロガーコンポーネント- stdioトランスポートに干渉することなくファイルベースのロギングを提供します
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ MCP Protocol │ │ Stdio │ │ Simulator │ │ Implementation │◄────┤ Transport │◄────┤ Management │ │ │ │ │ │ Layer │ └─────────────────┘ └─────────────────┘ └─────────────────┘ ▲ ▲ │ │ ▼ ▼ ┌─────────────────┐ ┌─────────────────┐ │ MCP Client │ │ iOS Simulator │ │ (e.g. Claude) │ │ │ └─────────────────┘ └─────────────────┘

✨ 特徴

  • 🚀 iOS シミュレータインスタンスの起動、停止、管理
  • 🔌 ブートおよびシャットダウンシミュレータ
  • 📲 シミュレータにアプリケーションをインストールして起動する
  • 📸 シミュレータ画面のスクリーンショットを撮る
  • 👆 座標をタップする
  • 🔄 複数の同時シミュレータセッションのサポート
  • 📝 コンソール出力なしの包括的なファイルベースのログ記録
  • 🛡️ エラー耐性のある操作

📋 前提条件

  • 🟢 Node.js (v16 以降)
  • 🍎 macOS(iOSシミュレーターに必要)
  • 🛠️ iOS シミュレータがインストールされた Xcode
  • 📜 TypeScript 4.5以上

🔧 インストール

# Clone the repository git clone https://github.com/atom2ueki/mcp-server-ios-simulator.git cd mcp-server-ios-simulator # Install dependencies npm install

⚙️ 構成

構成はsrc/config.tsファイルを通じて処理されます。

const config = { simulator: { defaultDevice: process.env.SIMULATOR_DEFAULT_DEVICE || 'iPhone 16', defaultOS: process.env.SIMULATOR_DEFAULT_OS || '18.2', timeout: parseInt(process.env.SIMULATOR_TIMEOUT || '30000', 10), } };

環境変数を設定することでこれらの設定をカスタマイズできます。

SIMULATOR_DEFAULT_DEVICE=iPhone 16 SIMULATOR_DEFAULT_OS=18.2 SIMULATOR_TIMEOUT=30000

🚀 使用方法

🔨 サーバーの構築と起動

# Build the project npm run build # Start the server npm start

🧰 MCP ツール

サーバーは、iOS シミュレーターを制御するための 2 つの異なるアプローチを提供します。

📱 シミュレータの直接管理(推奨)

これらのツールはシミュレータ UDID と直接連携し、セッションを維持する必要がありません。

  • 📋 list-available-simulators - 利用可能なすべてのシミュレータとそのUDIDを一覧表示します
  • ▶️ boot-simulator-by-udid - UDIDを使用してシミュレータを直接起動します
  • shutdown-simulator-by-udid - UDIDを使用してシミュレータを直接シャットダウンします
  • 📊 list-booted-simulators - 現在起動しているシミュレータをすべて一覧表示します

この方法は、シミュレーターを直接起動、使用、シャットダウンしたい場合に使用します

📱 セッションベースの管理(上級)

これらのツールは、カスタム セッション ID を使用してシミュレータを追跡するセッション レイヤーを使用します。

  • 📋 list-simulator-sessions - アクティブなシミュレータセッションをすべて一覧表示します
  • create-simulator-session - 新しいシミュレータセッションを作成する
  • terminate-simulator-session - セッションを終了する(シミュレータをシャットダウンしてクリーンアップする)
  • 🔄 create-and-boot-simulator - 新しいシミュレータセッションを作成して起動する
  • ▶️ boot-simulator - 既存のセッションのシミュレータを起動する
  • ⏹️shutdown shutdown-simulator - 既存のセッションのシミュレータをシャットダウンする

このアプローチは、シミュレータのメタデータを追跡したり、カスタム ID でシミュレータを参照したり、より高度な管理機能を使用したりする必要がある場合に使用します

📲 アプリケーション管理

  • 📥 install-app - シミュレータにアプリケーションをインストールする
  • 🚀 launch-app - シミュレータ上でアプリケーションを起動する
  • 🛑 terminate-app - シミュレータ上で実行中のアプリケーションを終了する

🖱️ インタラクションツール

  • 📷 take-screenshot - シミュレータ画面のスクリーンショットを撮る
  • 👆 tap-coordinate - 指定した座標でタップを実行します

🤖 Claude Desktop での使用例

  1. このサーバーを MCP ツールとして使用するように Claude Desktop を構成します。
    • クロードデスクトップを開く
    • 「設定」>「詳細設定」へ移動
    • 「MCP サーバー」セクションに次の構成を追加します。
    { "mcpServers": { "simulator": { "command": "node", "args": [ "/path/to/your/mcp-server-ios-simulator/dist/index.js" ] } } }
    • /path/to/yourこのリポジトリをインストールした実際のパスに置き換えます。
    • 設定を保存し、Claude Desktopを再起動します。
  2. 提供されているツールを使用して、Claude Desktop から直接 iOS シミュレーターを制御します。直接UDIDアプローチ(推奨):
    1. まず、Claude に利用可能なシミュレーターをリストしてもらいます。
      "Show me all available iOS simulators"
    2. 次に、UDID を使用して特定のシミュレータを起動します。
      "Boot the iOS simulator with UDID 5272EA61-5796-4372-86FE-3B33831D5CC1"
    3. 終了したら、同じ UDID を使用してシャットダウンします。
      "Shut down the simulator with UDID 5272EA61-5796-4372-86FE-3B33831D5CC1"

    ほとんどのユースケースでは、直接的な UDID アプローチの方がシンプルで信頼性が高くなります。

    **セッションベースのアプローチ (上級):**セッション トラッキングの高度な機能が必要な場合にのみ、このアプローチを使用します。

    "Create a new simulator session for iPhone 16 Pro with iOS 18.2" "Boot the simulator for session abc-123" "Take a screenshot of the simulator for session abc-123" "Terminate the simulator session abc-123"

👨‍💻 開発

📁 プロジェクト構造

src/ ├── simulator/ # Simulator management layer ├── mcp/ # MCP protocol implementation ├── bridge/ # Bridge component ├── utils/ # Utility functions including logger ├── config.ts # Configuration handling └── index.ts # Entry point

🔨 プロジェクトの構築

# Install development dependencies npm install # Run TypeScript compiler npm run build

📜 ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

🙏 謝辞

-
security - not tested
F
license - not found
-
quality - not tested

iOS シミュレータとモデル コンテキスト プロトコル間のブリッジであり、標準化された通信インターフェイスを介して iOS シミュレータをプログラムで制御できるようにします。

  1. 📋 Overview
    1. 🎬 Demo
      1. 🏗️ Architecture
        1. ✨ Features
          1. 📋 Prerequisites
            1. 🔧 Installation
              1. ⚙️ Configuration
                1. 🚀 Usage
                  1. 🔨 Building and Starting the Server
                  2. 🧰 MCP Tools
                  3. 🤖 Example Usage with Claude Desktop
                2. 👨‍💻 Development
                  1. 📁 Project Structure
                  2. 🔨 Building the Project
                3. 📜 License
                  1. 🙏 Acknowledgments
                    ID: 18at56szif