Skip to main content
Glama

iOS Simulator MCP Server

Install MCP Server NPM Version

Ein Model Context Protocol (MCP) Server für die Interaktion mit iOS-Simulatoren. Dieser Server ermöglicht es Ihnen, mit iOS-Simulatoren zu interagieren, indem Sie Informationen über sie abrufen, UI-Interaktionen steuern und UI-Elemente untersuchen.

Sicherheitshinweis: Befehlsinjektionsschwachstellen in Versionen < 1.3.3 wurden behoben. Bitte aktualisieren Sie auf v1.3.3 oder höher. Siehe SECURITY.md für Details.

https://github.com/user-attachments/assets/453ebe7b-cc93-4ac2-b08d-0f8ac8339ad3

🌟 Vorgestellt in

Dieses Projekt wurde in verschiedenen Publikationen und Ressourcen vorgestellt und erwähnt:

Related MCP server: iOS Device Control MCP Server

Tools

get_booted_sim_id

Beschreibung: Ruft die ID des aktuell gestarteten iOS-Simulators ab

Parameter: Keine Parameter

open_simulator

Beschreibung: Öffnet die iOS Simulator-Anwendung

Parameter: Keine Parameter

ui_describe_all

Beschreibung: Beschreibt Barrierefreiheitsinformationen für den gesamten Bildschirm im iOS-Simulator

Parameter:

{
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
}

ui_tap

Beschreibung: Tippen auf den Bildschirm im iOS-Simulator

Parameter:

{
  /**
   * Press duration in seconds (decimal numbers allowed)
   */
  duration?: string;
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
  /** The x-coordinate */
  x: number;
  /** The y-coordinate */
  y: number;
}

ui_type

Beschreibung: Eingabe von Text in den iOS-Simulator

Parameter:

{
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
  /**
   * Text to input
   * Format: ASCII printable characters only
   */
  text: string;
}

ui_swipe

Beschreibung: Wischen auf dem Bildschirm im iOS-Simulator

Parameter:

{
  /**
   * Swipe duration in seconds (decimal numbers allowed)
   */
  duration?: string;
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
  /** The starting x-coordinate */
  x_start: number;
  /** The starting y-coordinate */
  y_start: number;
  /** The ending x-coordinate */
  x_end: number;
  /** The ending y-coordinate */
  y_end: number;
  /** The size of each step in the swipe (default is 1) */
  delta?: number;
}

ui_describe_point

Beschreibung: Gibt das Barrierefreiheitselement an den angegebenen Koordinaten auf dem Bildschirm des iOS-Simulators zurück

Parameter:

{
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
  /** The x-coordinate */
  x: number;
  /** The y-coordinate */
  y: number;
}

ui_find_element

Beschreibung: Durchsucht den Barrierefreiheitsbaum und gibt Elemente zurück, die den angegebenen Kriterien entsprechen

Parameter:

{
  /** Array of search strings. An element matches if ANY string matches against its AXLabel or AXUniqueId */
  search: string[];
  /** Filter by element type (e.g. 'Button', 'StaticText', 'Group'). Case-insensitive exact match */
  type?: string;
  /** Match mode: 'substring' (default) or 'exact' */
  matchMode?: "substring" | "exact";
  /** Whether search matching is case-sensitive (default: false) */
  caseSensitive?: boolean;
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
}

ui_view

Beschreibung: Ruft den Bildinhalt eines komprimierten Screenshots der aktuellen Simulatoransicht ab

Parameter:

{
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
}

screenshot

Beschreibung: Erstellt einen Screenshot des iOS-Simulators

Parameter:

{
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
  /** File path where the screenshot will be saved. If relative, it uses the directory specified by the `IOS_SIMULATOR_MCP_DEFAULT_OUTPUT_DIR` env var, or `~/Downloads` if not set. */
  output_path: string;
  /** Image format (png, tiff, bmp, gif, or jpeg). Default is png. */
  type?: "png" | "tiff" | "bmp" | "gif" | "jpeg";
  /** Display to capture (internal or external). Default depends on device type. */
  display?: "internal" | "external";
  /** For non-rectangular displays, handle the mask by policy (ignored, alpha, or black) */
  mask?: "ignored" | "alpha" | "black";
}

record_video

Beschreibung: Zeichnet ein Video des iOS-Simulators direkt mit simctl auf

