react-native-mcp-kit 2.2.2 → 2.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 (86) hide show
  1. package/README.md +62 -23
  2. package/dist/bin/ios-hid +0 -0
  3. package/dist/client/core/McpClient.d.ts +2 -0
  4. package/dist/client/core/McpClient.d.ts.map +1 -1
  5. package/dist/client/core/McpClient.js +33 -0
  6. package/dist/client/core/McpClient.js.map +1 -1
  7. package/dist/modules/console/console.d.ts.map +1 -1
  8. package/dist/modules/console/console.js +78 -49
  9. package/dist/modules/console/console.js.map +1 -1
  10. package/dist/modules/errors/errors.d.ts.map +1 -1
  11. package/dist/modules/errors/errors.js +58 -39
  12. package/dist/modules/errors/errors.js.map +1 -1
  13. package/dist/modules/fiberTree/fiberTree.d.ts.map +1 -1
  14. package/dist/modules/fiberTree/fiberTree.js +144 -61
  15. package/dist/modules/fiberTree/fiberTree.js.map +1 -1
  16. package/dist/modules/logBox/logBox.d.ts.map +1 -1
  17. package/dist/modules/logBox/logBox.js +8 -9
  18. package/dist/modules/logBox/logBox.js.map +1 -1
  19. package/dist/modules/navigation/navigation.d.ts.map +1 -1
  20. package/dist/modules/navigation/navigation.js +12 -9
  21. package/dist/modules/navigation/navigation.js.map +1 -1
  22. package/dist/modules/network/network.d.ts.map +1 -1
  23. package/dist/modules/network/network.js +76 -36
  24. package/dist/modules/network/network.js.map +1 -1
  25. package/dist/server/bridge.d.ts +2 -1
  26. package/dist/server/bridge.d.ts.map +1 -1
  27. package/dist/server/bridge.js +1 -0
  28. package/dist/server/bridge.js.map +1 -1
  29. package/dist/server/cli.js +2 -1
  30. package/dist/server/cli.js.map +1 -1
  31. package/dist/server/host/hostModule.d.ts.map +1 -1
  32. package/dist/server/host/hostModule.js +0 -2
  33. package/dist/server/host/hostModule.js.map +1 -1
  34. package/dist/server/host/tools/symbolicate.d.ts.map +1 -1
  35. package/dist/server/host/tools/symbolicate.js +13 -3
  36. package/dist/server/host/tools/symbolicate.js.map +1 -1
  37. package/dist/server/mcpServer.d.ts.map +1 -1
  38. package/dist/server/mcpServer.js +11 -10
  39. package/dist/server/mcpServer.js.map +1 -1
  40. package/dist/server/metro/eventCapture.d.ts +41 -0
  41. package/dist/server/metro/eventCapture.d.ts.map +1 -0
  42. package/dist/server/metro/eventCapture.js +138 -0
  43. package/dist/server/metro/eventCapture.js.map +1 -0
  44. package/dist/server/metro/index.d.ts +2 -0
  45. package/dist/server/metro/index.d.ts.map +1 -0
  46. package/dist/server/metro/index.js +6 -0
  47. package/dist/server/metro/index.js.map +1 -0
  48. package/dist/server/metro/metroModule.d.ts +3 -0
  49. package/dist/server/metro/metroModule.d.ts.map +1 -0
  50. package/dist/server/metro/metroModule.js +25 -0
  51. package/dist/server/metro/metroModule.js.map +1 -0
  52. package/dist/server/metro/resolveMetroUrl.d.ts +12 -0
  53. package/dist/server/metro/resolveMetroUrl.d.ts.map +1 -0
  54. package/dist/server/metro/resolveMetroUrl.js +23 -0
  55. package/dist/server/metro/resolveMetroUrl.js.map +1 -0
  56. package/dist/server/metro/tools/events.d.ts +3 -0
  57. package/dist/server/metro/tools/events.d.ts.map +1 -0
  58. package/dist/server/metro/tools/events.js +51 -0
  59. package/dist/server/metro/tools/events.js.map +1 -0
  60. package/dist/server/metro/tools/openInEditor.d.ts +3 -0
  61. package/dist/server/metro/tools/openInEditor.d.ts.map +1 -0
  62. package/dist/server/metro/tools/openInEditor.js +89 -0
  63. package/dist/server/metro/tools/openInEditor.js.map +1 -0
  64. package/dist/server/metro/tools/openUrl.d.ts +3 -0
  65. package/dist/server/metro/tools/openUrl.d.ts.map +1 -0
  66. package/dist/server/metro/tools/openUrl.js +71 -0
  67. package/dist/server/metro/tools/openUrl.js.map +1 -0
  68. package/dist/server/metro/tools/reload.d.ts +3 -0
  69. package/dist/server/metro/tools/reload.d.ts.map +1 -0
  70. package/dist/server/metro/tools/reload.js +53 -0
  71. package/dist/server/metro/tools/reload.js.map +1 -0
  72. package/dist/server/metro/tools/status.d.ts +3 -0
  73. package/dist/server/metro/tools/status.d.ts.map +1 -0
  74. package/dist/server/metro/tools/status.js +52 -0
  75. package/dist/server/metro/tools/status.js.map +1 -0
  76. package/dist/server/metro/tools/symbolicate.d.ts +3 -0
  77. package/dist/server/metro/tools/symbolicate.d.ts.map +1 -0
  78. package/dist/server/metro/tools/symbolicate.js +203 -0
  79. package/dist/server/metro/tools/symbolicate.js.map +1 -0
  80. package/dist/shared/protocol.d.ts +14 -0
  81. package/dist/shared/protocol.d.ts.map +1 -1
  82. package/dist/shared/slice.d.ts +16 -0
  83. package/dist/shared/slice.d.ts.map +1 -0
  84. package/dist/shared/slice.js +29 -0
  85. package/dist/shared/slice.js.map +1 -0
  86. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **See, drive, and debug a running React Native app from an AI agent.**
