MCP iOS Simulator Screenshot

MIT License
  • Apple

Integrations

  • Captures screenshots from iOS Simulator devices and saves them to a specified directory with options for output filename, directory, image resizing, and selecting specific simulator devices.

  • Runs on macOS to capture iOS Simulator screenshots, requiring macOS as the underlying operating system to access the iOS Simulator environment.

  • Leverages Xcode Command Line Tools to interact with iOS Simulator devices and capture screenshots through the xcrun simctl command.

MCP iOS シミュレータのスクリーンショット

モデル コンテキスト プロトコル (MCP) を使用して iOS シミュレータからスクリーンショットをキャプチャするサーバー。

概要

このプロジェクトは、iOS シミュレータの現在の画面をキャプチャし、指定されたディレクトリに保存する MCP プロトコル サーバーを実装します。

設定

  1. インストール
# Global installation npm install -g mcp-ios-simulator-screenshot # Or, install in your project npm install mcp-ios-simulator-screenshot # Or, clone from repository git clone https://github.com/yorifuji/mcp-ios-simulator-screenshot.git cd mcp-ios-simulator-screenshot npm install npm run build
  1. MCP クライアント構成:

次のように、サーバー情報を MCP クライアント構成ファイルに追加します。

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "mcp-ios-simulator-screenshot" } } }

環境変数

このサーバーは環境変数を使用しません。

コマンドライン引数

このサーバーはコマンド ライン引数を使用しません。

詳細設定

インストール方法によるMCPクライアント構成

グローバルにインストールする場合

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "mcp-ios-simulator-screenshot" } } }

ローカルにインストールする場合

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "node", "args": [ "/path/to/node_modules/mcp-ios-simulator-screenshot/build/index.js" ] } } }

リポジトリからクローンする場合

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "node", "args": ["/path/to/mcp-ios-simulator-screenshot/build/index.js"] } } }

npxを使用する場合

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "npx", "args": ["mcp-ios-simulator-screenshot"] } } }

Dockerを使用する場合

{ "mcpServers": { "mcp-ios-simulator-screenshot": { "command": "docker", "args": ["run", "-i", "mcp-ios-simulator-screenshot"] } } }

トラブルシューティング

  • スクリーンショットをキャプチャできない場合:
    • iOSシミュレータが実行中かどうかを確認する
    • Xcodeコマンドラインツールがインストールされているかどうかを確認する
    • xcrun simctl io booted screenshotコマンドを直接実行できるかどうかを確認します
  • 権限エラーが発生した場合:
    • 出力ディレクトリへの書き込み権限があるかどうかを確認してください

プロジェクト構造

./ ├── src/ │ ├── index.ts # Entry point │ ├── config.ts # Configuration │ ├── types.ts # Type definitions │ └── services/ │ └── screenshot-service.ts # Screenshot service ├── build/ # Build output ├── .screenshots/ # Default output directory └── package.json # Project configuration

ツール

iosシミュレータのスクリーンショットを取得する

iOS シミュレータからスクリーンショットをキャプチャし、指定されたディレクトリに保存します。

パラメータ

パラメータ名タイプ説明デフォルト値
出力ファイル名出力ファイル名シミュレータ_[タイムスタンプ].png
出力ディレクトリ出力ディレクトリ.スクリーンショット
サイズ変更ブール値画像のサイズを変更するかどうか真実
最大幅整数サイズ変更の最大幅(ピクセル)640
デバイスIDシミュレータデバイスを指定します(例: iPhone15,2起動したデバイス ( booted )

出力形式

成功した場合:

{ "success": true, "message": "iOS Simulator screenshot saved successfully", "filePath": ".screenshots/simulator_2025-04-10T16-51-16-755Z.png", "metadata": { "width": 1170, "height": 2532, "format": "png", "size": 382946, "timestamp": "2025-04-10T16:51:16.755Z" } }

エラーの場合:

{ "success": false, "message": "Error capturing iOS Simulator screenshot: [error message]", "error": { "code": "ENOENT", "command": "xcrun simctl io booted screenshot --type=png -", "stderr": "No matching devices found." } }

要件

  • Node.js 16.0.0以上
  • macOS(iOSシミュレータが必要)
  • Xcode コマンドラインツール

テクノロジースタック

  • タイプスクリプト
  • Node.js
  • MCP SDK(@modelcontextprotocol/sdk)

ライセンス

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

その他の言語

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

モデル コンテキスト プロトコル (MCP) を使用して iOS シミュレータからスクリーンショットをキャプチャし、指定されたディレクトリに保存するサーバー。

  1. Overview
    1. Setup
      1. Environment Variables
        1. Command Line Arguments
          1. Advanced Configuration
            1. MCP Client Configuration by Installation Method
          2. Troubleshooting
            1. Project Structure
              1. Tools
                1. get_ios_simulator_screenshot
              2. Requirements
                1. Technology Stack
                  1. License
                    1. Other Languages
                      ID: vz30wisdsx