Parameter:

{
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
  /** Optional output path. If not provided, a default name will be used. The file will be saved in the directory specified by `IOS_SIMULATOR_MCP_DEFAULT_OUTPUT_DIR` or in `~/Downloads` if the environment variable is not set. */
  output_path?: string;
  /** Specifies the codec type: "h264" or "hevc". Default is "hevc". */
  codec?: "h264" | "hevc";
  /** Display to capture: "internal" or "external". Default depends on device type. */
  display?: "internal" | "external";
  /** For non-rectangular displays, handle the mask by policy: "ignored", "alpha", or "black". */
  mask?: "ignored" | "alpha" | "black";
  /** Force the output file to be written to, even if the file already exists. */
  force?: boolean;
}

stop_recording

Beschreibung: Stoppt die Videoaufnahme des Simulators mit killall

Parameter: Keine Parameter

install_app

Beschreibung: Installiert ein App-Bundle (.app oder .ipa) auf dem iOS-Simulator

Parameter:

{
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
  /** Path to the app bundle (.app directory or .ipa file) to install */
  app_path: string;
}

launch_app

Beschreibung: Startet eine App auf dem iOS-Simulator anhand des Bundle-Identifikators

Parameter:

{
  /**
   * Udid of target, can also be set with the IDB_UDID env var
   * Format: UUID (8-4-4-4-12 hexadecimal characters)
   */
  udid?: string;
  /** Bundle identifier of the app to launch (e.g., com.apple.mobilesafari) */
  bundle_id: string;
  /** Terminate the app if it is already running before launching */
  terminate_running?: boolean;
  /** Optional environment variables passed via SIMCTL_CHILD_ to simctl launch */
  env?: Record<string, string>;
}

Hinweise: Umgebungsvariablen werden mit SIMCTL_CHILD_ übergeben, da simctl launch nicht auf allen Xcode-Versionen --env/--envs unterstützt.

Beispiel:

{
  "bundle_id": "com.example.app",
  "terminate_running": true,
  "env": {
    "FOO": "bar",
    "BAZ": "qux"
  }
}

💡 Anwendungsfall: QA-Schritt via MCP-Tool-Aufrufe

Dieser MCP-Server ermöglicht es KI-Assistenten, die in einen Model Context Protocol (MCP) Client integriert sind, Qualitätssicherungsaufgaben durch Tool-Aufrufe durchzuführen. Dies ist unmittelbar nach der Implementierung von Funktionen nützlich, um die UI-Konsistenz und das korrekte Verhalten sicherzustellen.

Verwendung

Weisen Sie Ihren KI-Assistenten nach der Implementierung einer Funktion innerhalb seiner MCP-Client-Umgebung an, die verfügbaren Tools zu verwenden. Im Agenten-Modus von Cursor könnten Sie beispielsweise die unten stehenden Prompts verwenden, um UI-Interaktionen schnell zu validieren und zu dokumentieren.

Beispiel-Prompts

  • UI-Elemente verifizieren:

    Verify all accessibility elements on the current screen
  • Texteingabe bestätigen:

    Enter "QA Test" into the text input field and confirm the input is correct
  • Tipp-Reaktion prüfen:

    Tap on coordinates x=250, y=400 and verify the expected element is triggered
  • Wischaktion validieren:

    Swipe from x=150, y=600 to x=150, y=100 and confirm correct behavior
  • Detaillierte Elementprüfung:

    Describe the UI element at position x=300, y=350 to ensure proper labeling and functionality
  • Ihrem KI-Agenten den Simulator-Bildschirm zeigen:

    View the current simulator screen
  • Screenshot erstellen:

    Take a screenshot of the current simulator screen and save it to my_screenshot.png
  • Video aufnehmen:

    Start recording a video of the simulator screen (saves to the default output directory, which is `~/Downloads` unless overridden by `IOS_SIMULATOR_MCP_DEFAULT_OUTPUT_DIR`)
  • Aufnahme stoppen:

    Stop the current simulator screen recording
  • App installieren:

    Install the app at path/to/MyApp.app on the simulator
  • App starten:

    Launch the Safari app (com.apple.mobilesafari) on the simulator

Voraussetzungen

Installation

Dieser Abschnitt enthält Anweisungen zur Integration des iOS Simulator MCP-Servers mit verschiedenen Model Context Protocol (MCP) Clients.

Installation mit Cursor

Cursor verwaltet MCP-Server über seine Konfigurationsdatei unter ~/.cursor/mcp.json.

Option 1: Verwendung von NPX (Empfohlen)

  1. Bearbeiten Sie Ihre Cursor MCP-Konfigurationsdatei. Sie können sie oft direkt aus Cursor öffnen oder einen Befehl wie diesen verwenden:

    # Open with your default editor (or use 'code', 'vim', etc.)
    open ~/.cursor/mcp.json
    # Or use Cursor's command if available
    # cursor ~/.cursor/mcp.json
  2. Fügen Sie den Abschnitt mcpServers mit der Konfiguration des iOS-Simulator-Servers hinzu oder aktualisieren Sie ihn:

    {
      "mcpServers": {
        // ... other servers might be listed here ...
        "ios-simulator": {
          "command": "npx",
          "args": ["-y", "ios-simulator-mcp"]
        }
      }
    }

    Stellen Sie sicher, dass die JSON-Struktur gültig ist, insbesondere wenn mcpServers bereits existiert.

  3. Starten Sie Cursor neu, damit die Änderungen wirksam werden.

Option 2: Lokale Entwicklung

  1. Klonen Sie dieses Repository:

    git clone https://github.com/joshuayoes/ios-simulator-mcp
    cd ios-simulator-mcp
  2. Installieren Sie die Abhängigkeiten:

    npm install
  3. Erstellen Sie das Projekt:

    npm run build
  4. Bearbeiten Sie Ihre Cursor MCP-Konfigurationsdatei (wie in Option 1 gezeigt).

  5. Fügen Sie den Abschnitt mcpServers hinzu oder aktualisieren Sie ihn, wobei Sie auf Ihren lokalen Build verweisen:

    {
      "mcpServers": {
        // ... other servers might be listed here ...
        "ios-simulator": {
          "command": "node",
          "args": ["/full/path/to/your/ios-simulator-mcp/build/index.js"]
        }
      }
    }

    Wichtig: Ersetzen Sie /full/path/to/your/ durch den absoluten Pfad zu dem Ort, an den Sie das ios-simulator-mcp Repository geklont haben.

  6. Starten Sie Cursor neu, damit die Änderungen wirksam werden.

Installation mit Claude Code

Das Claude Code CLI kann MCP-Server über die claude mcp Befehle oder durch direktes Bearbeiten der Konfigurationsdateien verwalten. Weitere Details zur Claude Code MCP-Konfiguration finden Sie in der offiziellen Dokumentation.

Option 1: Verwendung von NPX (Empfohlen)

  1. Fügen Sie den Server mit dem Befehl claude mcp add hinzu:

    claude mcp add ios-simulator npx ios-simulator-mcp
  2. Starten Sie bei Bedarf laufende Claude Code-Sitzungen neu.

Option 2: Lokale Entwicklung

  1. Klonen Sie dieses Repository, installieren Sie die Abhängigkeiten und erstellen Sie das Projekt wie in den Schritten 1-3 der Cursor "Lokale Entwicklung" beschrieben.

  2. Fügen Sie den Server mit dem Befehl claude mcp add hinzu und verweisen Sie auf Ihren lokalen Build:

    claude mcp add ios-simulator -- node "/full/path/to/your/ios-simulator-mcp/build/index.js"

    Wichtig: Ersetzen Sie /full/path/to/your/ durch den absoluten Pfad zu dem Ort, an den Sie das ios-simulator-mcp Repository geklont haben.

  3. Starten Sie bei Bedarf laufende Claude Code-Sitzungen neu.

Konfiguration

Umgebungsvariablen

Variable

Beschreibung

Beispiel

IOS_SIMULATOR_MCP_FILTERED_TOOLS

Eine durch Kommas getrennte Liste von Tool-Namen, die von der Registrierung ausgeschlossen werden sollen.

screenshot,record_video,stop_recording

IOS_SIMULATOR_MCP_DEFAULT_OUTPUT_DIR

Gibt ein Standardverzeichnis für Ausgabedateien wie Screenshots und Videoaufnahmen an. Wenn nicht festgelegt, wird ~/Downloads verwendet. Dies kann nützlich sein, wenn Ihr Agent begrenzten Zugriff auf das Dateisystem hat.

