@ceraph/react-native-mcp 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/LICENSE +116 -15
  2. package/README.md +79 -77
  3. package/assets/default.png +0 -0
  4. package/dist/app-lifecycle.d.ts +50 -0
  5. package/dist/app-lifecycle.js +487 -0
  6. package/dist/camera-image-writer.d.ts +43 -0
  7. package/dist/camera-image-writer.js +280 -0
  8. package/dist/camera-registry-sync.d.ts +18 -0
  9. package/dist/camera-registry-sync.js +117 -0
  10. package/dist/cli.d.ts +0 -7
  11. package/dist/cli.js +41 -9
  12. package/dist/device-autonomy.d.ts +30 -0
  13. package/dist/device-autonomy.js +117 -0
  14. package/dist/error-parser.d.ts +6 -26
  15. package/dist/error-parser.js +4 -74
  16. package/dist/expo-manager.d.ts +2 -74
  17. package/dist/expo-manager.js +11 -125
  18. package/dist/index.d.ts +0 -7
  19. package/dist/index.js +1266 -56
  20. package/dist/init/ast-camera.d.ts +29 -0
  21. package/dist/init/ast-camera.js +267 -0
  22. package/dist/init/ast-layout.d.ts +15 -0
  23. package/dist/init/ast-layout.js +167 -0
  24. package/dist/init/claude-hook-constants.d.ts +9 -0
  25. package/dist/init/claude-hook-constants.js +91 -0
  26. package/dist/init/lan-ip.d.ts +11 -0
  27. package/dist/init/lan-ip.js +51 -0
  28. package/dist/init/monorepo.d.ts +13 -0
  29. package/dist/init/monorepo.js +185 -0
  30. package/dist/init/oauth.d.ts +52 -0
  31. package/dist/init/oauth.js +220 -0
  32. package/dist/init/package-manager.d.ts +11 -0
  33. package/dist/init/package-manager.js +60 -0
  34. package/dist/init/prompt.d.ts +12 -0
  35. package/dist/init/prompt.js +68 -0
  36. package/dist/init/shell-profile.d.ts +22 -0
  37. package/dist/init/shell-profile.js +85 -0
  38. package/dist/init/steps.d.ts +135 -0
  39. package/dist/init/steps.js +399 -0
  40. package/dist/init/url-scheme.d.ts +42 -0
  41. package/dist/init/url-scheme.js +187 -0
  42. package/dist/init/walkthrough.d.ts +76 -0
  43. package/dist/init/walkthrough.js +340 -0
  44. package/dist/init.d.ts +7 -7
  45. package/dist/init.js +280 -120
  46. package/dist/iproxy-manager.d.ts +32 -0
  47. package/dist/iproxy-manager.js +216 -0
  48. package/dist/mac-caffeinate.d.ts +10 -0
  49. package/dist/mac-caffeinate.js +56 -0
  50. package/dist/permission-interceptor.d.ts +29 -0
  51. package/dist/permission-interceptor.js +185 -0
  52. package/dist/prebuild-detector.d.ts +0 -30
  53. package/dist/prebuild-detector.js +1 -42
  54. package/dist/preflight.d.ts +34 -0
  55. package/dist/preflight.js +847 -0
  56. package/dist/screen.d.ts +132 -43
  57. package/dist/screen.js +668 -94
  58. package/dist/shim/boot.d.ts +41 -0
  59. package/dist/shim/boot.js +141 -0
  60. package/dist/shim/camera.d.ts +22 -0
  61. package/dist/shim/camera.js +62 -0
  62. package/dist/shim/config.d.ts +6 -0
  63. package/dist/shim/config.js +56 -0
  64. package/dist/shim/deep-link.d.ts +1 -0
  65. package/dist/shim/deep-link.js +25 -0
  66. package/dist/shim/dev-guard.d.ts +1 -0
  67. package/dist/shim/dev-guard.js +3 -0
  68. package/dist/shim/error-handler.d.ts +20 -0
  69. package/dist/shim/error-handler.js +66 -0
  70. package/dist/shim/fetch-interceptor.d.ts +13 -0
  71. package/dist/shim/fetch-interceptor.js +93 -0
  72. package/dist/shim/index.d.ts +6 -0
  73. package/dist/shim/index.js +6 -0
  74. package/dist/shim/keep-awake.d.ts +13 -0
  75. package/dist/shim/keep-awake.js +118 -0
  76. package/dist/shim/reload.d.ts +23 -0
  77. package/dist/shim/reload.js +76 -0
  78. package/dist/shim/signal-capture.d.ts +11 -0
  79. package/dist/shim/signal-capture.js +15 -0
  80. package/dist/shim/signal-transport.d.ts +17 -0
  81. package/dist/shim/signal-transport.js +43 -0
  82. package/dist/signal-listener.d.ts +27 -0
  83. package/dist/signal-listener.js +135 -0
  84. package/dist/simulator-boot.d.ts +52 -0
  85. package/dist/simulator-boot.js +227 -0
  86. package/dist/target.d.ts +48 -0
  87. package/dist/target.js +267 -0
  88. package/dist/uninstall/cli-runner.d.ts +32 -0
  89. package/dist/uninstall/cli-runner.js +223 -0
  90. package/dist/uninstall/footprint.d.ts +40 -0
  91. package/dist/uninstall/footprint.js +288 -0
  92. package/dist/uninstall/mcp-tools.d.ts +14 -0
  93. package/dist/uninstall/mcp-tools.js +175 -0
  94. package/dist/uninstall/revert-auth.d.ts +22 -0
  95. package/dist/uninstall/revert-auth.js +31 -0
  96. package/dist/uninstall/revert-boot.d.ts +24 -0
  97. package/dist/uninstall/revert-boot.js +242 -0
  98. package/dist/uninstall/revert-camera.d.ts +12 -0
  99. package/dist/uninstall/revert-camera.js +199 -0
  100. package/dist/uninstall/revert-ceraph-dir.d.ts +27 -0
  101. package/dist/uninstall/revert-ceraph-dir.js +38 -0
  102. package/dist/uninstall/revert-claude-hooks.d.ts +19 -0
  103. package/dist/uninstall/revert-claude-hooks.js +191 -0
  104. package/dist/uninstall/revert-gitignore.d.ts +17 -0
  105. package/dist/uninstall/revert-gitignore.js +43 -0
  106. package/dist/uninstall/revert-mcp-clients.d.ts +57 -0
  107. package/dist/uninstall/revert-mcp-clients.js +194 -0
  108. package/dist/uninstall/revert-package.d.ts +34 -0
  109. package/dist/uninstall/revert-package.js +98 -0
  110. package/dist/uninstall/revert-scheme.d.ts +36 -0
  111. package/dist/uninstall/revert-scheme.js +139 -0
  112. package/dist/uninstall/revert-signal-host-env.d.ts +31 -0
  113. package/dist/uninstall/revert-signal-host-env.js +61 -0
  114. package/dist/uninstall/walkthrough.d.ts +80 -0
  115. package/dist/uninstall/walkthrough.js +1244 -0
  116. package/dist/utils/atomic-write.d.ts +1 -0
  117. package/dist/utils/atomic-write.js +30 -0
  118. package/dist/wait-for-device.d.ts +68 -0
  119. package/dist/wait-for-device.js +368 -0
  120. package/dist/wda-manager.d.ts +38 -0
  121. package/dist/wda-manager.js +186 -0
  122. package/dist/wda-simulator.d.ts +28 -0
  123. package/dist/wda-simulator.js +257 -0
  124. package/package.json +38 -5
