Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1ceed03
feat(ios): add prerequisite validation script and setup docs
cryptotavares Feb 8, 2026
bb0852d
feat(platform): define IPlatformDriver interface and platform types
cryptotavares Feb 8, 2026
ac75ac2
feat(ios): add XCUITest HTTP client module and iOS runner
cryptotavares Feb 8, 2026
26fc183
feat(platform): create PlaywrightPlatformDriver wrapping existing code
cryptotavares Feb 8, 2026
b63d0c2
feat(ios): implement IOSPlatformDriver with XCUITest backend
cryptotavares Feb 8, 2026
4675c1b
feat(ios): add simctl CLI wrapper for simulator device management
cryptotavares Feb 8, 2026
5213f8e
feat(ios): add XCUITest runner lifecycle management
cryptotavares Feb 8, 2026
4ebcd52
feat(ios): add platform fields to launch type chain (Zod, TS, Session…
cryptotavares Feb 8, 2026
1871666
feat(types): add iOS-specific error codes
cryptotavares Feb 8, 2026
1f55868
feat(types): add automationPlatform to StepRecord
cryptotavares Feb 8, 2026
376ad6b
feat(tools): add platform gating and automationPlatform recording
cryptotavares Feb 8, 2026
1aec465
test(tools): add platform gating tests
cryptotavares Feb 8, 2026
85a00d7
test(tools): update run-tool tests for automationPlatform
cryptotavares Feb 8, 2026
11983de
feat(ios): complete iOS integration with docs and exports
cryptotavares Feb 8, 2026
4369e83
fix(lint): resolve duplicate export names in barrel files
cryptotavares Feb 9, 2026
79d7e51
fix(lint): annotate fetch/Response as stable Node 20.18+ APIs
cryptotavares Feb 9, 2026
5fc1f1e
fix(lint): correct import ordering in mcp-server modules
cryptotavares Feb 9, 2026
dbbe15f
fix(lint): update stale JSDoc params and import ordering in helpers
cryptotavares Feb 9, 2026
f4810fc
fix(lint): replace non-null assertions with null guards in tool handlers
cryptotavares Feb 9, 2026
1ef3e3f
fix(lint): add missing JSDoc param for automationPlatform in knowledg…
cryptotavares Feb 9, 2026
ca30e40
fix(lint): format iOS runner JSON assets with prettier
cryptotavares Feb 9, 2026
a49ee16
fix(lint): resolve all lint errors in platform modules
cryptotavares Feb 9, 2026
b9ab143
fix(ios): align types with Swift runner protocol
cryptotavares Feb 9, 2026
9ffd403
fix(ios): rewrite XCUITestClient to match Swift runner protocol
cryptotavares Feb 9, 2026
766c479
fix(ios): make Xcode project portable
cryptotavares Feb 9, 2026
599298e
fix(ios): add POSIX-compatible timeout fallback for macOS
cryptotavares Feb 9, 2026
253d7cc
fix(ios): fix state crash, driver lifecycle, platform gating, schema …
cryptotavares Feb 9, 2026
910ac5c
test(ios): update test mocks to match corrected runner protocol
cryptotavares Feb 9, 2026
21745a3
fix(ios): harden iOS platform driver security, reliability, and maint…
cryptotavares Feb 9, 2026
9d7f65e
fix(ios): improve iOS driver robustness for edge cases
cryptotavares Feb 9, 2026
ac2b153
docs(ios): document runner architecture and fallback strategy
cryptotavares Feb 16, 2026
cb03684
feat(ios): add AXSnapshot fallback and runner recovery flow
cryptotavares Feb 16, 2026
04dcc96
fix(ios): address critical and high severity review findings
cryptotavares Feb 17, 2026
3d1a7e8
fix(ios): build XCUITest runner lazily
cryptotavares Feb 18, 2026
ba05793
test: align coverage thresholds with baseline
cryptotavares Feb 18, 2026
209861d
fix(ios): invalidate cached runner build when Swift sources change
cryptotavares Feb 18, 2026
b9181d1
fix(ios): harden runner lifecycle and improve iOS app state reporting
cryptotavares Feb 18, 2026
e07284f
fix(state): use snapshot capability without page dependency
cryptotavares Feb 19, 2026
19f2b47
fix(launch): surface launch-in-progress as session-running error
cryptotavares Feb 19, 2026
1cfc039
fix(cleanup): make signal handlers single-run and non-recursive
cryptotavares Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules/

# Build output
dist/
ios-runner-derived-data/

# Test coverage
coverage/
Expand Down Expand Up @@ -45,4 +46,7 @@ yalc.lock
# This entry would keep track of the yarn binaries tarball generated by corepack
!.yarn/yarn-corepack.tgz

docs/
docs/

ios-runner/AxSnapshot/.build
**/xcuserdata/
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,96 @@ yarn build && yalc publish
yalc add @metamask/client-mcp-core
```

## iOS Simulator Support

### Overview

This package supports MetaMask Mobile automation on iOS simulators through the
same MCP tool surface used by browser workflows (`mm_click`, `mm_type`,
`mm_wait_for`, `mm_describe_screen`, etc.).

Under the hood, iOS uses a dual-backend discovery architecture:

- XCUITest runner for command execution and primary discovery.
- AXSnapshot fallback for resilient post-transition discovery when XCTest
accessibility snapshots degrade.

### iOS Architecture

```
MCP tool call
-> IOSPlatformDriver
-> XCUITestClient
-> AgentDeviceRunner (XCUITest host)
-> snapshot / interaction command
-> (if snapshot degraded) AXSnapshot fallback
-> normalized discovery tree
```

Core components:

- `IPlatformDriver`: platform abstraction shared by browser + iOS.
- `PlaywrightPlatformDriver`: browser implementation.
- `IOSPlatformDriver`: iOS implementation with discovery backend strategy.
- `XCUITestClient`: transport for runner command API.
- `runner-lifecycle`: boot, health, restart, and rebind behavior.
- `ax-snapshot`: binary invocation and output normalization.

Default snapshot backend is `xctest-with-ax-fallback`.

### Reliability Behaviors

- Health checks use `ping` to avoid snapshot-triggered UI side effects.
- Runner bind step is separate from snapshot requests (`bind` command).
- Discovery avoids clearing ref maps when a snapshot is empty.
- Interaction polling retries through transient recovery windows.
- Recovery and discovery issues are surfaced with explicit error codes:
- `MM_IOS_EMPTY_SNAPSHOT`
- `MM_IOS_RUNNER_RECOVERING`
- `MM_IOS_AX_PERMISSION_REQUIRED`
- `MM_IOS_AX_BINARY_MISSING`
- `MM_IOS_AX_SNAPSHOT_FAILED`

### Prerequisites

- iOS setup guide: [docs/ios-setup.md](docs/ios-setup.md)
- Runner architecture and command details:
[ios-runner/README.md](ios-runner/README.md)

### Platform Support Matrix

| Tool | Browser | iOS |
| ------------------------- | --------------- | --------------- |
| mm_click | ✅ | ✅ |
| mm_type | ✅ | ✅ |
| mm_wait_for | ✅ | ✅ |
| mm_screenshot | ✅ | ✅ |
| mm_accessibility_snapshot | ✅ | ✅ |
| mm_list_testids | ✅ | ✅ |
| mm_describe_screen | ✅ | ✅ |
| mm_get_state | ✅ | ✅ |
| mm_build | ✅ (capability) | ✅ (capability) |
| mm_seed_contract | ✅ (capability) | ✅ (capability) |
| mm_clipboard | ✅ | ❌ (CDP) |
| mm_switch_to_tab | ✅ | ❌ (tabs) |
| mm_close_tab | ✅ | ❌ (tabs) |
| mm_wait_for_notification | ✅ | ❌ (tabs) |

### Usage

To launch an iOS session, set `platform: 'ios'` in the launch input:

```typescript
{ platform: 'ios', simulatorDeviceId: '<UDID>', appBundlePath: '/path/to/MetaMask.app' }
```

### Runner Diagnostics

- XCUITest runner startup and runtime logs are written to
`test-artifacts/ios-runner-logs`.
- Startup failures include log paths and recent stdout/stderr tails to speed up
triage.

## License

MIT
Loading
Loading