Codex
Add Mobster to Codex with codex mcp add. Codex gets a headless iOS simulator and your iPhone, says what must be true, and gets a verdict checked in code.
codex mcp add mobster -- \
/Applications/Mobster.app/Contents/MacOS/mobster-agent mcpcodex mcp add mobster -- /Applications/Mobster.app/Contents/MacOS/mobster-agent mcpCodex builds iOS apps from the terminal, and OpenAI’s Build iOS Apps plugin lets it drive the result on a simulator through XcodeBuildMCP. The Mobster MCP server adds taps and screen reads on your iPhone, and a verdict. Codex states what must be true, drives the app on a headless simulator or an iPhone over USB through the Mobster tools, and gets a verdict and a report with frames when available. Mobster checks declared assertions. Use the plugin on the simulator. Add Mobster when the app has to run on your iPhone, or when a check has to pass on declared assertions and run again in CI.
You need an Apple silicon Mac with macOS 13 or later and Xcode with an iOS Simulator runtime. A real iPhone also needs Developer Mode and the WebDriverAgent runner, set up in Mobster for Mac (Device setup). To set up your iPhone and to build and test your own app, you need the macOS your Xcode version needs (Apple lists it on its Xcode page).
Add the server
In Mobster for Mac, open Settings › Connectors › Use Mobster from… and press Add next to Codex. It runs codex mcp add for you, and when the app holds your model key it passes the app’s settings file with --env-file, so Smart uses the same key.
By hand:
codex mcp add mobster -- /Applications/ Mobster.app/ Contents/ MacOS/ mobster-agent mcpThat writes a block to ~/, which the Codex CLI, the IDE extension and the ChatGPT desktop app share. You can write the block yourself instead:
[mcp_servers.mobster]command = "/ Applications/ Mobster.app/ Contents/ MacOS/ mobster-agent"args = ["mcp"]A trusted project can carry its own .codex/ with the same block, so everyone on the project gets the server.
Timeouts: Codex gives each tool call 60 seconds by default (tool_timeout_sec) and each server 10 seconds to start (startup_timeout_sec). Every Mobster call returns within 45 seconds and wait within 50, so the defaults hold. Work that takes longer, such as the first simulator boot or a Smart run, continues under a run_id that Codex polls with wait. For more margin:
[mcp_servers.mobster]command = "/ Applications/ Mobster.app/ Contents/ MacOS/ mobster-agent"args = ["mcp"]tool_timeout_sec = 120Key-less checks need no key: Codex drives with its own model, and Mobster judges. For Smart, where Mobster runs the steps itself on your OpenAI or Anthropic key, add your env file to the arguments. Mobster expands the ~ itself:
args = ["mcp", "--env-file", "~/ .config/ mobster/ agent.env"]Check it’s connected
In the codex TUI, /mcp lists your active MCP servers and their tools. From the shell, codex mcp list shows the same. Then ask:
Call mobster's status tool and summarize it.status names the Mobster version, the simulator setup, whether Smart is on (and why not, when it’s off) and where runs go.
A first check: the count after a task is done
Say your app has a task list. A good first prompt for Codex:
Verify that marking a task done in my app takes the count from 3 to 2 tasks left.Codex builds your app for the simulator, then makes these calls, the key-less form of a task check:
{"tool": "verify_start", "arguments": { "app_path": "/ abs/ path/ YourApp/ .mobster/ build/ Build/ Products/ Debug-iphonesimulator/ YourApp.app", "launch_args": ["-SkipOnboarding", "YES"], "launch_env": {"SEED_TASKS": "3"}, "open_url": "yourapp://tasks", "steps": ["Tap the first task to mark it done."], "expect": [{"visible": {"id": "task_1", "selected": true}}, {"value": {"id": "done_count"}, "equals": 1}, {"value": {"id": "tasks_left"}, "equals": 2}]}}{"tool": "tap", "arguments": {"run_id": "…", "target": {"id": "task_1"}}}{"tool": "verify_finish", "arguments": {"run_id": "…"}}It passes when the remaining count falls to two. When the task is ticked and the count stays at three, verify_finish fails with value id=tasks_left == 2 failed: was "3 tasks left". That is the bug a screenshot glance misses and an assertion catches. verify_finish also returns the path to the run’s one-file HTML report and the overlay frame.
app_path must be absolute. Clients start servers in different folders, so Mobster refuses a relative path. Test your iOS app with Codex covers the loop, saving checks and rerunning them in scripts.
Put the rule in AGENTS.md
Codex reads AGENTS.md. Add the rule with your scheme and app names:
## Verifying UI changesAfter you change a screen in this iOS app, verify it before you say it works.1. Build for the simulator: xcodebuild -scheme <Scheme> -destination 'generic/ platform=iOS Simulator' -derivedDataPath .mobster/ build CODE_SIGNING_ALLOWED=NO build2. Call mobster's verify_start with app_path set to the absolute path of .mobster/ build/ Build/ Products/ Debug-iphonesimulator/ <App>.app, the steps in plain English, and expect: what must be true when the steps are done.3. Drive with screen, tap, type_text and swipe, then call verify_finish.4. If the verdict is failed, fix the code and verify again. Report the verdict and the report path.Use a real iPhone
list_devices names every device Mobster can use. It lists USB iPhones set up for it, the simulators it manages and WebDriverAgent addresses. Called with device and no run_id, the phone tools drive that device directly, outside a check. The server takes the device’s lock. stop with the device, or 90 idle seconds, releases it for the Mac app and other commands.
Codex approves a tool, not a device: allowing tap on a simulator allows it on your phone. Keep the server to the phones you choose:
[mcp_servers.mobster]command = "/ Applications/ Mobster.app/ Contents/ MacOS/ mobster-agent"args = ["mcp", "--allow-device", "Test iPhone"]Any other real device is listed as not_allowed and refused. Simulators are always allowed.
Codex’s default_tools_approval_mode decides when it asks. With writes, it prompts for every tool that isn’t marked read-only. Mobster marks status, screen, list_devices, wait, wait_for, read_notifications and unlock_status as read-only in its MCP annotations, so Codex reads the screen freely and asks before tap, type_text, swipe and the rest. The server’s instructions also tell Codex to ask you before anything that sends, buys, posts or deletes on a real iPhone. A locked phone fails the call at once with “Your iPhone is locked. Unlock it and try again. No action was taken.”
Troubleshooting
| Symptom | Fix |
|---|---|
/mcp doesn’t show mobster | Check the block in ~/. A project’s .codex/ loads only in a trusted project |
| Codex says the server didn’t start in time | startup_timeout_sec defaults to 10 seconds. Raise it in the block, for example to 30 |
The first verify_start returns status: "preparing" | The simulator is booting and WebDriverAgent is building. Codex calls wait |
verify_start has no smart argument | Smart is off. status says why: no key, a missing env file, or --keyless |
couldnt_run | Read reason.class and reason.fix in the result. Checks lists every class |
The MCP reference has every tool, and Checks the assertion language.
Questions
Is Codex's default tool timeout long enough for Mobster?
Yes. Codex allows 60 seconds per tool call by default, and every Mobster call returns within 45 seconds, wait within 50. Longer work continues under a run_id that Codex polls with wait. Set tool_timeout_sec = 120 if you want more margin.
Where does Codex keep the Mobster server config?
In ~/.codex/config.toml by default, which the Codex CLI, the IDE extension and the ChatGPT desktop app share. A trusted project can also have its own .codex/config.toml.
Can Codex skip approval for the read-only Mobster tools?
Yes. With default_tools_approval_mode set to writes, Codex prompts only for tools that aren't marked read-only. Mobster marks status, screen, list_devices, wait and its other read tools as read-only, so Codex asks before a tap and not before a screen read.
Does Codex have an iOS simulator?
Through a plugin. OpenAI's Build iOS Apps plugin uses XcodeBuildMCP to build, launch and drive your app on a simulator. The Mobster MCP server gives Codex a headless simulator, taps and screen reads on your iPhone over USB, each screen as a list of controls by name, and a verdict from the assertions you declared.
Sources
Codex’s logo is a trademark of OpenAI, shown only to name the product. Mobster isn’t affiliated with or endorsed by OpenAI.