A Model Context Protocol (MCP) server for interacting with iOS simulators. This server allows you to interact with iOS simulators by getting information about them, controlling UI interactions, and inspecting UI elements.
Add this skill
npx mdskills install joshuayoes/ios-simulator-mcpComprehensive iOS simulator control with excellent tool descriptions and practical QA examples
1# iOS Simulator MCP Server23[](https://cursor.com/install-mcp?name=ios-simulator&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImlvcy1zaW11bGF0b3ItbWNwIl19) [](https://www.npmjs.com/package/ios-simulator-mcp)45A Model Context Protocol (MCP) server for interacting with iOS simulators. This server allows you to interact with iOS simulators by getting information about them, controlling UI interactions, and inspecting UI elements.67> **Security Notice**: Command injection vulnerabilities present in versions < 1.3.3 have been fixed. Please update to v1.3.3 or later. See [SECURITY.md](SECURITY.md) for details.89https://github.com/user-attachments/assets/453ebe7b-cc93-4ac2-b08d-0f8ac8339ad31011## ๐ Featured In1213This project has been featured and mentioned in various publications and resources:1415- [Claude Code Best Practices article](https://www.anthropic.com/engineering/claude-code-best-practices#:~:text=Write%20code%2C%20screenshot%20result%2C%20iterate) - Anthropic's engineering blog showcasing best practices16- [React Native Newsletter Issue 187](https://us3.campaign-archive.com/?u=78d9e37a94fa0b522939163d4&id=656ed2c2cf#:~:text=iOS%20Simulator%20MCP%20Server) - Featured in the most popular React Native community newsletter17- [Mobile Automation Newsletter - #56](https://testableapple.com/newsletter/56/#:~:text=iOS-,iOS%20Simulator%20MCP,-%F0%9F%8E%99%EF%B8%8F%20Joshua%20Yoes) - Featured a long running newsletter about mobile testing and automation resources18- [punkeye/awesome-mcp-server listing](https://github.com/punkpeye/awesome-mcp-servers) - Listed in one of the most popular curated awesome MCP servers collection1920## Tools2122### `get_booted_sim_id`2324**Description:** Get the ID of the currently booted iOS simulator2526**Parameters:** No Parameters2728### `open_simulator`2930**Description:** Opens the iOS Simulator application3132**Parameters:** No Parameters3334### `ui_describe_all`3536**Description:** Describes accessibility information for the entire screen in the iOS Simulator3738**Parameters:**3940```typescript41{42 /**43 * Udid of target, can also be set with the IDB_UDID env var44 * Format: UUID (8-4-4-4-12 hexadecimal characters)45 */46 udid?: string;47}48```4950### `ui_tap`5152**Description:** Tap on the screen in the iOS Simulator5354**Parameters:**5556```typescript57{58 /**59 * Press duration in seconds (decimal numbers allowed)60 */61 duration?: string;62 /**63 * Udid of target, can also be set with the IDB_UDID env var64 * Format: UUID (8-4-4-4-12 hexadecimal characters)65 */66 udid?: string;67 /** The x-coordinate */68 x: number;69 /** The y-coordinate */70 y: number;71}72```7374### `ui_type`7576**Description:** Input text into the iOS Simulator7778**Parameters:**7980```typescript81{82 /**83 * Udid of target, can also be set with the IDB_UDID env var84 * Format: UUID (8-4-4-4-12 hexadecimal characters)85 */86 udid?: string;87 /**88 * Text to input89 * Format: ASCII printable characters only90 */91 text: string;92}93```9495### `ui_swipe`9697**Description:** Swipe on the screen in the iOS Simulator9899**Parameters:**100101```typescript102{103 /**104 * Swipe duration in seconds (decimal numbers allowed)105 */106 duration?: string;107 /**108 * Udid of target, can also be set with the IDB_UDID env var109 * Format: UUID (8-4-4-4-12 hexadecimal characters)110 */111 udid?: string;112 /** The starting x-coordinate */113 x_start: number;114 /** The starting y-coordinate */115 y_start: number;116 /** The ending x-coordinate */117 x_end: number;118 /** The ending y-coordinate */119 y_end: number;120 /** The size of each step in the swipe (default is 1) */121 delta?: number;122}123```124125### `ui_describe_point`126127**Description:** Returns the accessibility element at given co-ordinates on the iOS Simulator's screen128129**Parameters:**130131```typescript132{133 /**134 * Udid of target, can also be set with the IDB_UDID env var135 * Format: UUID (8-4-4-4-12 hexadecimal characters)136 */137 udid?: string;138 /** The x-coordinate */139 x: number;140 /** The y-coordinate */141 y: number;142}143```144145### `ui_view`146147**Description:** Get the image content of a compressed screenshot of the current simulator view148149**Parameters:**150151```typescript152{153 /**154 * Udid of target, can also be set with the IDB_UDID env var155 * Format: UUID (8-4-4-4-12 hexadecimal characters)156 */157 udid?: string;158}159```160161### `screenshot`162163**Description:** Takes a screenshot of the iOS Simulator164165**Parameters:**166167```typescript168{169 /**170 * Udid of target, can also be set with the IDB_UDID env var171 * Format: UUID (8-4-4-4-12 hexadecimal characters)172 */173 udid?: string;174 /** 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. */175 output_path: string;176 /** Image format (png, tiff, bmp, gif, or jpeg). Default is png. */177 type?: "png" | "tiff" | "bmp" | "gif" | "jpeg";178 /** Display to capture (internal or external). Default depends on device type. */179 display?: "internal" | "external";180 /** For non-rectangular displays, handle the mask by policy (ignored, alpha, or black) */181 mask?: "ignored" | "alpha" | "black";182}183```184185### `record_video`186187**Description:** Records a video of the iOS Simulator using simctl directly188189**Parameters:**190191```typescript192{193 /** 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. */194 output_path?: string;195 /** Specifies the codec type: "h264" or "hevc". Default is "hevc". */196 codec?: "h264" | "hevc";197 /** Display to capture: "internal" or "external". Default depends on device type. */198 display?: "internal" | "external";199 /** For non-rectangular displays, handle the mask by policy: "ignored", "alpha", or "black". */200 mask?: "ignored" | "alpha" | "black";201 /** Force the output file to be written to, even if the file already exists. */202 force?: boolean;203}204```205206### `stop_recording`207208**Description:** Stops the simulator video recording using killall209210**Parameters:** No Parameters211212### `install_app`213214**Description:** Installs an app bundle (.app or .ipa) on the iOS Simulator215216**Parameters:**217218```typescript219{220 /**221 * Udid of target, can also be set with the IDB_UDID env var222 * Format: UUID (8-4-4-4-12 hexadecimal characters)223 */224 udid?: string;225 /** Path to the app bundle (.app directory or .ipa file) to install */226 app_path: string;227}228```229230### `launch_app`231232**Description:** Launches an app on the iOS Simulator by bundle identifier233234**Parameters:**235236```typescript237{238 /**239 * Udid of target, can also be set with the IDB_UDID env var240 * Format: UUID (8-4-4-4-12 hexadecimal characters)241 */242 udid?: string;243 /** Bundle identifier of the app to launch (e.g., com.apple.mobilesafari) */244 bundle_id: string;245 /** Terminate the app if it is already running before launching */246 terminate_running?: boolean;247}248```249250## ๐ก Use Case: QA Step via MCP Tool Calls251252This MCP server allows AI assistants integrated with a Model Context Protocol (MCP) client to perform Quality Assurance tasks by making tool calls. This is useful immediately after implementing features to help ensure UI consistency and correct behavior.253254### How to Use255256After a feature implementation, instruct your AI assistant within its MCP client environment to use the available tools. For example, in Cursor's agent mode, you could use the prompts below to quickly validate and document UI interactions.257258### Example Prompts259260- **Verify UI Elements:**261262 ```263 Verify all accessibility elements on the current screen264 ```265266- **Confirm Text Input:**267268 ```269 Enter "QA Test" into the text input field and confirm the input is correct270 ```271272- **Check Tap Response:**273274 ```275 Tap on coordinates x=250, y=400 and verify the expected element is triggered276 ```277278- **Validate Swipe Action:**279280 ```281 Swipe from x=150, y=600 to x=150, y=100 and confirm correct behavior282 ```283284- **Detailed Element Check:**285286 ```287 Describe the UI element at position x=300, y=350 to ensure proper labeling and functionality288 ```289290- **Show Your AI Agent the Simulator Screen:**291292 ```293 View the current simulator screen294 ```295296- **Take Screenshot:**297298 ```299 Take a screenshot of the current simulator screen and save it to my_screenshot.png300 ```301302- **Record Video:**303304 ```305 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`)306 ```307308- **Stop Recording:**309310 ```311 Stop the current simulator screen recording312 ```313314- **Install App:**315316 ```317 Install the app at path/to/MyApp.app on the simulator318 ```319320- **Launch App:**321 ```322 Launch the Safari app (com.apple.mobilesafari) on the simulator323 ```324325## Prerequisites326327- Node.js328- macOS (as iOS simulators are only available on macOS)329- [Xcode](https://developer.apple.com/xcode/resources/) and iOS simulators installed330- Facebook [IDB](https://fbidb.io/) tool [(see install guide)](https://fbidb.io/docs/installation)331332## Installation333334This section provides instructions for integrating the iOS Simulator MCP server with different Model Context Protocol (MCP) clients.335336### Installation with Cursor337338Cursor manages MCP servers through its configuration file located at `~/.cursor/mcp.json`.339340#### Option 1: Using NPX (Recommended)3413421. Edit your Cursor MCP configuration file. You can often open it directly from Cursor or use a command like:343 ```bash344 # Open with your default editor (or use 'code', 'vim', etc.)345 open ~/.cursor/mcp.json346 # Or use Cursor's command if available347 # cursor ~/.cursor/mcp.json348 ```3492. Add or update the `mcpServers` section with the iOS simulator server configuration:350 ```json351 {352 "mcpServers": {353 // ... other servers might be listed here ...354 "ios-simulator": {355 "command": "npx",356 "args": ["-y", "ios-simulator-mcp"]357 }358 }359 }360 ```361 Ensure the JSON structure is valid, especially if `mcpServers` already exists.3623. Restart Cursor for the changes to take effect.363364#### Option 2: Local Development3653661. Clone this repository:367 ```bash368 git clone https://github.com/joshuayoes/ios-simulator-mcp369 cd ios-simulator-mcp370 ```3712. Install dependencies:372 ```bash373 npm install374 ```3753. Build the project:376 ```bash377 npm run build378 ```3794. Edit your Cursor MCP configuration file (as shown in Option 1).3805. Add or update the `mcpServers` section, pointing to your local build:381 ```json382 {383 "mcpServers": {384 // ... other servers might be listed here ...385 "ios-simulator": {386 "command": "node",387 "args": ["/full/path/to/your/ios-simulator-mcp/build/index.js"]388 }389 }390 }391 ```392 **Important:** Replace `/full/path/to/your/` with the absolute path to where you cloned the `ios-simulator-mcp` repository.3936. Restart Cursor for the changes to take effect.394395### Installation with Claude Code396397Claude Code CLI can manage MCP servers using the `claude mcp` commands or by editing its configuration files directly. For more details on Claude Code MCP configuration, refer to the [official documentation](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp).398399#### Option 1: Using NPX (Recommended)4004011. Add the server using the `claude mcp add` command:402 ```bash403 claude mcp add ios-simulator npx ios-simulator-mcp404 ```4052. Restart any running Claude Code sessions if necessary.406407#### Option 2: Local Development4084091. Clone this repository, install dependencies, and build the project as described in the Cursor "Local Development" steps 1-3.4102. Add the server using the `claude mcp add` command, pointing to your local build:411 ```bash412 claude mcp add ios-simulator -- node "/full/path/to/your/ios-simulator-mcp/build/index.js"413 ```414 **Important:** Replace `/full/path/to/your/` with the absolute path to where you cloned the `ios-simulator-mcp` repository.4153. Restart any running Claude Code sessions if necessary.416417## Configuration418419### Environment Variables420421| Variable | Description | Example |422| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |423| `IOS_SIMULATOR_MCP_FILTERED_TOOLS` | A comma-separated list of tool names to filter out from being registered. | `screenshot,record_video,stop_recording` |424| `IOS_SIMULATOR_MCP_DEFAULT_OUTPUT_DIR` | Specifies a default directory for output files like screenshots and video recordings. If not set, `~/Downloads` will be used. This can be handy if your agent has limited access to the file system. | `~/Code/awesome-project/tmp` |425| `IOS_SIMULATOR_MCP_IDB_PATH` | Specifies a custom path to the IDB executable. If not set, `idb` will be used (assuming it's in your PATH). Useful if IDB is installed in a non-standard location. | `~/bin/idb` or `/usr/local/bin/idb` |426427#### Configuration Example428429```json430{431 "mcpServers": {432 "ios-simulator": {433 "command": "npx",434 "args": ["-y", "ios-simulator-mcp"],435 "env": {436 "IOS_SIMULATOR_MCP_FILTERED_TOOLS": "screenshot,record_video,stop_recording",437 "IOS_SIMULATOR_MCP_DEFAULT_OUTPUT_DIR": "~/Code/awesome-project/tmp",438 "IOS_SIMULATOR_MCP_IDB_PATH": "~/bin/idb"439 }440 }441 }442}443```444445## MCP Registry Server Listings446447<a href="https://glama.ai/mcp/servers/@joshuayoes/ios-simulator-mcp">448 <img width="380" height="200" src="https://glama.ai/mcp/servers/@joshuayoes/ios-simulator-mcp/badge" alt="iOS Simulator MCP server" />449</a>450451[](https://mseep.ai/app/joshuayoes-ios-simulator-mcp)452453## License454455MIT456
Full transparency โ inspect the skill content before installing.