> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobster.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server for the iOS simulator and iPhone

> Use mobster mcp to let your coding agent check a screen, drive a simulator or your iPhone, and hand Mobster a whole task.

This page shows how the tools fit together. [MCP tools](https://docs.mobster.dev/reference/mcp-tools.md) lists each one with its arguments.

| To | Use | Section |
| - | - | - |
| Check a screen and get passed or failed | `verify_start`, the phone tools, `verify_finish` | [Check a screen with your agent's model](#check-a-screen-with-your-agents-model) |
| Have Mobster run the steps | `verify_start` with `smart` | [Let Mobster run the steps](#let-mobster-run-the-steps) |
| Run the saved checks, or test a pull request | `run_tests` | [Run your checks](#run-your-checks) |
| Drive a simulator or iPhone outside a check | the phone tools with `device` | [Drive a device directly](#drive-a-device-directly) |

## Add the server to your client

```sh theme={"theme":"css-variables"}
mobster mcp install --all
```

This adds the server to every agent it finds on this Mac. [Add Mobster to your agent](https://docs.mobster.dev/agents.md) has the steps for each client. A second run keeps each client's saved server options, such as `--allow-device`. An option you pass replaces its saved values, and `--reset-server-options` starts fresh.

### Set up a repository for your team

> [!NOTE]
>
> You get this in the next release, not in Mobster for Mac 0.4.0 or Mobster CLI 0.4.4.

Run `mobster mcp install` inside your app's git repository, with no client named. It writes the files your team commits, so every teammate's Claude Code and Cursor has Mobster when they open the repository. Codex reads the block in `AGENTS.md` but not these server entries, so each teammate runs `mobster mcp install codex`.

| File | For |
| - | - |
| `.mcp.json` | Claude Code |
| `.cursor/mcp.json` and `.cursor/rules/mobster.mdc` | Cursor |
| A block in `AGENTS.md`, or in `CLAUDE.md` when that is the only one | Every agent that reads it |
| `.claude/skills/ios-testing` and `.agents/skills/ios-testing` | The skill |

It ends with the line to commit:

```text theme={"theme":"css-variables"}
Commit these so your team's agents get the change: git add .mcp.json .cursor/mcp.json .claude/skills/ios-testing .agents/skills/ios-testing AGENTS.md .cursor/rules/mobster.mdc
```

* The entries run `mobster mcp` from `PATH`, never a path on your Mac, so they work on every teammate's Mac that has Mobster.
* `--env-file` and `--allow-device` are refused here, because they name a file and an iPhone of yours. Set them for yourself with `mobster mcp install <client> --env-file PATH --allow-device NAME`.
* A second run changes nothing, and `mobster mcp install --remove` takes every file and block out.

### Add it from Mobster for Mac

In Mobster for Mac, open Settings › Connectors › **Use Mobster from** and click **Add** next to Claude Code or Codex.

For Claude Code, **Add** installs the [Claude Code plugin](https://docs.mobster.dev/agents/plugin-and-skill.md) (next release), which brings the server with the mobster skill, the `/mobster:verify` and `/mobster:test-pr` commands, and the hooks that [replay your checks before Claude ends its turn](https://docs.mobster.dev/agents/plugin-and-skill.md#check-claudes-edits-before-its-turn-ends). It removes the server an earlier **Add** wrote, and **Remove** uninstalls the plugin. **Add** changes nothing and says why when:

* the `claude` command isn't on your Mac, or one of Claude Code's plugin commands fails.
* the earlier server limits Mobster with `--allow-device`, `--allow-testflight` or another option the plugin can't keep. The plugin reaches every iPhone Mobster sees, so to keep the limit, keep that server.
* Claude Code has the old `RadishSoftware/mobster` marketplace, also named `mobster`. Run `/plugin marketplace remove mobster` in Claude Code first.

For Codex, **Add** writes the same entry as `mobster mcp install`, with the agent inside the app as the command:

```json theme={"theme":"css-variables"}
{
  "mcpServers": {
    "mobster": {
      "command": "/Applications/Mobster.app/Contents/MacOS/mobster-agent",
      "args": ["mcp", "--packs", "all", "--env-file", "/Users/you/Library/Application Support/app.mobster.desktop/agent.env"]
    }
  }
}
```

* When the app holds your model key, **Add** passes `--env-file`, so [`smart` runs](#let-mobster-run-the-steps) use the same key. **Add** never writes the key into a client's config.
* **Add** keeps the phone and TestFlight limits you saved.
* Mobster refuses while macOS runs the app from a temporary copy, such as one opened from Downloads or the disk image. Move Mobster to Applications, open it from there and add it again.
* **Remove** takes out only the `mobster` entry. **Another agent** shows the command to add by hand. Claude and ChatGPT connect through Mobster Remote with **Copy URL**.

### Connect your own agent

Any SDK that speaks MCP over stdio connects to `mobster mcp`, including the Claude Agent SDK, the OpenAI Agents SDK, the Vercel AI SDK and LangChain. A check spans several calls on one server, from `verify_start` to `verify_finish`, so keep one MCP session open for the whole run. LangChain's `MultiServerMCPClient.get_tools()` starts a new server for each call, so load the tools from one `client.session()` instead.

Each answer comes as text and, for a client that reads it, as `structuredContent`. The structured result starts with `text`, the same sentence the text holds, so an agent that reads only `structuredContent`, such as Claude Code, still gets the verdict in words and the call to make next. A tool listed with an `outputSchema` answers exactly as its schema has it.

## Check a screen with your agent's model

Your agent drives the app with its own model. Mobster checks the declared assertions without a model or a key.

**1. Build for the simulator**

The agent builds your scheme with `xcodebuild … -destination 'generic/platform=iOS Simulator' -derivedDataPath .mobster/build CODE_SIGNING_ALLOWED=NO build`.

**2. Start**

`verify_start` takes the absolute `app_path`, the steps in plain English, and `expect`: the assertions Mobster checks. They're fixed now, before the agent touches the app. Mobster installs and launches the app and returns the first screen.

**3. Drive**

The agent reads the screen and acts with `screen`, `tap`, `type_text`, `swipe`, `alert`, `open_url` and `launch_app`. Each action returns the new screen.

**4. Finish**

`verify_finish` checks the assertions and returns `passed`, `failed`, `needs_review` or `couldnt_run`, the report's path and, when there is one, a frame of the screen.

**5. Fix and repeat**

On `failed`, the agent fixes the code, rebuilds and verifies again.

A check that Firefox's first bookmark opens its page, as tool calls:

```json theme={"theme":"css-variables"}
{"tool": "verify_start", "arguments": {
  "app_path": "/abs/path/to/Firefox.app",
  "steps": ["Tap Bookmarks.", "Tap the first bookmark."],
  "expect": [{"text": "mozilla.org"}]}}
{"tool": "tap", "arguments": {"run_id": "…", "target": {"label": "Bookmarks"}}}
{"tool": "tap", "arguments": {"run_id": "…", "ref": "e4"}}
{"tool": "verify_finish", "arguments": {"run_id": "…"}}
```

`screen` returns an outline with one line per element the agent can act on: a ref such as `e4`, its role, its label, its value and its `id`. A ref is good until the screen changes. After that, `tap` with an old ref says so, and the agent calls `screen` again. A `target` selector works in place of a ref when it matches exactly one element. `tap` answers `Tapped “Bookmarks”; the screen changed.` When the bookmark opens a blank page, `verify_finish` returns `failed` and names the assertion that didn't hold. The launch fields and the assertions are in [Checks](https://docs.mobster.dev/checks.md).

## Let Mobster run the steps

With your Claude or OpenAI key, `verify_start` with `smart: true` has Mobster run the steps while your agent waits for the verdict. Mobster checks the declared assertions, as in a key-less run. No model grades the outcome.

* `max_usd` defaults to 0.25 (at most 1.00) and `max_seconds` to 180 (at most 600). `expect` is optional.
* A run that finishes within 40 seconds returns its result. A longer one returns `{"status": "running", "run_id": …}`, and the agent calls `wait`.
* Mobster runs the steps on Claude Sonnet 5.5 when a Claude key is set, and on GPT-5.6 Sol with an OpenAI key alone. `MOBSTER_SMART_PROVIDER=openai` puts OpenAI first, and `MOBSTER_SMART_MODEL` picks another model. `mobster mcp --keyless` never offers `smart`.
* A `smart` run sends each screen's image and accessibility text to Anthropic or OpenAI. Key-less and launch-only runs send nothing anywhere.

Give the server your key in a file only you can read ([Add your key](https://docs.mobster.dev/agents.md#turn-on-smart)). `status` then names the model and whose key pays:

```text theme={"theme":"css-variables"}
Mobster 0.4.0. Smart: on (claude-sonnet-5-5, on the user's Anthropic key).
```

## Drive a device directly

The phone tools (`screen`, `tap`, `type_text`, `swipe`, `hold_point`, `flick_point`, `drag_point`, `alert`, `open_url`, `wait_for`, `launch_app`, `home` and `stop`) take `run_id` or `device`. With `device` and no `run_id`, they drive that device outside a check: a USB iPhone set up in Mobster for Mac, a Mobster simulator, or a WebDriverAgent address, as `list_devices` names them. With neither, they drive [your own simulator](#run-several-agents-on-one-mac).

* Mobster takes the device's lock on the first call, so no other Mobster window or command drives it meanwhile. `stop` with the `device`, or 90 idle seconds, releases it.
* A direct session has no verdict, so `verify_finish` and `save_check` refuse it.
* Your iPhone's frames go to `runs/` in the Mobster data folder, outside the repository, unless `--out` or `$MOBSTER_RUNS_DIR` names another folder.

`verify_start` takes `device` too. On a USB iPhone, it runs an app already installed there (`bundle_id`, not `app_path`) with `reset` `none`, because Mobster never clears an app's data on a phone. The phone tools then ask in Mobster as they do in a direct session ([Keep your iPhone safe](#keep-your-iphone-safe)). `mobster mcp --device` sets the default device for `verify_start` and the phone tools.

## Run several agents on one Mac

Each MCP client runs its own `mobster mcp`, and each server leases its own simulator on the first phone tool called with no `run_id` and no `device`. You never name a UDID.

* The simulator is yours until the client disconnects, you call `stop` with its `device`, or it sits idle for 30 minutes. `list_devices` marks it `yours`.
* A second client gets a second simulator, up to `MOBSTER_MAX_SIMS` (default 4) and the Mac's free memory ([Memory](https://docs.mobster.dev/simulators.md#memory)).
* When none is free, the call returns at once and names who holds each simulator. It doesn't queue.
* Mobster waits to boot or build while the Mac's load is at or above one task per core, and says so. It refuses after 30 seconds.

`mobster sim list` shows who holds each simulator. `mobster sim release --all-mine` asks the agents started from your app to let go.

## Keep your iPhone safe

> [!WARNING]
>
> On a real iPhone the phone tools act for real: a tap on Send sends. Your client approves a tool, not a device, so allowing `tap` for simulator work allows it on your phone too.

* **Name the phones a server may drive.** With `--allow-device`, Mobster lists any other real iPhone as `not_allowed` and refuses it. Simulators are always allowed.

  ```sh theme={"theme":"css-variables"}
  mobster mcp install --all --allow-device "Test iPhone"
  ```

* **New apps ask first.** Any tool, `screen` included, in an app Mobster hasn't used before shows **Allow Mobster to use …?** in Mobster for Mac and waits. Until you allow it, the phone goes Home and the tool says why.

* **Commits ask every time.** A tap or Return that sends, buys, posts or deletes, a one-time code, `use_code` and a link that asks show the approval card in Mobster. The call waits up to 38 seconds for your answer, and calling it again keeps waiting. Your agent can't answer the card ([Who answers](https://docs.mobster.dev/safety.md#who-answers)).

* **Each tool says what it does.** Read-only tools are marked read-only and tools that act on a device are marked destructive, so a client that asks before such calls asks for these.

* **Screen text is data.** The server tells your agent that text on the screen comes from the app, never instructions, and to ask you before anything that sends, buys, posts or deletes.

* **Mobster doesn't unlock iPhones.** On a locked phone, a call fails at once with `Your iPhone is locked. Unlock it and try again. No action was taken.` Face ID, a locked app and an App Store confirmation stop the same way.

* **A saved check names only a simulator.** A check file in a repository never drives someone's phone. `mobster verify --check FILE --device NAME` runs it on a real device.

## Run your checks

`run_tests` runs the checks in your project's `.mobster/checks` the way [`mobster test`](https://docs.mobster.dev/testing) does: on the simulators Mobster manages, with retries and flaky detection. It writes `junit.xml`, `results.json` and an HTML report to `.mobster/test-results/<suite-id>/`.

* A suite that outlasts the call answers with its `suite_id`. Call `run_tests {suite_id}` to wait for it.
* Launch-only checks need no key. A check with steps needs a model key until it has passed once, then replays its approved steps. A changed screen can need a model call to heal. `fresh: true` records the steps again, and `no_heal: true` fails a check whose screen changed instead of healing it.
* `review_heals` lists the healed steps waiting for you to accept or reject. `save_check` turns a finished run, or a task from Mobster for Mac, into a check file.
* `failed: true` (next release) runs only the checks that didn't pass in the project's newest finished run ([Tags and shards](https://docs.mobster.dev/testing.md#tags-and-shards)).
* `run_tests` also takes `locales` and `a11y`. `test_history`, `import_maestro`, `test_schedule` and `compare_test_suites` read results, turn Maestro flows into checks, run the nightly suite and compare two suites.

`run_tests` with `pr: true` tests what the branch changed ([Test a pull request](https://docs.mobster.dev/testing.md#test-a-pull-request)). It picks the checks that cover the changed screens, drafts one for each changed screen none covers, builds the app and runs them. When it picks no check and the branch changed a file that feeds the app, it runs every check. It runs on a real iPhone only when the server's `--allow-device` names it, and on a TestFlight build only when `--allow-testflight` names the app too:

```sh theme={"theme":"css-variables"}
mobster mcp install claude-code --allow-device "Test iPhone" --allow-testflight com.example.yourapp
```

## Use more phone tools

Each works on a device driven directly (`device`) or in a check (`run_id`).

| Tool | What it does | What it never does |
| - | - | - |
| [`use_code`](https://docs.mobster.dev/reference/mcp/devices#use_code) | Types a sign-in code the phone received in the last 10 minutes into the code field | Show your agent the code, or type into anything but a code field |
| [`read_notifications`](https://docs.mobster.dev/reference/mcp/devices#read_notifications) | Reads up to 30 rows from Notification Center, codes masked | Tap a notification, or show apps kept from outside agents |
| [`set_clipboard`](https://docs.mobster.dev/reference/mcp/devices#set_clipboard) | Puts up to 64 KB of text, or a picture, on the clipboard | Read the clipboard. No tool does |
| [`open_url`](https://docs.mobster.dev/reference/mcp/screen#open_url) | Opens a link or deep link in one call (`yourapp://settings`). With `app` and `query`, it lists the links Mobster keeps | Open `tel:`, `sms:`, `mailto:` or another app's link on a real iPhone without asking you ([Links](https://docs.mobster.dev/safety.md#links)) |
| [`alert`](https://docs.mobster.dev/reference/mcp/screen#alert) | Accepts or dismisses an iOS alert, by button name | Grant a privacy permission on a real iPhone |
| [`hold_point`](https://docs.mobster.dev/reference/mcp/screen#hold_point), [`flick_point`](https://docs.mobster.dev/reference/mcp/screen#flick_point), [`drag_point`](https://docs.mobster.dev/reference/mcp/screen#drag_point) | One gesture at a point on the last screenshot, on a direct session | Repeat a gesture whose answer was lost, or cross a switch, a field or a send control |
| [`press_button`](https://docs.mobster.dev/reference/mcp/screen#press_button), [`set_display`](https://docs.mobster.dev/reference/mcp/screen#set_display) | Home, volume and lock. Light or dark, and orientation | Unlock the phone after `lock` |
| [`install_app`](https://docs.mobster.dev/reference/mcp/devices#install_app) | Installs a signed `.app` or `.ipa` from an absolute path | Install from a link |
| [`expo_preview`](https://docs.mobster.dev/reference/mcp/screen#expo_preview), [`expo_reload`](https://docs.mobster.dev/reference/mcp/screen#expo_reload) | Opens and reloads an Expo app from Metro, with Metro's error, file and line when it can't bundle ([Expo and React Native](https://docs.mobster.dev/dev/expo.md)) | Open a React Native app without Expo |
| [`device_status`](https://docs.mobster.dev/reference/mcp/devices#device_status), [`listen`](https://docs.mobster.dev/reference/mcp/devices#listen), [`ios_docs`](https://docs.mobster.dev/reference/mcp/devices#ios_docs) | Battery and heat. What the iPhone plays, as text (Watch and hear). How iOS itself works | Tap anything |

`mobster mcp --allow-files` adds `list_files`, `put_file`, `get_file` and `send_media`, and `--allow-photos` adds `pull_media` ([Files](https://docs.mobster.dev/files.md#mcp)). Without the flags they aren't listed.

## Wait for long work

Every tool call returns within 45 seconds, and `wait` within 50, so no client's tool timeout cuts one off. Longer work carries on under a `run_id`:

* The first run on a Mac creates the simulator, boots it and builds WebDriverAgent. `verify_start` returns `status: "preparing"`, and the agent calls `wait`. `mobster sim doctor --fix` does this ahead of time.
* One run is open at a time per server. The server stops a key-less run idle for 15 minutes, and any run ends after 60 minutes. When the client disconnects, the server stops its open run and exits.

## Reconnect after an update

A server your client started before an update keeps running the old files. A failing tool then says `Mobster was updated after this server started. Reconnect it: run /mcp in Claude Code, or restart your agent app.` Reconnect, and the client starts the new server.

## Find a run's files

Runs go to `--out`, else `$MOBSTER_RUNS_DIR`, else `.mobster/runs` in the folder your client starts the server in, or `runs/` in the Mobster data folder when that folder is `/` or your home folder. Saved checks go to `checks/` beside it. Each run folder holds `report.html`, `result.json`, the frames and the run's check ([The run folder](https://docs.mobster.dev/checks.md#the-run-folder)).

Mobster records each direct action in the run's `actions.jsonl` before it acts. An action that fails or times out is recorded as `unknown`. Don't repeat it: look at the device first.

`app_path` must be absolute, because clients start servers in different folders. [`mobster mcp`](https://docs.mobster.dev/reference/cli/mcp) lists the server's flags.

## Next

> [card] [MCP tools](https://docs.mobster.dev/reference/mcp-tools.md)
>
> Every tool, its arguments, and whether it acts on a device.

> [card] [Checks](https://docs.mobster.dev/checks.md)
>
> Assertions, selectors and the run folder.

> [card] [Connectors](https://docs.mobster.dev/connectors.md)
>
> Connect Mobster to other MCP servers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.