4
4
 
5
- `react-native-mcp-kit` connects a running RN app (on simulator, emulator, or physical device) to any process that speaks the [Model Context Protocol](https://modelcontextprotocol.io). You wrap your app in one provider, add a babel plugin, point your AI tool at a small Node server that ships with the package, and every interesting thing inside the app becomes addressable: component trees, navigation state, network traffic, React Query cache, logs, errors, translations, storage plus the OS gesture pipeline (taps, swipes, text input, screenshots) via a bundled binary that runs with zero external daemons.
5
+ `react-native-mcp-kit` connects a running RN app on simulator, emulator, or physical device to any process that speaks the [Model Context Protocol](https://modelcontextprotocol.io). You wire it in once and the agent gets a concise, structured view of what's happening inside the running app: deep runtime-state analysis it can cross-reference in a single pass, full access to the React tree so it can find and reason about UI without screenshots and OCR, every kind of log the app produces, and simulation of real taps, swipes, and text input through the OS gesture pipeline. The whole surface is designed around what's cheap and fast for the agent to think about — lean responses by default, low vision-token cost on screenshots, a focused set of tools instead of overwhelming dumps.
6
6
 
7
7
  ```
8
8
  AI Agent / Cursor / Claude Code --stdio/MCP--> Node server --WebSocket--> RN app (device)
@@ -14,15 +14,17 @@ AI Agent / Cursor / Claude Code --stdio/MCP--> Node server --WebSocket--> RN app
14
14
 
15
15
  A few concrete scenarios this unlocks:
16
16
 
17
- - **End-to-end automation without a separate test harness.** Describe a multi-step flow in natural language "sign in, open settings, flip the notifications toggle, verify the confirmation toast" and an agent walks it: locates components by name/testID, fires real taps through the OS gesture pipeline, asserts on the resulting state, and reports back.
18
- - **Interactive inspection of a live app from your editor.** Ask "what screen am I on?", "what React Query keys are stale?", "what did the last POST return?", "which translation keys are missing in the current locale?" no rebuild, no DevTools panel, no "add more logs and reload" loop.
19
- - **Debug gesture-arbitration bugs that unit tests can't catch.** `host__tap` goes through the real iOS/Android touch pipeline, so issues like "the close button inside a horizontally-scrolling list swallows taps" surface naturally. `fiber_tree__invoke` bypasses the pipeline for the rare cases you want to call `onPress` directly.
20
- - **Write your own tools from inside components.** `useMcpTool`/`useMcpState`/`useMcpModule` let a component expose a named state key or an ad-hoc tool. Agents can then read feature-flag state, force a particular loading scenario, or trigger an internal-only action without you shipping a debug menu.
17
+ - **Drive multiple devices in parallel from one agent session.** iOS simulator, Android emulator, physical deviceany mix attaches to the same server. The agent can walk the same flow across platforms side-by-side, catching visual or behavioural regressions that show up on one OS but not the other, without ever leaving the editor.
18
+ - **End-to-end automation without a separate test harness.** Describe a multi-step flow in natural language "sign in, open settings, flip the notifications toggle, verify the confirmation toast" and the agent walks it: locates the right components, fires real taps through the OS gesture pipeline, asserts on the resulting state, and reports back.
19
+ - **Interactive inspection of a live app from your editor.** Ask "what screen am I on?", "what's in the request cache?", "what did the last POST return?", "what values are in app state right now?" no rebuild, no DevTools panel, no "add more logs and reload" loop.
20
+ - **Debug gesture-arbitration bugs that unit tests can't catch.** Taps go through the real iOS/Android touch pipeline, so issues like "the close button inside a horizontally-scrolling list swallows taps" surface naturally and when you need to sidestep the pipeline (call a prop directly, in a spot a real finger can't reach) the bridge offers that too.
21
+ - **Expose your own inspection points from inside components.** A component can register a named state key or an ad-hoc action from its own lifecycle. Agents then read feature-flag state, force a particular loading scenario, or trigger an internal-only action without you shipping a debug menu.
21
22
 
22
- Everything the library adds to your bundle is stripped in production builds via the companion babel plugin so you can wire it up once and leave it in, without shipping it to users.
23
+ Everything the library adds to your bundle is stripped from production builds by default — wire it up once and leave it in, without shipping it to users.
23
24
 
24
25
  ## Example scenarios
25
26
 
27
+ - **Deep runtime-state analysis on demand.** Ask "why is this screen blank?" or "why did the last submission fail?" — the agent cross-references what's mounted in the UI, where the user is in the app, what the network has been doing, what errors fired, and any state the app has opted into exposing. All from the running runtime, no extra logging or rebuild. The same pass can be scoped to a specific moment ("state right after I tap submit") instead of a stale snapshot.
26
28
  - **Reproduce a bug from a ticket, fix it, verify the fix.** The agent reads the reproduction steps, drives the app into the failing state through real taps and swipes, confirms the bug, edits the relevant source, then replays the same sequence to verify the fix — all in one editor session, no rebuilds between steps.
27
29
  - **End-to-end flow narrated in plain language.** "Sign in, add an item to the cart, go through checkout, verify the total matches the expected value, screenshot the final screen, and give me a network traffic summary." The agent drives real taps, checks state at each step, snapshots the key screens, and hands back captured request counts / durations / errors as evidence.
28
30
  - **Cross-platform parity check.** One agent holds two connected clients, runs the same tap sequence on iOS and Android in parallel, captures screenshots, and points out the differences — catches platform-specific regressions after an RN upgrade, shared-component refactor, or native change.
@@ -70,7 +72,7 @@ export const App = () => {
70
72
 
71
73
  These modules register automatically on mount — no prop required:
72
74
 
73
- `alert`, `console`, `device`, `errors`, `network`, `fiber_tree`
75
+ `alert`, `console`, `device`, `errors`, `log_box`, `network`, `fiber_tree`
74
76
 
75
77
  If the dependency lives deeper in the tree (e.g. the `QueryClient` is created inside a feature-specific provider), skip the prop and use `useMcpModule` there instead — see [Hooks](#hooks).
76
78
 
@@ -132,7 +134,19 @@ iOS simulators share localhost with the host machine, no forwarding needed.
132
134
 
133
135
  ### 4. Run
134
136
 
135
- Start Metro + your app. The `McpProvider` connects to `ws://localhost:8347` on mount. The agent calls `connection_status` to confirm; after that every tool is callable.
137
+ Start Metro + your app. The `McpProvider` connects to `ws://localhost:8347` on mount.
138
+
139
+ From your agent, a typical first session looks like:
140
+
141
+ ```
142
+ connection_status
143
+ → { clientCount: 1, clients: [{ id: "ios-1", label: "iPhone 17 Pro", ... }] }
144
+
145
+ list_tools { compact: true }
146
+ → catalog of every module registered by the app, grouped by client
147
+ ```
148
+
149
+ After that, every tool is callable by name via `call`. If the server isn't running yet, the provider just retries silently — no crash, no error toast.
136
150
 
137
151
  ## `McpProvider` reference
138
152
 
@@ -152,11 +166,12 @@ Wrap your whole app in it — every optional prop opts a module in when supplied
152
166
 
153
167
  ## MCP server tools
154
168
 
155
- The Node server exposes a small set of entry-point tools agents use directly — you don't register or configure them. `call` / `list_tools` / `describe_tool` / `connection_status` / `state_get` / `state_list` cover discovery and dispatch, plus two test-automation helpers: `wait_until` (poll a tool until a predicate holds, replacing screenshot-in-a-loop + sleep) and `assert` (single-shot checkpoint with a standardized diff on failure).
156
-
157
- ## Multi-client
169
+ The Node server exposes a small set of entry-point tools agents use directly — you don't register or configure them:
158
170
 
159
- One server can hold multiple RN clients at once iOS simulator, Android emulator, physical device, any mix. Useful for driving iOS and Android builds of the same app in lockstep from a single agent session.
171
+ - **Discovery & dispatch**`connection_status`, `list_tools`, `describe_tool`, `call`.
172
+ - **Reactive state** — `state_get`, `state_list` (read values exposed via `useMcpState`).
173
+ - **Test automation** — `wait_until` (poll any tool until a predicate holds, replacing screenshot-in-a-loop + sleep) and `assert` (single-shot checkpoint with a standardized diff on failure).
174
+ - **UI-level waits** — `fiber_tree__query` has a built-in `waitFor: { until: "appear" | "disappear", stable? }` option; see the [fiber_tree section](#fiber_tree).
160
175
 
161
176
  ## Host tools (device-level control)
162
177
 
@@ -169,18 +184,28 @@ What you get:
169
184
  - **Screenshots** — WebP, auto-diffing (`unchanged: true` on identical frames). Pass `region` in physical pixels to crop to a specific element and keep vision-token cost low.
170
185
  - **App lifecycle** — launch, terminate, restart.
171
186
  - **Device enumeration** — list sims / emulators / devices, annotated with active MCP clients.
172
- - **Symbolication** — `symbolicate` resolves raw JS stack traces to source paths via Metro.
173
187
 
174
188
  iOS input goes through a bundled `ios-hid` Swift binary that injects HID events directly into iOS Simulator via private frameworks — no external daemons to install or keep running.
175
189
 
190
+ ## Metro tools (dev-server control plane)
191
+
192
+ Separate module talking HTTP / WebSocket to the Metro instance the app was bundled from.
193
+
194
+ - **Auto-detected URL per client.** Each attached app reports its actual Metro origin at handshake (via RN's `getDevServer()`). Non-default ports (`yarn start --port 8082`) and LAN-connected physical devices work without an explicit `metroUrl` arg.
195
+ - **`metro__symbolicate`** — maps a raw Hermes / V8 stack trace back to source paths via Metro's `/symbolicate`. Pairs naturally with `errors__get_errors` and `log_box__get_logs` (each entry has parsed `stackFrames` ready to feed in).
196
+ - **`metro__reload`** — triggers a full JS reload on every attached app (`POST /reload`).
197
+ - **`metro__status`** — cheap ping before a chain of Metro calls.
198
+ - **`metro__open_in_editor({ file, lineNumber, column? })`** — jumps `$REACT_EDITOR` to the exact line. Natural finisher after a symbolication flow.
199
+ - **`metro__get_events`** — reads a server-side ring buffer (200 events) fed by a lazy WebSocket to Metro's `/events` stream. Surfaces `bundle_build_failed`, `bundling_error`, `hmr_client_error`, `hmr_update`, `client_log`, etc. Key use: detecting silent HMR failures when the red box doesn't appear.
200
+
176
201
  ## Hooks
177
202
 
178
203
  For when the thing you want to expose lives deeper than `McpProvider`:
179
204
 
180
205
  ```ts
181
- useMcpState(key, factory, deps) // expose reactive state to the agent
182
- useMcpTool(name, factory, deps) // register an ad-hoc tool tied to the component lifecycle
183
- useMcpModule(factory, deps) // register a whole module from inside a component
206
+ useMcpState(key, factory, deps); // expose reactive state to the agent
207
+ useMcpTool(name, factory, deps); // register an ad-hoc tool tied to the component lifecycle
208
+ useMcpModule(factory, deps); // register a whole module from inside a component
184
209
  ```
185
210
 
186
211
  Each follows `useMemo` / `useEffect` semantics — the factory re-runs on dep changes, registration cleans up on unmount.
@@ -191,10 +216,17 @@ const UserProvider = ({ children }) => {
191
216
 
192
217
  useMcpState('user', () => ({ id: user?.id, loggedIn: user !== null }), [user]);
193
218
 
194
- useMcpTool('logout', () => ({
195
- description: 'Log out the current user',
196
- handler: async () => { await logout(); return { success: true }; },
197
- }), [logout]);
219
+ useMcpTool(
220
+ 'logout',
221
+ () => ({
222
+ description: 'Log out the current user',
223
+ handler: async () => {
224
+ await logout();
225
+ return { success: true };
226
+ },
227
+ }),
228
+ [logout]
229
+ );
198
230
 
199
231
  return <UserContext.Provider value={user}>{children}</UserContext.Provider>;
200
232
  };
@@ -240,11 +272,18 @@ Read-only view of platform facts (OS, version, dimensions in DP and physical pix
240
272
 
241
273
  ### errors
242
274
 
243
- Captures unhandled JS errors (via `ErrorUtils.setGlobalHandler`) and unhandled promise rejections. Each entry has parsed `stackFrames` designed to feed into `host__symbolicate` — one call resolves bundle paths back to `src/components/Foo.tsx:42:10`.
275
+ Captures unhandled JS errors (via `ErrorUtils.setGlobalHandler`) and unhandled promise rejections. Each entry has parsed `stackFrames` designed to feed into `metro__symbolicate` — one call resolves bundle paths back to `src/components/Foo.tsx:42:10`.
244
276
 
245
277
  ### fiber_tree
246
278
 
247
- The heart of UI inspection. Search the component tree via a chained `query`: each step narrows the result with criteria (name / testID / mcpId / text / props matcher / not / any) and a scope (descendants / ancestors / siblings / screen / nearest_host / …). Wrapper cascades (`PressableView → Pressable → View → RCTView`) collapse to the topmost by default. `bounds` come back in physical pixels and pair directly with `host__tap` or use `host__tap_fiber` for the locate-and-tap shortcut.
279
+ The heart of UI inspection. Search the component tree via a chained `query`: each step narrows the result by **criteria** within a given **scope**, with multiple matches fanning out into the next step.
280
+
281
+ - **Criteria**: `name`, `testID`, `mcpId`, `text`, `hasProps`, `props` (equality + `contains`), `not`, `any`.
282
+ - **Scopes**: `descendants`, `children`, `parent`, `ancestors`, `siblings`, `self`, `screen` (focused screen fiber from React Navigation), `nearest_host` (closest host component).
283
+
284
+ Wrapper cascades (`PressableView → Pressable → View → RCTView`) collapse to the topmost by default, so overlapping matches don't drown the result. `bounds` come back in physical pixels and pair directly with `host__tap` — or use `host__tap_fiber` for the locate-and-tap shortcut.
285
+
286
+ Pass `waitFor: { until: 'appear' | 'disappear', timeout?, interval?, stable? }` to poll the same query until the target state is reached — e.g. `waitFor: { until: 'appear', stable: 300 }` waits for a screen to mount and hold stable for 300ms. Response carries `{ waited, attempts, elapsedMs, timedOut, stableFor? }` alongside the usual matches.
248
287
 
249
288
  ### i18n
250
289
 
@@ -268,7 +307,7 @@ networkModule({
268
307
  bodyMaxBytes: 10_000,
269
308
  ignoreUrls: ['https://analytics.example.com', /\.png$/],
270
309
  redactHeaders: ['authorization'], // or false to disable
271
- redactBodyKeys: ['password'], // or false to disable
310
+ redactBodyKeys: ['password'], // or false to disable
272
311
  });
273
312
  ```
274
313
 
package/dist/bin/ios-hid CHANGED
Binary file
@@ -1,4 +1,5 @@
1
1
  import { type McpModule, type ToolHandler } from '../../client/models/types';
2
+ import { type DevServerInfo } from '../../shared/protocol';
2
3
  export declare class McpClient {
3
4
  private static instance;
4
5
  private connection;
@@ -12,6 +13,7 @@ export declare class McpClient {
12
13
  appVersion?: string;
13
14
  bundleId?: string;
14
15
  debug?: boolean;
16
+ devServer?: DevServerInfo;
15
17
  deviceId?: string;
16
18
  host?: string;
17
19
  label?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"McpClient.d.ts","sourceRoot":"","sources":["../../../src/client/core/McpClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAsHzE,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA0B;IAEjD,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,YAAY,CAAsB;IAE1C,OAAO;IAuCP,OAAO,CAAC,iBAAiB;IAsBzB,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC1B,OAAO,CAAC,EAAE,MAAM,C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Y,CAAsB;IAE1C,OAAO;IAuCP,OAAO,CAAC,iBAAiB;IAsBzB,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,SAAS;IA2Bb,MAAM,CAAC,WAAW,IAAI,SAAS;IAS/B,OAAO,IAAI,IAAI;IAMf,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAInC,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAMvC,eAAe,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI;IAa3C,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI;IAcnD,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQ9B,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAS3C,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAUlC,OAAO,CAAC,GAAG;IASX,OAAO,CAAC,gBAAgB;CAuBzB"}
@@ -45,6 +45,33 @@ const originalConsoleLog = console.log.bind(console);
45
45
  const isUsefulString = (value) => {
46
46
  return typeof value === 'string' && value.length > 0 && value.toLowerCase() !== 'unknown';
47
47
  };
48
+ // RN ships `getDevServer()` which reads NativeSourceCode.scriptURL — this is
49
+ // the actual Metro origin the bundle was loaded from. In production builds the
50
+ // script URL is a local file and `bundleLoadedFromServer` is false; we skip
51
+ // the field in that case so Metro-facing tools fail fast.
52
+ const detectDevServer = () => {
53
+ try {
54
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
55
+ const mod = require('react-native/Libraries/Core/Devtools/getDevServer');
56
+ const getDevServer = (mod.default ?? mod);
57
+ const info = getDevServer();
58
+ if (!info.bundleLoadedFromServer || typeof info.url !== 'string') {
59
+ return undefined;
60
+ }
61
+ const url = info.url.replace(/\/$/, '');
62
+ const parsed = new URL(url);
63
+ const port = parsed.port ? Number(parsed.port) : parsed.protocol === 'https:' ? 443 : 80;
64
+ return {
65
+ bundleLoadedFromServer: true,
66
+ host: parsed.hostname,
67
+ port,
68
+ url,
69
+ };
70
+ }
71
+ catch {
72
+ return undefined;
73
+ }
74
+ };
48
75
  const autoDetectIdentity = () => {
49
76
  const out = {};
50
77
  try {
@@ -58,6 +85,10 @@ const autoDetectIdentity = () => {
58
85
  catch {
59
86
  // not running inside a React Native bundle — that's fine
60
87
  }
88
+ const devServer = detectDevServer();
89
+ if (devServer) {
90
+ out.devServer = devServer;
91
+ }
61
92
  try {
62
93
  // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
63
94
  const di = require('react-native-device-info');
@@ -163,6 +194,7 @@ class McpClient {
163
194
  appName: options?.appName ?? auto.appName,
164
195
  appVersion: options?.appVersion ?? auto.appVersion,
165
196
  bundleId: options?.bundleId ?? auto.bundleId,
197
+ devServer: options?.devServer ?? auto.devServer,
166
198
  deviceId: options?.deviceId ?? auto.deviceId,
167
199
  label: options?.label ?? auto.label,
168
200
  platform: options?.platform ?? auto.platform,
@@ -260,6 +292,7 @@ class McpClient {
260
292
  appName: this.identity.appName,
261
293
  appVersion: this.identity.appVersion,
262
294
  bundleId: this.identity.bundleId,
295
+ devServer: this.identity.devServer,
263
296
  deviceId: this.identity.deviceId,
264
297
  label: this.identity.label,
265
298
  modules: descriptors,
@@ -1 +1 @@
1
- {"version":3,"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ChC,eAAe,EAAE,2BAAgB;YACjC,IAAI,EAAE,cAAc;SACrB,CAAC,CAAC;IACL,CAAC;;AAzNH,8BA0NC"}
@@ -1 +1 @@
1
- {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../src/modules/console/console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,KAAK,oBAAoB,EAAgC,MAAM,SAAS,CAAC;AAoElF,eAAO,MAAM,aAAa,aAAc,oBAAoB,KAAG,SAkI9D,CAAC"}
1
+ {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../src/modules/console/console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,KAAK,oBAAoB,EAAgC,MAAM,SAAS,CAAC;AAkHlF,eAAO,MAAM,aAAa,aAAc,oBAAoB,KAAG,SA2G9D,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.consoleModule = void 0;
4
+ const slice_1 = require("../../shared/slice");
4
5
  const ALL_LEVELS = ['debug', 'error', 'info', 'log', 'warn'];
5
6
  const DEFAULT_MAX_ENTRIES = 100;
6
7
  const DEFAULT_STACK_LEVELS = ['error', 'warn'];
@@ -55,57 +56,88 @@ const captureStack = () => {
55
56
  // Remove Error, captureStack, addEntry, console[level] wrapper frames
56
57
  return lines.slice(4).join('\n');
57
58
  };
58
- const consoleModule = (options) => {
59
- const levels = options?.levels ?? ALL_LEVELS;
60
- const maxEntries = options?.maxEntries ?? DEFAULT_MAX_ENTRIES;
61
- const stackTraceLevels = options?.stackTrace === true
62
- ? ALL_LEVELS
63
- : Array.isArray(options?.stackTrace)
64
- ? options.stackTrace
65
- : options?.stackTrace === false
66
- ? []
67
- : DEFAULT_STACK_LEVELS;
68
- const buffer = [];
69
- const originals = new Map();
70
- const addEntry = (level, args) => {
71
- const entry = {
72
- args: args.map((arg) => {
73
- return serializeArg(arg);
74
- }),
75
- level,
76
- timestamp: new Date().toISOString(),
77
- };
78
- if (stackTraceLevels.includes(level)) {
79
- entry.stack = captureStack();
80
- }
81
- buffer.push(entry);
82
- if (buffer.length > maxEntries) {
83
- buffer.splice(0, buffer.length - maxEntries);
84
- }
59
+ // === Module-level capture state — auto-starts at import time. ===
60
+ //
61
+ // Rationale: when `McpProvider` mounts, its `useEffect` runs after React's
62
+ // first render any console.log fired during bundle evaluation or the first
63
+ // render would be lost. Patching at module import time (before React boots)
64
+ // closes that gap. The factory below adopts the pre-existing buffer and
65
+ // applies caller-supplied options retroactively.
66
+ const buffer = [];
67
+ let maxEntries = DEFAULT_MAX_ENTRIES;
68
+ let capturedLevels = new Set(ALL_LEVELS);
69
+ let stackLevels = new Set(DEFAULT_STACK_LEVELS);
70
+ const addEntry = (level, args) => {
71
+ if (!capturedLevels.has(level))
72
+ return;
73
+ const entry = {
74
+ args: args.map((arg) => {
75
+ return serializeArg(arg);
76
+ }),
77
+ level,
78
+ timestamp: new Date().toISOString(),
85
79
  };
86
- for (const level of levels) {
80
+ if (stackLevels.has(level)) {
81
+ entry.stack = captureStack();
82
+ }
83
+ buffer.push(entry);
84
+ if (buffer.length > maxEntries) {
85
+ buffer.splice(0, buffer.length - maxEntries);
86
+ }
87
+ };
88
+ let patchesInstalled = false;
89
+ const installPatches = () => {
90
+ if (patchesInstalled)
91
+ return;
92
+ patchesInstalled = true;
93
+ for (const level of ALL_LEVELS) {
87
94
  const original = console[level];
88
- originals.set(level, original);
89
95
  console[level] = (...args) => {
90
96
  addEntry(level, args);
91
97
  original.apply(console, args);
92
98
  };
93
99
  }
94
- const filterByLevel = (level, limit) => {
100
+ };
101
+ installPatches();
102
+ const consoleModule = (options) => {
103
+ // Apply options retroactively to the already-running buffer.
104
+ if (typeof options?.maxEntries === 'number') {
105
+ maxEntries = options.maxEntries;
106
+ if (buffer.length > maxEntries) {
107
+ buffer.splice(0, buffer.length - maxEntries);
108
+ }
109
+ }
110
+ if (options?.levels) {
111
+ capturedLevels = new Set(options.levels);
112
+ }
113
+ if (options?.stackTrace === true) {
114
+ stackLevels = new Set(ALL_LEVELS);
115
+ }
116
+ else if (options?.stackTrace === false) {
117
+ stackLevels = new Set();
118
+ }
119
+ else if (Array.isArray(options?.stackTrace)) {
120
+ stackLevels = new Set(options.stackTrace);
121
+ }
122
+ const filterByLevel = (level, slice) => {
95
123
  const filtered = buffer.filter((entry) => {
96
124
  return entry.level === level;
97
125
  });
98
- if (limit) {
99
- return filtered.slice(-limit);
100
- }
101
- return filtered;
126
+ return (0, slice_1.applySlice)(filtered, (0, slice_1.parseSliceArg)(slice));
127
+ };
128
+ const sliceSchema = {
129
+ description: (0, slice_1.sliceSchemaDescription)('Default omitted → every matching entry is returned.'),
130
+ examples: [[-10], [-20, -10], [0, 50]],
131
+ type: 'array',
102
132
  };
103
133
  return {
104
134
  description: `Ring buffer of console.log/warn/error/info/debug.
105
135
 
106
136
  Complex values (Errors, Dates, class instances, cyclic refs, functions,
107
137
  Symbols) are serialized safely. Stack traces can be captured per level.
108
- Buffer size and captured levels are configurable via consoleModule options.`,
138
+ Capture starts at module-import time (before React mounts) so cold-start
139
+ logs are not lost. Buffer size and captured levels are configurable via
140
+ consoleModule options.`,
109
141
  name: 'console',
110
142
  tools: {
111
143
  clear_logs: {
@@ -118,32 +150,32 @@ Buffer size and captured levels are configurable via consoleModule options.`,
118
150
  get_debug: {
119
151
  description: 'Return console.debug entries.',
120
152
  handler: (args) => {
121
- return filterByLevel('debug', args.limit);
153
+ return filterByLevel('debug', args.slice);
122
154
  },
123
155
  inputSchema: {
124
- limit: { description: 'Max entries to return.', type: 'number' },
156
+ slice: sliceSchema,
125
157
  },
126
158
  },
127
159
  get_errors: {
128
160
  description: 'Return console.error entries.',
129
161
  handler: (args) => {
130
- return filterByLevel('error', args.limit);
162
+ return filterByLevel('error', args.slice);
131
163
  },
132
164
  inputSchema: {
133
- limit: { description: 'Max entries to return.', type: 'number' },
165
+ slice: sliceSchema,
134
166
  },
135
167
  },
136
168
  get_info: {
137
169
  description: 'Return console.info entries.',
138
170
  handler: (args) => {
139
- return filterByLevel('info', args.limit);
171
+ return filterByLevel('info', args.slice);
140
172
  },
141
173
  inputSchema: {
142
- limit: { description: 'Max entries to return.', type: 'number' },
174
+ slice: sliceSchema,
143
175
  },
144
176
  },
145
177
  get_logs: {
146
- description: 'Return all log entries, optionally filtered by level and limit.',
178
+ description: 'Return all log entries, optionally filtered by level and slice.',
147
179
  handler: (args) => {
148
180
  let result = [...buffer];
149
181
  if (args.level) {
@@ -151,10 +183,7 @@ Buffer size and captured levels are configurable via consoleModule options.`,
151
183
  return entry.level === args.level;
152
184
  });
153
185
  }
154
- if (args.limit) {
155
- result = result.slice(-args.limit);
156
- }
157
- return result;
186
+ return (0, slice_1.applySlice)(result, (0, slice_1.parseSliceArg)(args.slice));
158
187
  },
159
188
  inputSchema: {
160
189
  level: {
@@ -162,16 +191,16 @@ Buffer size and captured levels are configurable via consoleModule options.`,
162
191
  examples: ['log', 'warn', 'error', 'info', 'debug'],
163
192
  type: 'string',
164
193
  },
165
- limit: { description: 'Max entries to return.', type: 'number' },
194
+ slice: sliceSchema,
166
195
  },
167
196
  },
168
197
  get_warnings: {
169
198
  description: 'Return console.warn entries.',
170
199
  handler: (args) => {
171
- return filterByLevel('warn', args.limit);
200
+ return filterByLevel('warn', args.slice);
172
201
  },
173
202
  inputSchema: {
174
- limit: { description: 'Max entries to return.', type: 'number' },
203
+ slice: sliceSchema,
175
204
  },
176
205
  },
177
206
  },
@@ -1 +1 @@
1
- {"version":3,"file":"console.js","sourceRoot":"","sources":["../../../src/modules/console/console.ts"],"names":[],"mappings":";;;AAIA,MAAM,UAAU,GAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACzE,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAA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,MAAM,CAAC,CAAC;oBACzB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;wBACf,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;4BAC/B,OAAO,KAAK,CAAC,KAAK,KAAM,IAAI,CAAC,KAAkB,CAAC;wBAClD,CAAC,CAAC,CAAC;oBACL,CAAC;oBACD,OAAO,IAAA,kBAAU,EAAC,MAAM,EAAE,IAAA,qBAAa,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvD,CAAC;gBACD,WAAW,EAAE;oBACX,KAAK,EAAE;wBACL,WAAW,EAAE,kBAAkB;wBAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;wBACnD,IAAI,EAAE,QAAQ;qBACf;oBACD,KAAK,EAAE,WAAW;iBACnB;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,8BAA8B;gBAC3C,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;oBAChB,OAAO,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC3C,CAAC;gBACD,WAAW,EAAE;oBACX,KAAK,EAAE,WAAW;iBACnB;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,aAAa,iBA2GxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/modules/errors/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,SAAS,CAAC;AAoCjB,eAAO,MAAM,YAAY,aAAc,mBAAmB,KAAG,SAwL5D,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/modules/errors/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,SAAS,CAAC;AAiHjB,eAAO,MAAM,YAAY,aAAc,mBAAmB,KAAG,SAiI5D,CAAC"}