package/LICENSE CHANGED
@@ -1,21 +1,122 @@
1
- MIT License
1
+ # Functional Source License, Version 1.1, MIT Future License
2
2
 
3
- Copyright (c) 2026 Ike Studios LLC
3
+ ## Abbreviation
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ FSL-1.1-MIT
11
6
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
7
+ ## Notice
8
+
9
+ Copyright 2026 Ike Studios LLC
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publish, and redistribute the
28
+ Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing
33
+ Use means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe
57
+ our patents, the license grant above includes a license under our patents.
58
+ If you make a claim against any party that the Software infringes or
59
+ contributes to the infringement of any patent, then your patent license to
60
+ the Software ends immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives
65
+ of the Software.
66
+
67
+ If you redistribute any copies or modifications of the Software, you must
68
+ include a copy of the License and retain all copyright and disclaimer
69
+ notices in the Software.
70
+
71
+ ### Trademarks
72
+
73
+ Except for displaying the License Details and identifying us as the origin
74
+ of the Software, you have no right under these Terms and Conditions to use
75
+ our trademarks, trade names, service marks or product names.
76
+
77
+ ### Termination
78
+
79
+ If you use the Software in violation of these Terms and Conditions, such
80
+ use will be non-exempted and your rights to use the Software under these
81
+ Terms and Conditions will terminate immediately and automatically. If we
82
+ make available an updated version of the Software or any code or
83
+ documentation related to the Software, these Terms and Conditions will
84
+ apply to your use of that version as well.
85
+
86
+ ### No Liability
87
+
88
+ ***AS FAR AS THE LAW ALLOWS, THE SOFTWARE COMES AS IS, WITHOUT ANY WARRANTY
89
+ OR CONDITION, AND WE WILL NOT BE LIABLE TO YOU FOR ANY DAMAGES ARISING OUT
90
+ OF THESE TERMS AND CONDITIONS OR THE USE OR NATURE OF THE SOFTWARE, UNDER
91
+ ANY KIND OF LEGAL CLAIM.***
92
+
93
+ ### Future License
94
+
95
+ On the second anniversary of the date we make an initial release of the
96
+ Software available, the terms above will no longer apply to that release,
97
+ and the rights granted to you under that release will expand to the rights
98
+ granted under the MIT License, copied below for your convenience.
99
+
100
+ ---
101
+
102
+ ## MIT License
103
+
104
+ Copyright 2026 Ike Studios LLC
105
+
106
+ Permission is hereby granted, free of charge, to any person obtaining a
107
+ copy of this software and associated documentation files (the "Software"),
108
+ to deal in the Software without restriction, including without limitation
109
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
110
+ and/or sell copies of the Software, and to permit persons to whom the
111
+ Software is furnished to do so, subject to the following conditions:
112
+
113
+ The above copyright notice and this permission notice shall be included in
114
+ all copies or substantial portions of the Software.
14
115
 
