# simpilot **Autopilot your iOS Simulator from Claude Code.** simpilot is an [MCP server](https://modelcontextprotocol.io/) that gives Claude Code full control over iOS Simulators — tap buttons, type text, swipe, read the UI tree, take screenshots, and record videos. All from natural language. ``` You: "Open the app, tap Sign In, type my email, and screenshot the result" Claude: *does it* ``` ## How it works ``` Claude Code ←MCP/HTTP→ simpilot ←HTTP→ WebDriverAgent ←XCTest→ Simulator ←simctl→ screenshots, video, device mgmt ``` - **WebDriverAgent** (Appium) runs on the simulator and exposes UI automation via HTTP - **simctl** handles device management, screenshots, and video recording - **simpilot** wraps both into 21 MCP tools that Claude Code can call ## Quick start ### Prerequisites - macOS with Xcode installed - Python 3.10+ - An iOS Simulator (Xcode → Window → Devices and Simulators) ### Setup & Run ```bash git clone https://github.com/passerby2049/simpilot.git cd simpilot ./start.sh ``` `start.sh` automatically creates the Python venv, installs dependencies, and clones WebDriverAgent on first run. That's it. The script starts the MCP server and auto-registers with Claude Code: ``` ✓ MCP server http://127.0.0.1:8585/mcp ✓ Claude Code registered Claude will handle the rest: boot sim → start WDA → automate. ``` Open Claude Code and tell it what to do — it will boot a simulator, start WebDriverAgent, and interact with your app automatically. ### Stop ```bash ./start.sh --stop # stops MCP server, unregisters from Claude Code ``` ### Manual registration If you prefer to register manually or don't have `claude` on PATH: ```bash claude mcp add simpilot --transport http http://127.0.0.1:8585/mcp ``` ## Tools (23) ### Device & WDA lifecycle | Tool | Description | |------|-------------| | `list_devices` | List all simulators and their state | | `boot_device` | Boot a simulator by UDID | | `shutdown_device` | Shutdown a simulator | | `start_wda` | Start WebDriverAgent on a simulator (builds if needed) | | `stop_wda` | Stop WebDriverAgent | | `launch_app` | Launch an app by bundle ID | | `terminate_app` | Terminate a running app | | `install_app` | Install a .app or .ipa | | `open_url` | Open a URL or deep link | | `set_clipboard` | Set the simulator's clipboard | ### UI automation | Tool | Description | |------|-------------| | `get_ui_tree` | Get the current screen's element tree (parsed, concise) | | `find_and_tap` | Find an element by text and tap it | | `tap` | Tap at screen coordinates | | `type_text` | Type into the focused text field | | `swipe` | Swipe from point A to point B | | `scroll_down` | Scroll down | | `scroll_up` | Scroll up | | `press_home` | Press the home button | ### Capture | Tool | Description | |------|-------------| | `screenshot` | Take a PNG screenshot (simctl) | | `wda_screenshot` | Take a screenshot via WDA | | `start_recording` | Start screen recording → MP4 | | `stop_recording` | Stop recording, save the video | | `wda_status` | Check if WDA is reachable | ## Usage with Claude Code Once registered, just talk naturally: ``` > Launch the Weather app and show me what's on screen > Tap the search bar, type "San Francisco", and tap the first result > Start recording, walk through the onboarding flow, then stop recording > Take a screenshot of every tab in my app ``` Claude calls `get_ui_tree` to understand the screen, then uses `find_and_tap`, `type_text`, etc. to interact — reading the element tree after each action to verify it worked. ## Stdio mode If you prefer stdio transport (e.g., for debugging or custom MCP clients): ```bash claude mcp add simpilot -- /path/to/simpilot/.venv/bin/python /path/to/simpilot/server.py ``` The server defaults to stdio when `--http` is not passed. ## Examples See [`examples/`](examples/) for scripted automation flows using simpilot's Python API directly. ## Architecture ``` server.py — MCP server (FastMCP), 23 tools, supports stdio + HTTP transport start.sh — Starts MCP server + auto-registers with Claude Code ``` Claude handles the full lifecycle through tools: `list_devices` → `boot_device` → `start_wda` → interact → `stop_wda`. **Dependencies:** - [FastMCP](https://github.com/jlowin/fastmcp) — MCP protocol (stdio + streamable-http) - [httpx](https://www.python-httpx.org/) — Async HTTP client for WDA - [WebDriverAgent](https://github.com/appium/WebDriverAgent) — UI automation (cloned locally) ## License MIT