~/Code/awesome-project/tmp

IOS_SIMULATOR_MCP_IDB_PATH

Gibt einen benutzerdefinierten Pfad zur IDB-ausführbaren Datei an. Wenn nicht festgelegt, wird idb verwendet (unter der Annahme, dass es sich in Ihrem PATH befindet). Nützlich, wenn IDB an einem nicht standardmäßigen Ort installiert ist.

~/bin/idb oder /usr/local/bin/idb

Konfigurationsbeispiel

{
  "mcpServers": {
    "ios-simulator": {
      "command": "npx",
      "args": ["-y", "ios-simulator-mcp"],
      "env": {
        "IOS_SIMULATOR_MCP_FILTERED_TOOLS": "screenshot,record_video,stop_recording",
        "IOS_SIMULATOR_MCP_DEFAULT_OUTPUT_DIR": "~/Code/awesome-project/tmp",
        "IOS_SIMULATOR_MCP_IDB_PATH": "~/bin/idb"
      }
    }
  }
}

MCP Registry Server Auflistungen

Lizenz

MIT

Available Tools

17 tools
get_booted_sim_idA
Read-only

Get the ID of the currently booted iOS simulator

Inputs: no named parameters.

install_appA

Installs an app bundle (.app or .ipa) on the iOS Simulator

Inputs: app_path (required), udid.

launch_appA

Launches an app on the iOS Simulator by bundle identifier

Inputs: bundle_id (required), env, udid, terminate_running.

list_appsA
Read-only

Lists all installed apps on the iOS Simulator with their bundle identifiers and display names

Inputs: udid.

open_simulatorA

Opens the iOS Simulator application

Inputs: no named parameters.

open_urlA

Opens a URL in the iOS Simulator, useful for testing deep links and universal links

Inputs: url (required), udid.

record_videoB

Records a video of the iOS Simulator using simctl directly

Inputs: mask, udid, codec, force, +2 more.

screenshotB

Takes a screenshot of the iOS Simulator

Inputs: output_path (required), mask, type, udid, +1 more.

stop_recordingA

Stops the simulator video recording using killall

Inputs: no named parameters.

terminate_appA

Terminates a running app on the iOS Simulator by bundle identifier

Inputs: bundle_id (required), udid.

ui_describe_allA
Read-only

Describes accessibility information for the entire screen in the iOS Simulator

Inputs: udid.

ui_describe_pointA
Read-only

Returns the accessibility element at given co-ordinates on the iOS Simulator's screen

Inputs: x (required), y (required), udid.

ui_find_elementA
Read-only

Searches the accessibility tree and returns elements matching the given criteria

Inputs: search (required), type, udid, matchMode, +1 more.

ui_swipeB

Swipe on the screen in the iOS Simulator

Inputs: x_end (required), y_end (required), x_start (required), y_start (required), +3 more.

ui_tapB

Tap on the screen in the iOS Simulator

Inputs: x (required), y (required), udid, duration.

ui_typeB

Input text into the iOS Simulator

Inputs: text (required), udid, method, replace.

ui_viewA
Read-only

Get the image content of a compressed screenshot of the current simulator view

Inputs: udid.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools target clearly distinct actions (tap, swipe, type, describe, install, launch, terminate). The main ambiguity is between ui_view and screenshot, which both return a screenshot of the simulator with no explicit guidance on when to prefer one over the other, and the recording pair (record_video vs stop_recording) is only distinguishable by name symmetry.

    Naming Consistency4/5

    Interaction tools consistently use a ui_ namespace, and lifecycle/app tools follow a clear verb_noun pattern (install_app, launch_app, terminate_app, list_apps, open_url). Minor deviations: record_video/stop_recording breaks the verb_noun symmetry, and the bare noun screenshot sits awkwardly next to ui_view.

    Tool Count4/5

    17 tools is slightly heavy but each maps to a recognizable simulator task across UI inspection, interaction, app management, and recording. The only near-duplicate pair is ui_view/screenshot, so the count is reasonable rather than bloated.

    Completeness3/5

    Core workflows are covered (view, interact, describe accessibility, install/launch/terminate apps, record video), but there are notable gaps: install_app has no uninstall_app counterpart, and there is no support for hardware buttons (home, lock), rotation, or simulator boot/shutdown besides open_simulator.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers