Skip to content

VS Code

Add the Mobster MCP server to VS Code for GitHub Copilot's agent mode, in .mcp.json or .vscode/mcp.json. Only Claude Code and Codex are tested clients.

code --add-mcp "{\"name\":\"mobster\",\"command\":\"/Applications/Mobster.app/Contents/MacOS/mobster-agent\",\"args\":[\"mcp\"]}"

You can edit your SwiftUI views with GitHub Copilot’s agent mode in VS Code. Follow VS Code’s documented setup below to add the Mobster MCP server. The server’s tools run your app on a headless iOS simulator Mobster manages. The tools read each screen by element name. They also tap and type. Mobster checks your declared assertions. You get a verdict. The server also exposes tools to drive your iPhone plugged into your Mac.

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

VS Code reads two formats, and they differ in one word. Get the word wrong and the server never loads.

The portable format, which the MCP: Add Server command now prefers, goes in .mcp.json at the workspace root (for the project) or ~/.copilot/mcp-config.json (for you), under mcpServers:

{  "mcpServers": {    "mobster": {      "type": "stdio",      "command": "/Applications/Mobster.app/Contents/MacOS/mobster-agent",      "args": ["mcp"]    }  }}

The VS Code format goes in .vscode/mcp.json or your user profile, under servers. It still works, and the Add Server flow lists it as deprecated:

{  "servers": {    "mobster": {      "type": "stdio",      "command": "/Applications/Mobster.app/Contents/MacOS/mobster-agent",      "args": ["mcp"]    }  }}

VS Code’s field table marks type as required for a local server while its examples leave it out, so both blocks include it. From a terminal, this adds the server to your user profile:

code --add-mcp "{\"name\":\"mobster\",\"command\":\"/Applications/Mobster.app/Contents/MacOS/mobster-agent\",\"args\":[\"mcp\"]}"

VS Code’s docs say command must be on the system path or a full path, so the blocks use the agent’s full path.

Smart uses your OpenAI or Anthropic key to run the steps. To use Smart, add "--env-file", "~/.config/mobster/agent.env" after "mcp" in args. Mobster expands the ~. You do not need an API key for key-less checks. Your agent supplies the model access for this loop.

VS Code’s MCP pages don’t document a tool-call timeout. Mobster doesn’t rely on one: every call returns within 45 seconds and wait within 50, and slow work such as the first simulator boot continues under a run_id that Copilot polls with wait.

Check it’s connected

Run MCP: List Servers from the Command Palette. mobster should be running, and Show Output there has its log. A workspace server inherits Workspace Trust; a server from another source shows a trust dialog the first time it starts. Then ask Copilot in agent mode:

Call mobster's status tool and tell me what it says.

A first check: ticking a task enables Clear done

Say your app’s task list has a Clear done button that stays disabled until you mark a task done. A prompt that exercises a tap and a state change:

Build my app for the simulator and verify that tapping the first task in the list(yourapp://tasks) ticks it and enables the Clear done button.

Ask Copilot to call verify_start with the absolute app_path, open_url set to yourapp://tasks, the step, and expectations that can’t hold before the tap, such as:

[{"visible": {"id": "task_1", "selected": true}}, {"visible": {"id": "clear_done", "enabled": true}}]

Then ask Copilot to read the screen and tap by identifier:

{"tool": "tap", "arguments": {"run_id": "…", "target": {"id": "task_1"}}}

The response Tapped “Water the plants”; the screen changed. reports a screen change. Check the new outline for selected on the task. verify_finish checks the declared expectation. It returns a verdict and report, with an overlay frame when available. An expectation that already holds at launch can leave the run needs_review. Use one that only holds after the steps. AI end-to-end tests for iOS explains that rule.

Tell Copilot to verify every change

VS Code’s docs list .github/copilot-instructions.md or AGENTS.md as the project instruction files for the Copilot agent. Add:

## 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 shows every device Mobster can use. With a USB iPhone’s name as device and no run_id, screen, tap, type_text, swipe, alert, open_url, launch_app and home drive the phone directly. Mobster holds the phone’s lock until stop with the device, or 90 idle seconds.

VS Code asks before a tool runs, and lets you approve a single use, the session, the workspace or every future call. “Chat: Manage Tool Approval” can trust every tool from one server. Be careful with both on a server that can reach your phone: an approval covers a tool, not a device, so trusting tap for simulator work trusts it on your iPhone. Keep the server to the phones you choose:

"args": ["mcp", "--allow-device", "Test iPhone"]

The Mobster MCP annotations mark status, screen, list_devices, wait, wait_for, read_notifications and unlock_status as read-only and the rest as acting, and its instructions tell the agent to ask you before anything that sends, buys, posts or deletes on a real iPhone. A locked phone stops the call at once with “Your iPhone is locked. Unlock it and try again. No action was taken.”

Troubleshooting

SymptomFix
The server never appearsCheck the top-level key: servers in .vscode/mcp.json, mcpServers in .mcp.json and ~/.copilot/mcp-config.json
It appears but won’t startUse the full path /Applications/Mobster.app/Contents/MacOS/mobster-agent in command, then restart it from MCP: List Servers
Copilot says too many tools are enabledOne request can use at most 128 tools. Turn off the tools or servers you don’t need for that chat
The first verify_start returns status: "preparing"The simulator is booting and WebDriverAgent is building. Ask your agent to call wait
couldnt_runreason.class and reason.fix in the result say what to do (Checks)

Every tool is in the MCP reference.

Questions

  • Should Mobster go in .vscode/mcp.json or .mcp.json?

    Either works. VS Code's MCP: Add Server flow now prefers the portable .mcp.json at the workspace root, or ~/.copilot/mcp-config.json for your user, and labels .vscode/mcp.json deprecated. The two formats use different top-level keys, servers in .vscode/mcp.json and mcpServers in the portable files.

  • Does Mobster fit under VS Code's tool limit?

    VS Code allows at most 128 tools in one chat request. The server offers about two dozen, so it fits beside other servers. If a chat hits the limit, turn off the tools you don't need for it.

  • Where do I tell Copilot to verify UI changes?

    In .github/copilot-instructions.md or AGENTS.md, which VS Code's docs list as the project instruction files for the Copilot agent.

Sources

VS Code’s logo is a trademark of Microsoft, shown only to name the product. Mobster isn’t affiliated with or endorsed by Microsoft.