Let AI agents see, understand, and interact with your React Native app running on Android emulator or iOS simulator — through a single MCP server. Point your MCP client at this server and an agent can connect to your app, read logs, inspect the UI, tap buttons, type text, scroll, take screenshots, and reload — all without leaving the conversation. - Android + iOS — one server handles both platform
Add this skill
npx mdskills install zersys/rn-debug-mcpComprehensive React Native debugging server with rich UI inspection, testID-first interaction, and multi-platform session management
1# React Native Debug MCP23Let AI agents see, understand, and interact with your React Native app running on Android emulator or iOS simulator — through a single MCP server.45Point your MCP client at this server and an agent can connect to your app, read logs, inspect the UI, tap buttons, type text, scroll, take screenshots, and reload — all without leaving the conversation.67https://github.com/user-attachments/assets/0d5a5235-9c67-4d79-b30f-de0132be06cd89## Features1011### Connect and Control1213- **Android + iOS** — one server handles both platforms14- **Multi-session** — debug multiple devices or apps at the same time15- **Hot reload** — reload your app instantly via Metro; automatic fallback to native reload when Metro is unavailable1617### See What's Happening1819- **Live logs** — stream device logs in real time (Android `logcat` / iOS `simctl`)20- **Error filtering** — surface only errors so the agent focuses on what matters21- **Network inspector** — capture HTTP requests and responses with cursor-based polling22- **Screenshots** — capture the screen as a PNG image the agent can see inline2324### Understand the UI2526- **UI tree** — get the full view hierarchy (Android UIAutomator / iOS WebDriverAgent)27- **Visible elements** — list what's on screen with text, bounds, and testIDs28- **Screen context** — get the current activity/screen name so the agent knows where it is2930### Interact with the App3132- **Tap, scroll, type, back** — drive the app like a real user33- **Tap by testID** — target elements by `testID` instead of fragile coordinates34- **testID discovery** — list all testIDs on screen, search by exact or partial match35- **testID remediation** — when a testID is missing, the agent gets a ready-to-paste code fix and can reload to verify3637## Requirements3839- Node.js 20+40- Android SDK / `adb` on `PATH`41- Xcode command line tools (`xcrun`) and iOS Simulator (for iOS)42- React Native app running on emulator/simulator43- Metro running (default: `8081`)44- WebDriverAgent reachable for iOS (default: `http://127.0.0.1:8100`)4546## Quickstart4748### Option A: Global install (use from any project)4950```bash51npm install -g rn-debug-mcp52```5354Add to your MCP client config:5556```json57{58 "mcpServers": {59 "rn-debug": {60 "command": "npx",61 "args": ["-y", "rn-debug-mcp"],62 "env": {63 "WDA_BASE_URL": "http://127.0.0.1:8100"64 }65 }66 }67}68```6970### Option B: Local dev dependency (per-project)7172```bash73npm install -D rn-debug-mcp74npm run build75```7677Add to your MCP client config:7879```json80{81 "mcpServers": {82 "rn-debug": {83 "command": "node",84 "args": ["/ABS/PATH/TO/node_modules/rn-debug-mcp/dist/src/index.js"],85 "env": {86 "WDA_BASE_URL": "http://127.0.0.1:8100"87 }88 }89 }90}91```9293## iOS Support9495iOS works automatically on first `connect_app({ platform: "ios" })`. WebDriverAgent sources are cloned and built transparently if not already present.9697- If WDA is already running on `:8100` (or the configured `WDA_BASE_URL`), the install/build is skipped entirely.98- Set `WDA_NO_AUTO_INSTALL=1` to disable automatic installation and require manual setup.99- Set `WDA_BASE_URL` to point to an externally managed WebDriverAgent instance.100101### Manual / Advanced Setup102103Install WDA sources manually:104105```bash106npx --no-install rndmcp install wda107```108109Run WDA standalone:110111```bash112npm run ios:wda113```114115Optional overrides:116117```bash118WDA_PROJECT_PATH="/abs/path/to/WebDriverAgent.xcodeproj" npm run ios:wda119WDA_DEVICE_ID="<booted-simulator-udid>" npm run ios:wda120WDA_DESTINATION='platform=iOS Simulator,name=iPhone 16' npm run ios:wda121```122123## Tools124125### Session and Connection126127- `connect_app({ platform?, deviceId?, metroPort? })`128- `list_sessions({})`129- `set_active_session({ sessionId })`130- `close_session({ sessionId })`131- `get_connection_status({ sessionId? })`132- `disconnect_app({ sessionId? })`133- `reload_app({ sessionId? })`134135### Logs, Errors, and Network136137- `get_logs({ sessionId?, sinceCursor?, limit?, levels?, tags?, sources? })`138- `get_errors({ sessionId?, sinceCursor?, limit?, levels?, tags?, sources? })`139- `get_network_requests({ sessionId?, sinceCursor?, limit?, phases?, methods?, statuses?, urlContains?, sources? })`140141### UI and Context142143- `get_screen_context({ sessionId? })`144- `get_ui_tree({ sessionId?, maxDepth?, maxNodes? })`145- `get_visible_elements({ sessionId?, maxDepth?, maxNodes?, limit?, clickableOnly?, includeTextless?, skipVisibilityCheck?, testId?, testIdMatch? })`146- `get_screen_test_ids({ sessionId?, maxDepth?, maxNodes?, limit?, includeNonClickable?, includeInvisible? })`147- `get_elements_by_test_id({ sessionId?, testId, maxDepth?, maxNodes?, limit?, clickableOnly?, includeTextless?, skipVisibilityCheck?, testIdMatch? })`148- `get_test_id_remediation_plan({ sessionId?, desiredAction, desiredTestId?, matchMode? })`149150### Interaction151152- `tap({ sessionId?, x, y })`153- `tap_element({ sessionId?, elementId, maxDepth?, maxNodes? })`154- `type_text({ sessionId?, text, submit? })`155- `press_back({ sessionId? })`156- `scroll({ sessionId?, direction, distanceRatio?, durationMs? })`157- `take_screenshot({ sessionId? })`158159## Recommended Agent Flow (testID-first)1601611. `get_elements_by_test_id` with `testIdMatch: "exact"`.1622. If unknown IDs, call `get_screen_test_ids`.1633. If empty, retry `get_elements_by_test_id` with `testIdMatch: "contains"`.1644. If still empty:165 - call `get_screen_context`166 - call `get_test_id_remediation_plan`167 - patch app code with suggested testID168 - call `reload_app`169 - retry exact testID lookup1705. If unresolved:171 - try `tap_element` from visible candidates172 - fallback to `tap({ x, y })`173 - use `scroll`, `press_back`, and `type_text` for navigation/input174175testID naming convention: `screen.element.action` (example: `checkout.submit.button`).176177## Platform Notes178179- `connect_app` defaults to `platform: "android"` for backward compatibility.180- iOS tap coordinates use point space (WDA coordinates), not screenshot pixels.181- If converting screenshot pixels to iOS points:182 - `pointX = round(pixelX / scaleFactor)`183 - `pointY = round(pixelY / scaleFactor)`184- `get_elements_by_test_id` defaults:185 - `skipVisibilityCheck: true` (RN-friendly)186 - `clickableOnly: false` (broader matching)187- `get_screen_test_ids` default: `includeInvisible: true`.188189## Development190191```bash192npm run typecheck193npm test194```195196CLI usage:197198```bash199rndmcp # Start MCP server over stdio200rndmcp install wda # Clone WebDriverAgent into this package201```202203## Troubleshooting204205- iOS connect reports missing WDA:206 - WDA is auto-installed on first `connect_app({ platform: "ios" })` unless `WDA_NO_AUTO_INSTALL=1`207 - set `WDA_BASE_URL` to an already running WDA, or208 - run `rndmcp install wda` and then `npm run ios:wda` for manual setup209- Reload fallbacks:210 - Android: ADB broadcast/key events211 - iOS simulator: `Cmd+R` keyboard trigger via `osascript`212
Full transparency — inspect the skill content before installing.