15
116
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
117
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
118
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
119
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
120
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
121
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
122
+ DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ceraph/react-native-mcp
2
2
 
3
- MCP server for React Native and Expo development. Automatic build error capture, console monitoring, reliable screen interactions, and prebuild detection.
3
+ MCP server for React Native and Expo development. Automatic build error capture, console monitoring, reliable screen interactions, prebuild detection, and iOS Simulator support.
4
4
 
5
5
  Works with any MCP client: Claude Code, Cursor, Codex, Windsurf, and others.
6
6
 
@@ -12,12 +12,14 @@ Works with any MCP client: Claude Code, Cursor, Codex, Windsurf, and others.
12
12
 
13
13
  ## Requirements
14
14
 
15
+ - macOS with Xcode 14+ (Command Line Tools installed)
16
+ - iOS 16+ device on USB **OR** a booted iOS Simulator
15
17
  - Node.js 18+
16
- - macOS (for iOS Simulator/device support)
17
- - [WebDriverAgent](https://github.com/appium/WebDriverAgent) running on `localhost:8100`
18
18
  - [`mobile-mcp`](https://github.com/mobile-next/mobile-mcp) for screenshots, swipe, and device management
19
19
  - Expo dev client or prebuilt app (Expo Go is not supported)
20
20
 
21
+ iOS-only. Android, Linux, and Windows hosts are not supported.
22
+
21
23
  ## Quick Setup
22
24
 
23
25
  Run this from your project root:
@@ -26,14 +28,19 @@ Run this from your project root:
26
28
  npx @ceraph/react-native-mcp init
27
29
  ```
28
30
 
29
- This automatically:
30
- - Configures MCP servers for all detected clients (Claude Code, Cursor, Codex, VS Code, Windsurf, Antigravity)
31
- - Installs a Claude Code hook that injects runtime errors into your conversation automatically
32
- - Adds `.rn-errors.json` to your `.gitignore`
31
+ For testing on a simulator, also run `npm i -D appium-webdriveragent` and call `rn_wda_start` once from your MCP client (first WDA build takes 60–120s and may need an Xcode signing prompt; subsequent starts are ~5–10s via cache).
32
+
33
+ ## Uninstalling
34
+
35
+ ```bash
36
+ npx @ceraph/react-native-mcp uninstall
37
+ ```
38
+
39
+ Flags: `--yes` (skip prompts), `--purge-images` (also delete `.ceraph/`), `--global` (also delete `~/.ceraph/auth.json`), `--dry-run` (preview only).
33
40
 
34
41
  ## Manual Setup
35
42
 
36
- If you prefer to configure manually, follow the instructions for your client below.
43
+ If you prefer to configure manually:
37
44
 
38
45
  ### Claude Code
39
46
 
@@ -42,40 +49,28 @@ Add to `.mcp.json` in your project root:
42
49
  ```json
43
50
  {
44
51
  "mcpServers": {
45
- "mobile-mcp": {
46
- "command": "npx",
47
- "args": ["-y", "@mobilenext/mobile-mcp@latest"]
48
- },
49
- "react-native-mcp": {
50
- "command": "npx",
51
- "args": ["-y", "@ceraph/react-native-mcp@latest"]
52
- }
52
+ "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] },
53
+ "react-native-mcp": { "command": "npx", "args": ["-y", "@ceraph/react-native-mcp@latest"] }
53
54
  }
54
55
  }
55
56
  ```
56
57
 
57
58
  ### Cursor
58
59
 
59
- Add to `.cursor/mcp.json` in your project root:
60
+ Add to `.cursor/mcp.json`:
60
61
 
61
62
  ```json
62
63
  {
63
64
  "mcpServers": {
64
- "mobile-mcp": {
65
- "command": "npx",
66
- "args": ["-y", "@mobilenext/mobile-mcp@latest"]
67
- },
68
- "react-native-mcp": {
69
- "command": "npx",
70
- "args": ["-y", "@ceraph/react-native-mcp@latest"]
71
- }
65
+ "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] },
66
+ "react-native-mcp": { "command": "npx", "args": ["-y", "@ceraph/react-native-mcp@latest"] }
72
67
  }
73
68
  }
74
69
  ```
75
70
 
76
71
  ### Codex
77
72
 
78
- Add to `.codex/config.toml` in your project root:
73
+ Add to `.codex/config.toml`:
79
74
 
80
75
  ```toml
81
76
  [mcp_servers.mobile-mcp]
@@ -89,19 +84,13 @@ args = ["-y", "@ceraph/react-native-mcp@latest"]
89
84
 
90
85
  ### VS Code / Copilot
91
86
 
92
- Add to `.vscode/mcp.json` in your project root:
87
+ Add to `.vscode/mcp.json`:
93
88
 
94
89
  ```json
95
90
  {
96
91
  "mcpServers": {
97
- "mobile-mcp": {
98
- "command": "npx",
99
- "args": ["-y", "@mobilenext/mobile-mcp@latest"]
100
- },
101
- "react-native-mcp": {
102
- "command": "npx",
103
- "args": ["-y", "@ceraph/react-native-mcp@latest"]
104
- }
92
+ "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] },
93
+ "react-native-mcp": { "command": "npx", "args": ["-y", "@ceraph/react-native-mcp@latest"] }
105
94
  }
106
95
  }
107
96
  ```
@@ -113,63 +102,42 @@ Add to `~/.codeium/windsurf/mcp_config.json` (or Settings → Advanced Settings
113
102
  ```json
114
103
  {
115
104
  "mcpServers": {
116
- "mobile-mcp": {
117
- "command": "npx",
118
- "args": ["-y", "@mobilenext/mobile-mcp@latest"]
119
- },
120
- "react-native-mcp": {
121
- "command": "npx",
122
- "args": ["-y", "@ceraph/react-native-mcp@latest"]
123
- }
105
+ "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] },
106
+ "react-native-mcp": { "command": "npx", "args": ["-y", "@ceraph/react-native-mcp@latest"] }
124
107
  }
125
108
  }
126
109
  ```
127
110
 
128
111
  ### Antigravity
129
112
 
130
- Add to `~/.gemini/antigravity/mcp_config.json` (or Manage MCP Servers → View raw config):
113
+ Add to `~/.gemini/antigravity/mcp_config.json`:
131
114
 
132
115
  ```json
133
116
  {
134
117
  "mcpServers": {
135
- "mobile-mcp": {
136
- "command": "npx",
137
- "args": ["-y", "@mobilenext/mobile-mcp@latest"]
138
- },
139
- "react-native-mcp": {
140
- "command": "npx",
141
- "args": ["-y", "@ceraph/react-native-mcp@latest"]
142
- }
118
+ "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] },
119
+ "react-native-mcp": { "command": "npx", "args": ["-y", "@ceraph/react-native-mcp@latest"] }
143
120
  }
144
121
  }
145
122
  ```
146
123
 
147
124
  ### Cline / Roo Code (VS Code extensions)
148
125
 
149
- Open VS Code Settings → Extensions → Cline (or Roo Code) → MCP Servers, then add:
126
+ VS Code Settings → Extensions → Cline (or Roo Code) → MCP Servers:
150
127
 
151
128
  ```json
152
129
  {
153
- "mobile-mcp": {
154
- "command": "npx",
155
- "args": ["-y", "@mobilenext/mobile-mcp@latest"]
156
- },
157
- "react-native-mcp": {
158
- "command": "npx",
159
- "args": ["-y", "@ceraph/react-native-mcp@latest"]
160
- }
130
+ "mobile-mcp": { "command": "npx", "args": ["-y", "@mobilenext/mobile-mcp@latest"] },
131
+ "react-native-mcp": { "command": "npx", "args": ["-y", "@ceraph/react-native-mcp@latest"] }
161
132
  }
162
133
  ```
163
134
 
164
135
  ### JetBrains IDEs
165
136
 
166
- Settings → Tools → MCP Servers → Add, then enter:
167
-
168
- - **Name:** `react-native-mcp`
169
- - **Command:** `npx`
170
- - **Args:** `-y @ceraph/react-native-mcp@latest`
137
+ Settings → Tools → MCP Servers → Add:
171
138
 
172
- Repeat for `mobile-mcp` with args `-y @mobilenext/mobile-mcp@latest`.
139
+ - **Name:** `react-native-mcp` **Command:** `npx` — **Args:** `-y @ceraph/react-native-mcp@latest`
140
+ - Repeat for `mobile-mcp` with args `-y @mobilenext/mobile-mcp@latest`.
173
141
 
174
142
  ## Tools
175
143
 
@@ -177,26 +145,60 @@ Repeat for `mobile-mcp` with args `-y @mobilenext/mobile-mcp@latest`.
177
145
 
178
146
  | Tool | Description |
179
147
  |---|---|
180
- | `rn_build_ios` | Build the app with `expo run:ios`. Captures Xcode output and returns structured errors (file, line, message, type). Optionally runs `prebuild --clean` first. |
181
- | `rn_start` | Start Metro dev server. Monitors console output for runtime errors, JS exceptions, and red screens. |
182
- | `rn_get_errors` | Return all captured build and runtime errors without re-running anything. |
183
- | `rn_get_console` | Return recent Metro console output, filtered by log level. |
184
- | `rn_check_prebuild` | Detect if `prebuild --clean` is needed by diffing `package.json`, `app.json`, and `Podfile.lock` against the last successful build. |
148
+ | `rn_build_ios` | Build with `expo run:ios`. Returns structured Xcode errors (file, line, message). Optionally runs `prebuild --clean` first. |
149
+ | `rn_start` | Start Metro. Monitors stdout for runtime errors, JS exceptions, and red screens. |
150
+ | `rn_get_errors` | Return all captured build and runtime errors. |
151
+ | `rn_get_console` | Return recent Metro console output. |
152
+ | `rn_check_prebuild` | Detect if `prebuild --clean` is needed (diffs `package.json`, `app.json`, `Podfile.lock`). |
185
153
  | `rn_stop` | Kill all managed React Native processes. |
154
+ | `rn_reload` | Trigger a JS bundle reload via `DevSettings.reload()` on the running app. |
155
+
156
+ ### Target & Simulator
157
+
158
+ | Tool | Description |
159
+ |---|---|
160
+ | `rn_target_status` | Report current target (device vs simulator), WDA base URL, simulator session status. |
161
+ | `rn_wda_start` | Build + launch WebDriverAgent on a booted iOS Simulator. Idempotent. Real-device users don't need this. |
162
+ | `rn_wda_stop` | Stop the simulator WDA session. Idempotent. |
163
+ | `rn_boot_simulator` | Boot a simulator (defaults to newest available iPhone runtime). |
164
+ | `rn_wait_for_device` | Wait for a real iOS device to appear over USB (event-driven via usbmuxd, no timeout). |
186
165
 
187
166
  ### Screen Interaction
188
167
 
189
168
  | Tool | Description |
190
169
  |---|---|
191
- | `screen_tap` | Tap at coordinates with automatic pixel ratio correction. Screenshot coordinates are divided by the device pixel ratio (2x/3x) so taps land where you expect. |
192
- | `screen_find_and_tap` | Find an element by text, accessibility label, or type, then tap its center. Most reliable interaction method — no coordinate guessing. |
170
+ | `screen_tap` | Tap at coordinates with automatic pixel-ratio correction. |
171
+ | `screen_find_and_tap` | Find by text, accessibility label, or type, then tap. |
172
+ | `screen_swipe` | Swipe up / down / left / right. |
173
+ | `screen_scroll_to` | Repeatedly swipe until an element appears. |
174
+ | `screen_long_press` | Long-press a matched element. |
175
+ | `screen_type` | Send text to the focused element. |
176
+ | `screen_clear_text` | Focus a field and clear it. |
177
+ | `screen_press_key` | Press `home`, `volumeUp`, `volumeDown`, or `lock`. |
178
+ | `screen_screenshot` | Base64 PNG screenshot. |
179
+ | `screen_get_source` | WDA accessibility tree as JSON. |
180
+ | `screen_wait_for` | Poll the source tree until an element appears or disappears. |
181
+ | `screen_assert_visible` | One-shot visibility check (`invert: true` for assert-not-visible). |
182
+
183
+ ### App Lifecycle & Device
184
+
185
+ | Tool | Description |
186
+ |---|---|
187
+ | `app_launch` | Launch by bundle ID (`xcrun devicectl`, falls back to `idb` / `simctl`). |
188
+ | `app_terminate` | Terminate by bundle ID. |
189
+ | `app_activate` | Foreground an app via WDA without a cold restart. |
190
+ | `app_list_installed` | List installed apps (cached 30s). |
191
+ | `app_active` | Foreground app's bundleId, pid, and name. |
192
+ | `device_ensure_awake` | Wake + unlock prompt. |
193
+ | `device_lock_state` | `unlocked` / `locked` / `screen-off` / `unknown`. |
194
+ | `device_set_orientation` | Portrait or landscape. |
193
195
 
194
196
  ## Why both MCPs?
195
197
 
196
- `mobile-mcp` handles low-level device interaction (screenshots, swipe, app lifecycle, recording) and is actively maintained for iOS/Android compatibility.
198
+ `mobile-mcp` handles low-level device interaction (screenshots, swipe, app lifecycle).
197
199
 
198
- `@ceraph/react-native-mcp` adds the development workflow layer on top: structured error capture, console monitoring, pixel-ratio-corrected taps, and prebuild detection. Both talk to WebDriverAgent independently — they don't depend on each other, they complement each other.
200
+ `@ceraph/react-native-mcp` adds the development workflow layer: structured error capture, console monitoring, pixel-ratio-corrected taps, prebuild detection, and simulator lifecycle. Both talk to WebDriverAgent independently — they don't depend on each other, they complement each other.
199
201
 
200
202
  ## License
201
203
 
202
- MIT
204
+ [FSL-1.1-MIT](LICENSE) — free for use; competing commercial products restricted. Auto-converts to MIT 2 years after each release.
Binary file
@@ -0,0 +1,50 @@
1
+ import type { ScreenManager } from "./screen.js";
2
+ import type { TargetResolver } from "./target.js";
3
+ export interface InstalledApp {
4
+ bundleId: string;
5
+ name: string;
6
+ version?: string;
7
+ }
8
+ export interface LifecycleResult {
9
+ success: boolean;
10
+ transport: "devicectl" | "idb" | "simctl" | "wda" | "none";
11
+ error?: string;
12
+ details?: Record<string, unknown>;
13
+ }
14
+ export declare function parseSimctlListapps(stdout: string): InstalledApp[];
15
+ export declare class AppLifecycle {
16
+ private screen?;
17
+ private targetResolver?;
18
+ private udid;
19
+ private udidResolved;
20
+ private udidResolvedAt;
21
+ private static readonly UDID_TTL_MS;
22
+ private udidInflight;
23
+ private devicectlAvailable;
24
+ private idbAvailable;
25
+ private installedAppsCache;
26
+ private readonly INSTALLED_CACHE_MS;
27
+ constructor(screen?: ScreenManager | undefined, targetResolver?: TargetResolver | undefined);
28
+ setTargetResolver(resolver: TargetResolver): void;
29
+ private pickTransport;
30
+ getUdid(): Promise<string | null>;
31
+ private checkDevicectl;
32
+ private checkIdb;
33
+ launchApp(bundleId: string): Promise<LifecycleResult>;
34
+ terminateApp(bundleId: string): Promise<LifecycleResult>;
35
+ activateApp(bundleId: string): Promise<LifecycleResult>;
36
+ listInstalledApps(): Promise<{
37
+ success: boolean;
38
+ apps: InstalledApp[];
39
+ error?: string;
40
+ }>;
41
+ private listInstalledAppsSimulator;
42
+ getActiveApp(): Promise<{
43
+ success: boolean;
44
+ bundleId?: string;
45
+ pid?: number;
46
+ name?: string;
47
+ error?: string;
48
+ }>;
49
+ reset(): void;
50
+ }