Migration from v1
Upgrading from MobileBuildMCP 1.x to 2.x. Two breaking changes; most users only need the first.
The short version
1. Append mcp to your server launch command
MobileBuildMCP 2.x is a CLI first. To start the MCP server you must pass the mcp subcommand:
# v1.x
npx -y mobilebuildmcp@latest
# v2.x
npx -y mobilebuildmcp@latest mcpIf you added the server via a CLI command, remove and re-add:
# Claude Code
claude mcp remove MobileBuildMCP
claude mcp add MobileBuildMCP -- npx -y mobilebuildmcp@latest mcp
# Codex CLI
codex mcp remove MobileBuildMCP
codex mcp add MobileBuildMCP -- npx -y mobilebuildmcp@latest mcpIf you manage the config file directly, add "mcp" as the last entry in the args array.
2. Check your workflow configuration
In v1.x, all workflows loaded by default. v2.x defaults to loading only the simulator workflow to keep the agent's tool schema footprint small.
Already set enabledWorkflows or MOBILEBUILDMCP_ENABLED_WORKFLOWS? Nothing changes.
Relied on the default? Your agent will now only see simulator tools until you opt in to additional workflows:
# .mobilebuildmcp/config.yaml
schemaVersion: 1
enabledWorkflows:
- simulator
- ui-automation
- debuggingSee Workflows for the full list.
Detailed reference
MCP server launch requires the mcp subcommand
Wherever your v1.x setup invoked mobilebuildmcp (or npx -y mobilebuildmcp@latest), append mcp so the final token is mcp.
Common config file locations:
| Client | File |
|---|---|
| Claude Code | ~/.claude.json |
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Cursor (project) | .cursor/mcp.json |
| Cursor (global) | ~/.cursor/mcp.json |
| VS Code (project) | .vscode/mcp.json |
| VS Code (global) | ~/Library/Application Support/Code/User/mcp.json |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| Trae | ~/Library/Application Support/Trae/User/mcp.json |
| Codex CLI | ~/.codex/config.toml |
JSON example:
"MobileBuildMCP": {
"command": "npx",
"args": ["-y", "mobilebuildmcp@latest", "mcp"]
}TOML example (Codex CLI):
[mcp_servers.MobileBuildMCP]
command = "npx"
args = ["-y", "mobilebuildmcp@latest", "mcp"]Why default workflows changed
In v1.x, all workflows loaded by default, exposing 70+ tools. Every tool definition and its schema is sent to the LLM on each turn, consuming context window space throughout the session. While most providers cache these tokens to reduce re-inference cost, they still occupy context that could otherwise be used for your code and conversation.
v2.x defaults to the simulator workflow. Other workflows (ui-automation, debugging, device, macos, swift-package, and more) are opt-in. Enable only what you need, when you need it.
Enabling additional workflows
Config file (recommended):
schemaVersion: 1
enabledWorkflows:
- simulator
- device
- macos
- ui-automation
- debugging
- swift-packageEnvironment variable:
"MobileBuildMCP": {
"command": "npx",
"args": ["-y", "mobilebuildmcp@latest", "mcp"],
"env": {
"MOBILEBUILDMCP_ENABLED_WORKFLOWS": "simulator,device,macos,ui-automation,debugging,swift-package"
}
}New in v2: CLI and skills
CLI mode
The same mobilebuildmcp binary is now a CLI first. You can invoke tools directly:
npm install -g mobilebuildmcp@latest
mobilebuildmcp tools
mobilebuildmcp simulator build-and-run --scheme MyApp --project-path ./MyApp.xcodeproj
mobilebuildmcp simulator screenshot
mobilebuildmcp ui-automation snapshot-ui --simulator-id <UDID>
mobilebuildmcp ui-automation tap --simulator-id <UDID> --element-ref e12See CLI for the full guide.
MCP vs CLI for agents
The MCP server remains the recommended way to use MobileBuildMCP with an agent. The CLI is provided as an alternative for scripting, CI, and direct terminal use.
Why MCP is preferred:
- Automatic tool discovery: tools are registered with the agent at session start.
- Session defaults: the server maintains stateful defaults across tool calls, so the agent doesn't re-supply project details on every invocation. Significantly reduces errors.
- Stateful operations: log capture, debugging sessions, and other long-running operations are managed by the server.
The CLI avoids the per-turn context cost of MCP tool definitions, but loses session defaults and forces the agent to pass every parameter on every call. In practice, agents use MCP more reliably.
Agent skills
v2 introduces two optional agent skills that prime the agent with usage conventions:
- CLI Skill: strongly recommended when using the CLI with an agent.
- MCP Skill: optional when using the MCP server.
Install:
mobilebuildmcp initSee Agent Skills for flags and supported clients.
New in v2: project config
v2 adds support for a project-local config file at .mobilebuildmcp/config.yaml. It replaces the need for scattered environment variables and gives you deterministic, repo-scoped behavior. Env vars still work but the config file takes precedence.
schemaVersion: 1
enabledWorkflows: ["simulator", "debugging"]
sessionDefaults:
workspacePath: ./MyApp.xcworkspace
scheme: MyApp
simulatorName: iPhone 17 ProCreate or update it interactively:
mobilebuildmcp setupSee Configuration for the full schema.