React Native Debug MCP
Enables AI agents to inspect, log, and control React Native apps on Android emulators or iOS simulators, including UI tree, tap, scroll, and hot reload.
README
React Native Debug MCP
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.
https://github.com/user-attachments/assets/0d5a5235-9c67-4d79-b30f-de0132be06cd
Features
Connect and Control
- Android + iOS — one server handles both platforms
- Multi-session — debug multiple devices or apps at the same time
- Hot reload — reload your app instantly via Metro; automatic fallback to native reload when Metro is unavailable
See What's Happening
- Live logs — stream device logs in real time (Android
logcat/ iOSsimctl) - Error filtering — surface only errors so the agent focuses on what matters
- Network inspector — capture HTTP requests and responses with cursor-based polling
- Screenshots — capture the screen as a PNG image the agent can see inline
Understand the UI
- UI tree — get the full view hierarchy (Android UIAutomator / iOS WebDriverAgent)
- Visible elements — list what's on screen with text, bounds, and testIDs
- Screen context — get the current activity/screen name so the agent knows where it is
Interact with the App
- Tap, scroll, type, back — drive the app like a real user
- Tap by testID — target elements by
testIDinstead of fragile coordinates - testID discovery — list all testIDs on screen, search by exact or partial match
- testID remediation — when a testID is missing, the agent gets a ready-to-paste code fix and can reload to verify
Requirements
- Node.js 20+
- Android SDK /
adbonPATH - Xcode command line tools (
xcrun) and iOS Simulator (for iOS) - React Native app running on emulator/simulator
- Metro running (default:
8081) - WebDriverAgent reachable for iOS (default:
http://127.0.0.1:8100)
Quickstart
Option A: Global install (use from any project)
npm install -g rn-debug-mcp
Add to your MCP client config:
{
"mcpServers": {
"rn-debug": {
"command": "npx",
"args": ["-y", "rn-debug-mcp"],
"env": {
"WDA_BASE_URL": "http://127.0.0.1:8100"
}
}
}
}
Option B: Local dev dependency (per-project)
npm install -D rn-debug-mcp
npm run build
Add to your MCP client config:
{
"mcpServers": {
"rn-debug": {
"command": "node",
"args": ["/ABS/PATH/TO/node_modules/rn-debug-mcp/dist/src/index.js"],
"env": {
"WDA_BASE_URL": "http://127.0.0.1:8100"
}
}
}
}
iOS Support
iOS works automatically on first connect_app({ platform: "ios" }). WebDriverAgent sources are cloned and built transparently if not already present.
- If WDA is already running on
:8100(or the configuredWDA_BASE_URL), the install/build is skipped entirely. - Set
WDA_NO_AUTO_INSTALL=1to disable automatic installation and require manual setup. - Set
WDA_BASE_URLto point to an externally managed WebDriverAgent instance.
Manual / Advanced Setup
Install WDA sources manually:
npx --no-install rndmcp install wda
Run WDA standalone:
npm run ios:wda
Optional overrides:
WDA_PROJECT_PATH="/abs/path/to/WebDriverAgent.xcodeproj" npm run ios:wda
WDA_DEVICE_ID="<booted-simulator-udid>" npm run ios:wda
WDA_DESTINATION='platform=iOS Simulator,name=iPhone 16' npm run ios:wda
Tools
Session and Connection
connect_app({ platform?, deviceId?, metroPort? })list_sessions({})set_active_session({ sessionId })close_session({ sessionId })get_connection_status({ sessionId? })disconnect_app({ sessionId? })reload_app({ sessionId? })
Logs, Errors, and Network
get_logs({ sessionId?, sinceCursor?, limit?, levels?, tags?, sources? })get_errors({ sessionId?, sinceCursor?, limit?, levels?, tags?, sources? })get_network_requests({ sessionId?, sinceCursor?, limit?, phases?, methods?, statuses?, urlContains?, sources? })
UI and Context
get_screen_context({ sessionId? })get_ui_tree({ sessionId?, maxDepth?, maxNodes? })get_visible_elements({ sessionId?, maxDepth?, maxNodes?, limit?, clickableOnly?, includeTextless?, skipVisibilityCheck?, testId?, testIdMatch? })get_screen_test_ids({ sessionId?, maxDepth?, maxNodes?, limit?, includeNonClickable?, includeInvisible? })get_elements_by_test_id({ sessionId?, testId, maxDepth?, maxNodes?, limit?, clickableOnly?, includeTextless?, skipVisibilityCheck?, testIdMatch? })get_test_id_remediation_plan({ sessionId?, desiredAction, desiredTestId?, matchMode? })
Interaction
tap({ sessionId?, x, y })tap_element({ sessionId?, elementId, maxDepth?, maxNodes? })type_text({ sessionId?, text, submit? })press_back({ sessionId? })scroll({ sessionId?, direction, distanceRatio?, durationMs? })take_screenshot({ sessionId? })
Recommended Agent Flow (testID-first)
get_elements_by_test_idwithtestIdMatch: "exact".- If unknown IDs, call
get_screen_test_ids. - If empty, retry
get_elements_by_test_idwithtestIdMatch: "contains". - If still empty:
- call
get_screen_context - call
get_test_id_remediation_plan - patch app code with suggested testID
- call
reload_app - retry exact testID lookup
- call
- If unresolved:
- try
tap_elementfrom visible candidates - fallback to
tap({ x, y }) - use
scroll,press_back, andtype_textfor navigation/input
- try
testID naming convention: screen.element.action (example: checkout.submit.button).
Platform Notes
connect_appdefaults toplatform: "android"for backward compatibility.- iOS tap coordinates use point space (WDA coordinates), not screenshot pixels.
- If converting screenshot pixels to iOS points:
pointX = round(pixelX / scaleFactor)pointY = round(pixelY / scaleFactor)
get_elements_by_test_iddefaults:skipVisibilityCheck: true(RN-friendly)clickableOnly: false(broader matching)
get_screen_test_idsdefault:includeInvisible: true.
Development
npm run typecheck
npm test
CLI usage:
rndmcp # Start MCP server over stdio
rndmcp install wda # Clone WebDriverAgent into this package
Troubleshooting
- iOS connect reports missing WDA:
- WDA is auto-installed on first
connect_app({ platform: "ios" })unlessWDA_NO_AUTO_INSTALL=1 - set
WDA_BASE_URLto an already running WDA, or - run
rndmcp install wdaand thennpm run ios:wdafor manual setup
- WDA is auto-installed on first
- Reload fallbacks:
- Android: ADB broadcast/key events
- iOS simulator:
Cmd+Rkeyboard trigger viaosascript
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。