Skip to content

Harden MCP tooling: correctness fixes, validation, and new sim/device tools#12

Merged
maatheusgois-dd merged 1 commit into
mainfrom
maatheusgois-dd/xcodebazelmcp-hardening
Jun 29, 2026
Merged

Harden MCP tooling: correctness fixes, validation, and new sim/device tools#12
maatheusgois-dd merged 1 commit into
mainfrom
maatheusgois-dd/xcodebazelmcp-hardening

Conversation

@maatheusgois-dd

Copy link
Copy Markdown
Contributor

Summary

A reliability/consistency hardening pass across the MCP tools and CLI, plus new simulator/device tools. Tool count 120 → 125; test suite 575 → 619 passing. Every change was validated against a real Bazel iOS workspace (~/projects/ios) and a booted simulator.

  • Correctness: fixed combined stdout/stderr JSON parsing (simctl list, swift package dump-package, idb accessibility snapshot); host-arch-aware iOS simulator CPU (BAZEL_IOS_SIMULATOR_CPU); quote-aware BAZEL_IOS_STARTUP_ARGS; env-overridable discover scope; macOS readBundleId now handles Contents/Info.plist.
  • LLDB: per-command output buffer (fixes a deadlock once a session passed 500KB), newline/quote injection guards, session cleanup on server shutdown.
  • Consistency: streaming tools return structuredContent; Bazel exit-code annotations; device launch/stop/screenshot now surface error hints + structured content; SPM flag parity (-c/--debug); config keeps string-typed keys as strings.
  • New tools: bazel_ios_uninstall_app, bazel_ios_device_uninstall_app, bazel_ios_device_list_apps, bazel_ios_add_media, bazel_ios_get_app_container (+ CLI verbs).
  • Scaffold: bundleId/minimumOs/rulesVersion validation, families & bazelVersion options, iOS Info.plist keys, absolute config path.
  • DX: doctor reports idb/pymobiledevice3/maxOutput; README env-var section; runtime smoke script + CI smoke step; --version/-h flags; device-app-path CLI.

Note: this branch also snapshots in-progress xcode-native-mcp, command-log, and diagnostics modules that were already present in the working tree. Flagging for reviewers in case they should land separately.

Scope

  • MCP server/tools
  • CLI commands or parsers
  • Bazel build/test/discovery
  • Simulator workflows
  • Physical device workflows
  • UI automation, screenshots, video, logs, or deep links
  • LLDB debugging
  • macOS, tvOS, watchOS, or visionOS workflows
  • Swift Package Manager
  • Daemon, session defaults, config, doctor, or setup
  • Project scaffolding
  • Docs, examples, or agent skills
  • CI, release, packaging, or dependencies

Validation

  • `npm run lint`
  • `npm run typecheck`
  • `npm test` (619 passing)
  • `npm run build`
  • `npm run smoke`
  • Manual CLI validation with `xcodebazelmcp ...`
  • Simulator validation (add-media, screenshot, ui-dump against booted sim)
  • Physical device validation (devices present but no destructive ops run)

Compatibility

  • Adds, removes, or renames MCP tools (adds 5; daemon tool descriptions clarified)
  • Changes CLI flags, command output, exit codes, or streaming behavior (new verbs, --version/-h, streaming structured content, Bazel exit hints)
  • Changes config files, environment variables, defaults, or profiles (new env vars; string-key parsing)
  • Changes generated project scaffolding (validation + new options + plist keys)
  • Requires updates to docs, README, manifests, schemas, or skills (README updated)

Notes For Reviewers

  • New env vars documented in README: `BAZEL_IOS_SIMULATOR_CPU`, `BAZEL_IOS_DISCOVER_SCOPE`, `BAZEL_IOS_MCP_MAX_OUTPUT`, `BAZEL_IOS_STARTUP_ARGS`, `BAZEL_IOS_COMMAND_LOG*`.
  • Deliberately not included (recommended as separate PRs): daemon process-ownership rewrite, YAML-library config migration.
  • A set_content_size tool was prototyped then removed after live testing showed simctl ui content_size hangs on Xcode 26.3.

Made with Cursor

… tools

A reliability/consistency pass across the MCP tools and CLI, plus new
simulator/device tools (tool count 120 -> 125). All changes verified
against a real Bazel iOS workspace.

Highlights:
- Fix combined stdout/stderr JSON parsing (simctl list, swift dump-package,
  idb accessibility snapshot)
- Host-arch-aware iOS simulator CPU (BAZEL_IOS_SIMULATOR_CPU); quote-aware
  BAZEL_IOS_STARTUP_ARGS; env-overridable discover scope
- LLDB: per-command output buffer (fixes >500KB deadlock), newline/quote
  injection guards, session cleanup on shutdown
- Streaming tools return structured content; Bazel exit-code annotations
- Scaffold: bundleId/minimumOs/rulesVersion validation, families &
  bazelVersion options, iOS Info.plist keys, absolute config path
- New tools: bazel_ios_uninstall_app, bazel_ios_device_uninstall_app,
  bazel_ios_device_list_apps, bazel_ios_add_media, bazel_ios_get_app_container
- Doctor reports idb/pymobiledevice3/maxOutput; README env-var section
- Runtime smoke script + CI smoke step; +45 tests (575 -> 619 passing)

Note: also snapshots in-progress xcode-native-mcp, command-log, and
diagnostics modules already present in the working tree.

Co-authored-by: Cursor <cursoragent@cursor.com>
@maatheusgois-dd maatheusgois-dd self-assigned this Jun 28, 2026
@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

@maatheusgois-dd
maatheusgois-dd marked this pull request as ready for review June 29, 2026 23:55
@maatheusgois-dd
maatheusgois-dd merged commit f849eeb into main Jun 29, 2026
7 checks passed
@maatheusgois-dd
maatheusgois-dd deleted the maatheusgois-dd/xcodebazelmcp-hardening branch June 29, 2026 23:55
maatheusgois-dd added a commit that referenced this pull request Jul 17, 2026
Resolve conflicts keeping Bitrise auth stripping on top of main's
hardening (PR #12). Fix duplicate expandTilde/resolvePath in config.ts.

Generated-by: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant