MobileBuildMCP
- Type
- MCP server
- Scanned
- Nov 13, 2026
- Version
- 2998ac77ebbc
- Files read
- 1815
MobileBuildMCP lets AI coding assistants build, test, debug, and automate apps for iOS, macOS, and other Apple platforms using Xcode and device simulators. The biggest risk is that a tricked AI assistant can pass custom build options to Xcode that run arbitrary commands on your Mac, or save those options to your project files so they run again later.
What it can reach
- Files
- Reads and writes Xcode project files, tool configuration (.mobilebuildmcp/config.yaml), AI assistant instruction and skill files, screenshots, video recordings, and build logs in ~/Library/Developer/MobileBuildMCP, temporary folders, and user-specified paths.
- Network
- Sends error and performance telemetry to Sentry by default unless disabled, downloads project templates, release info, and optional helper scripts from GitHub, and fetches remote packages during Xcode or Swift builds.
- Shell commands
- Runs Apple developer tools and local Mac commands (such as xcodebuild, swift, lldb, AppleScript, curl, kill, and package managers) to compile code, debug programs, and manage processes.
- System
- Controls Apple simulators and connected devices, installs and launches apps on devices and macOS, captures screenshots and video, simulates taps and keystrokes, attaches a debugger to running Mac processes, and connects to a running Xcode app.
Findings
-
HighUnfiltered extraArgs in Xcode build tools allows arbitrary host command execution
Default-enabled MCP tools such as build_sim, build_run_sim, and test_sim (as well as get_mac_app_path via resolveAppPathFromBuildSettings) forward caller-supplied extraArgs directly to xcodebuild without filtering. Because xcodebuild accepts KEY=VALUE build-setting overrides on the command line, a prompt-injected agent can override toolchain executables such as CC, LD, SWIFT_EXEC, or CODESIGN (or redirect output paths with -derivedDataPath, -resultBundlePath, or -xcconfig) to run arbitrary binaries on the host Mac, and can even persist malicious extraArgs or out-of-workspace projectPath values to .mobilebuildmcp/config.yaml via session_set_defaults with persist=true.
Fix: Allowlist safe xcodebuild flags in extraArgs, reject KEY=VALUE overrides for toolchain executables and -xcconfig or path-redirecting flags, and restrict session_set_defaults project paths to the workspace unless confirmed by the user.
-
MediumCode and build-setting injection in project scaffolding parameters
src/mcp/tools/project-scaffolding/scaffold_ios_project.ts:68
In both scaffold_ios_project.ts and scaffold_macos_project.ts, only projectName is validated while deploymentTarget, displayName, bundleIdentifier, marketingVersion, and currentProjectVersion accept arbitrary text. updatePackageSwiftFile splices deploymentTarget.split('.')[0] directly into Package.swift (which Swift and Xcode compile and execute on the host during package resolution or builds), and updateXCConfigFile writes displayName and other fields directly into .xcconfig where embedded newlines can inject build settings such as CC or SWIFT_EXEC.
Fix: Validate deploymentTarget as digits and dots only, validate bundleIdentifier as a strict reverse-DNS identifier, and reject newlines or control characters in displayName, marketingVersion, and currentProjectVersion.
-
LowSimulator debugger attach tool can attach to arbitrary host macOS processes by PID
src/mcp/tools/debugging/debug_attach_sim.ts:164
When debug_attach_sim is called with bundleId, it resolves the process inside the target simulator via simctl spawn launchctl list. When pid is provided instead, it skips simulator verification and passes the raw PID to debuggerManager.createSession, where both DapBackend.attach (which ignores simulatorId) and LldbCliBackend.attach attach lldb-dap or lldb directly to that host PID. When the debugging workflow is enabled, a prompt-injected agent can attach to any debuggable user process on the Mac to inspect variables and memory or execute LLDB commands.
Fix: Verify that any caller-supplied pid belongs to a process running inside the specified simulator before attaching LLDB or lldb-dap.
-
LowXcode Swift Macro validation is unconditionally disabled on all builds and tests
executeXcodeBuildCommand appends -skipMacroValidation to every xcodebuild command with no configuration option to keep validation enabled. Swift Macros are host executables compiled and run on the developer's Mac at build time; Xcode normally blocks unapproved macros in third-party Swift Package dependencies until trusted. With -skipMacroValidation hardcoded, building or testing an untrusted repository or pull request containing a malicious SwiftPM macro executes host code automatically during compilation.
Fix: Make -skipMacroValidation opt-in via project configuration or tool parameters rather than passing it unconditionally on every xcodebuild invocation.
-
LowState-changing UI automation tools are marked readOnlyHint: true
UI automation tool manifests including manifests/tools/batch.yaml and manifests/tools/button.yaml set readOnlyHint: true. MCP clients such as Claude Code, Cursor, and Codex use readOnlyHint: true to auto-approve tools without user confirmation. Because tapping controls or pressing hardware buttons inside a booted simulator mutates app state and can trigger real network requests or account actions in connected apps or Safari, advertising readOnlyHint: true weakens client confirmation guardrails when ui-automation is enabled.
Fix: Set readOnlyHint: false on state-mutating UI interaction tools (such as batch, button, tap, swipe, drag, touch, long_press, type_text, key_press, key_sequence, and gesture) and keep readOnlyHint: true only on inspection tools like snapshot_ui and screenshot.
-
LowDefault-on Sentry telemetry sends 100% traces and metrics and leaks paths in watchedPath
README.md states that MobileBuildMCP uses Sentry for internal runtime error telemetry only, but initSentry sets tracesSampleRate: 1.0 and enables metrics while wrapMcpServerWithSentry and recordToolInvocationMetric transmit spans and counters on normal startups and tool calls. In addition, beforeSendTransaction is not configured, and redactPathLikeData only replaces /Users/<name>, leaving project folder names and <username>.xcuserdatad segments unredacted in snapshot.watchedPath within shutdown summaries.
Fix: Disable performance tracing and usage metrics by default (or document them clearly), configure beforeSendTransaction, and redact full workspace paths and xcuserdata/<username>.xcuserdatad segments.
-
LowProject templates are downloaded at runtime without checksum verification
src/utils/template-manager.ts:91
When scaffolding an iOS or macOS project without a local template override, TemplateManager.downloadTemplate downloads a release zip archive by mutable Git tag from GitHub using curl and extracts it without verifying a pinned SHA-256 digest (unlike xcodemake.ts, which verifies SHA-256). If a release asset or tag were tampered with, modified Xcode project settings or build phases would be written into the new project.
Fix: Verify downloaded template zip archives against pinned SHA-256 checksums for the bundled default template versions before extraction.
-
LowBuild-time AXe bundling script uses predictable /tmp directory and skips checksum verification
The developer and CI packaging script scripts/bundle-axe.sh uses a predictable /tmp/axe-download-$$ directory instead of mktemp -d and downloads AXe release tarballs without verifying a pinned SHA-256 checksum before ad-hoc signing and executing the binary. Although this script does not run on end-user machines after install, hardening it protects developers and release builds.
Fix: Create the temporary download directory with mktemp -d and verify the downloaded AXe archive against a pinned SHA-256 checksum before extraction and execution.
-
LowState-modifying UI automation and simulator tools advertise readOnlyHint: true
manifests/tools/type_text.yaml:15
Multiple tools that send input or mutate simulator state are marked with readOnlyHint: true in their MCP manifests, including type_text, tap, key_press, key_sequence, long_press, touch, swipe, drag, gesture, open_sim, set_sim_location, reset_sim_location, set_sim_appearance, and sim_statusbar (as well as batch and button in the MCP contract fixtures). MCP clients use readOnlyHint: true to auto-approve read-only calls without asking the user. If an agent is tricked via prompt injection while ui-automation or simulator-management is enabled (or via default-enabled open_sim), it can type text, tap buttons, press keys, or alter simulator settings inside running apps without write-confirmation prompts.
Fix: Set readOnlyHint: false in the tool manifests for all UI input, host app launch, and simulator state-mutating tools (type_text, tap, key_press, key_sequence, long_press, touch, swipe, drag, gesture, batch, button, open_sim, set_sim_location, reset_sim_location, set_sim_appearance, and sim_statusbar).
-
LowOptional CLI skill instructs unpinned global install if binary is missing
skills/mobilebuildmcp-cli/SKILL.md:24
When the optional mobilebuildmcp-cli skill is installed, Step 1 instructs the agent to check for the CLI and, if missing, install it globally with brew install mobilebuildmcp or npm install -g mobilebuildmcp@latest. An agent with shell access that executes this step directly rather than only showing instructions will download and install an unpinned @latest package globally without explicit user confirmation.
Fix: Update the skill text to instruct the agent to ask the user before installing global packages and pin a specific version instead of @latest.
-
LowOptional CLI skill instructs the agent to globally install an unpinned package
skills/mobilebuildmcp-cli/SKILL.md:24
When the optional CLI skill is installed (for example via npx -y mobilebuildmcp@latest init without a global binary, or synced to a new machine) and mobilebuildmcp is not on PATH, Step 1 instructs the coding agent to run brew install mobilebuildmcp or npm install -g mobilebuildmcp@latest directly. This tells the agent to perform a global, unpinned package installation without first asking the user for confirmation, rather than simply reporting the installation instructions.
Fix: Update Step 1 in skills/mobilebuildmcp-cli/SKILL.md so the agent asks the user for confirmation (or only displays the install commands) instead of running global install commands automatically, and pin the npm package version to match the installed skill version.
-
InfoSentry telemetry is enabled by default
Runtime error reporting and MCP shutdown telemetry via @sentry/node are enabled by default right after installation (MOBILEBUILDMCP_SENTRY_DISABLED defaults to false in server.json), sending diagnostic telemetry over the network unless opted out.
Fix: Set MOBILEBUILDMCP_SENTRY_DISABLED=true in the MCP client environment or sentryDisabled: true in .mobilebuildmcp/config.yaml if you do not want telemetry sent to Sentry.
