react-native-devtools-mcp
Provides tools for interacting with Android emulators/devices via adb, including screenshots, UI hierarchy inspection, taps, typing, scrolling, button presses, deep links, and device log capture.
Provides tools for interacting with iOS Simulators via xcrun simctl and Facebook IDB, including screenshots, UI accessibility hierarchy inspection, taps, typing, scrolling, button presses, deep links, screen recording, and device log capture.
Connects to the Metro bundler over CDP to check bundler and runtime status, capture JS console logs, and execute JavaScript inside the running React Native app.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@react-native-devtools-mcp take a screenshot of the current app screen"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
react-native-devtools-mcp
MCP server that gives AI agents eyes, hands, and X-ray vision into any React Native app running in an iOS simulator or Android emulator.
Capture screenshots and screen recordings
Inspect the full UI accessibility tree with element labels, types, and bounds
Interact with the app: tap, type, scroll, press buttons, open deep links
Capture device-level console logs (simctl/logcat) and JS-level console output (via Metro CDP)
Execute arbitrary JavaScript inside the running app
Check Metro bundler status and connected runtimes
Works with any MCP-compatible AI agent: OpenCode, Claude Code, Cursor, Windsurf, etc.
Prerequisites
Node.js >= 20
iOS: Xcode with Simulator, plus Facebook IDB for view hierarchy:
brew tap facebook/fb && brew install idb-companion pip3 install fb-idbAndroid: Android SDK with
adbon PATH and a configured emulator
Related MCP server: mobile-mcp
Quick Start
1. Build
cd ~/react-native-devtools-mcp
npm install
npm run build2. Boot a simulator or emulator
# iOS
xcrun simctl boot "iPhone 15 Pro"
# Android
emulator -avd <avd_name>3. Configure your AI tool
OpenCode — add to ~/.config/opencode/opencode.json:
{
"mcpServers": {
"react-native": {
"command": "node",
"args": ["/absolute/path/to/react-native-devtools-mcp/dist/index.js"]
}
}
}Claude Code:
claude mcp add react-native node /absolute/path/to/react-native-devtools-mcp/dist/index.jsCursor — add to .cursor/mcp.json:
{
"mcpServers": {
"react-native": {
"command": "node",
"args": ["/absolute/path/to/react-native-devtools-mcp/dist/index.js"]
}
}
}Tools
Observation
Tool | Description | Params |
| Capture screen as PNG image |
|
| Dump UI accessibility tree with labels, types, bounds |
|
| Device/simulator info and connection status | none |
| Device-level console logs (simctl log / adb logcat) |
|
| Metro bundler status and connected RN runtimes | none |
| JS console output (console.log/warn/error) via Metro CDP |
|
Interaction
Tool | Description | Params |
| Tap at screen coordinates |
|
| Type into focused input field |
|
| Press device button |
|
| Scroll in a direction |
|
| Open URL or deep link in app |
|
| Execute JavaScript in the running app via Metro CDP |
|
Utility
Tool | Description | Params |
| Health check — device status | none |
| Start screen recording |
|
| Stop recording, return file path | none |
| List all tools with params and system status | none |
Environment Variables
All optional. The server auto-detects everything.
Variable | Description | Default |
| Force platform: | auto-detect |
| Force device UDID (iOS) or serial (Android) | auto-detect |
| Path to | auto-discover |
| Metro bundler port |
|
| Metro bundler host |
|
Use as Library
react-native-devtools-mcp is designed to be extended. Import createServer to get a pre-configured MCP server with all generic tools, then register your own:
import { createServer } from "react-native-devtools-mcp";
const server = createServer({ name: "my-custom-mcp", version: "1.0.0" });
// Add your own tools on top of the 16 built-in ones
server.tool("my_tool", "Does something custom", {}, async () => {
return { content: [{ type: "text", text: "result" }] };
});Individual register functions are also exported if you want selective tool registration:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import {
registerScreenshotTool,
registerViewHierarchyTool,
registerInteractionTools,
} from "react-native-devtools-mcp";
const server = new McpServer({ name: "minimal", version: "1.0.0" });
registerScreenshotTool(server);
registerViewHierarchyTool(server);
registerInteractionTools(server);Metro/CDP utilities are exported too: getMetroTargets, getMetroStatus, cdpEval, captureJsLogs, getMetroBaseUrl.
How it Works
No app code changes required. The server connects to existing debug interfaces:
iOS Simulator:
xcrun simctlfor screenshots, input, logs, deep links. Facebook IDB (idb ui describe-all) for view hierarchy with accessibility labels, frames, and element roles.Android Emulator:
adbfor screenshots, input, logs, deep links.uiautomator dumpfor view hierarchy with resource-ids (testIDs), text, and bounds.Metro Bundler: Chrome DevTools Protocol (CDP) over WebSocket for JS console capture (
Runtime.consoleAPICalled), JS evaluation (Runtime.evaluate), and runtime status. Connects tohttp://localhost:8081/jsonto discover available runtimes.
Troubleshooting
"No booted simulator or emulator detected"
Boot a simulator (xcrun simctl boot "iPhone 15 Pro") or emulator (emulator -avd <name>), or set RN_DEVTOOLS_PLATFORM and RN_DEVTOOLS_DEVICE_ID env vars.
View hierarchy empty on iOS iOS view hierarchy requires Facebook IDB. Install it:
brew tap facebook/fb && brew install idb-companion
pip3 install fb-idbVerify with: idb ui describe-all --udid <simulator-udid>. If idb is not on PATH, set RN_DEVTOOLS_IDB_PATH=/path/to/idb.
IDB not found
The server searches common locations automatically. If it still can't find IDB, set RN_DEVTOOLS_IDB_PATH to the absolute path of the idb binary (e.g., ~/Library/Python/3.9/bin/idb).
Screenshot fails on Android
Ensure adb is on PATH and the emulator is fully booted past the lock screen.
Metro/JS tools not working Ensure Metro bundler is running and accessible. Test with:
curl http://localhost:8081/jsonIf Metro runs on a different port, set RN_DEVTOOLS_METRO_PORT.
JS eval returns "No React Native runtime found"
The app must be running and connected to Metro. Check get_metro_status to see connected runtimes.
License
MIT
Available Tools
16 toolsget_device_infoB
Show current device/simulator/emulator info and connection status
Inputs: no named parameters.
get_device_logsC
Capture recent device console logs from the simulator/emulator
Inputs: filter, duration.
get_js_logsA
Capture JavaScript console output (console.log/warn/error) from the running React Native app via Metro CDP
Inputs: level, filter, duration.
get_metro_statusA
Check if Metro bundler is running and list connected React Native runtimes
Inputs: no named parameters.
get_view_hierarchyA
Dump the current UI accessibility tree with labels, types, frames, and testIDs. Requires Facebook IDB on iOS.
Inputs: filter, format.
helpA
List all available tools with descriptions, parameters, and current system status
Inputs: no named parameters.
js_evalA
Execute JavaScript in the running React Native app via Metro CDP. Returns the result. Supports await for async expressions.
Inputs: expression (required).
open_deeplinkB
Open a URL or deep link in the app (e.g., metamask://dapp/example.com)
Inputs: url (required).
pingA
Health check — returns device info and connection status
Inputs: no named parameters.
press_buttonC
Press a device button (home, back, enter, delete)
Inputs: button (required).
screenshotA
Capture the current simulator/emulator screen and return it as an image
Inputs: name.
scrollB
Scroll the screen in a direction
Inputs: direction (required), amount.
start_recordingC
Start recording the simulator/emulator screen to a video file
Inputs: name.
stop_recordingA
Stop the current screen recording and return the file path
Inputs: no named parameters.
tapC
Tap on the screen at given coordinates
Inputs: x (required), y (required).
type_textB
Type text into the currently focused input field
Inputs: text (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool maps to a distinct action on the simulator/app (tap, scroll, screenshot, record, eval, logs), so selection is mostly clear. The main overlap is `ping` ("returns device info and connection status") versus `get_device_info` ("show device/simulator info and connection status"), which are near-duplicates, and `get_device_logs` vs `get_js_logs` require reading descriptions carefully to pick correctly.
Names are uniformly snake_case and mostly follow a verb_noun pattern (get_device_info, start_recording, open_deeplink, get_js_logs). Minor deviations are `js_eval` (noun_verb, reversed order) and bare-verb tools like ping, screenshot, tap, scroll, help, which are intuitive enough for action-style commands.
16 tools is on the high side but each roughly corresponds to a real devtools workflow: device control, screen capture, recording, log capture, Metro status, and JS evaluation. The set could be trimmed by merging ping with get_device_info and possibly folding help into a meta-capability, but nothing feels gratuitous.
The surface covers the core loop well: connect/inspect device, capture screen and view hierarchy, read JS/device logs, drive input (tap, type, button, scroll, deeplink), record video, and run JS via Metro. Gaps include network request inspection, app relaunch/reload, and richer gestures (long press, swipe, pinch), but agents can work around these.
Maintenance
Related MCP Connectors
Open a React Native app in a simulated phone: read the screen, tap, type, set device state.
Let your AI agent control real iPhones: screenshots, tap, swipe, type and open apps.
Drive and test your React Native and Expo apps end-to-end on iOS and Android. Supports real devices, simulators, and emulators. Snapshots, taps, typing, swipes, screenshots, deep links, reloads, builds and runtime errors.
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to inspect, log, and control React Native apps on Android emulators or iOS simulators, including UI tree, tap, scroll, and hot reload.2246 npm5MIT
- AlicenseAqualityCmaintenanceEnables agents and LLMs to interact with native iOS and Android applications and devices via structured accessibility snapshots or coordinate-based taps, supporting simulators, emulators, and real devices.3955,827 npmApache 2.0
- AlicenseBqualityBmaintenanceEnables AI agents to automate Android and iOS devices, including emulators and physical devices, by capturing screenshots, reading UI accessibility trees, performing touch and text input, and managing app lifecycle and logs.184MIT
- AlicenseBqualityBmaintenanceConnects AI agents to a running React Native app so they can see the screen, tap and type, and inspect logs, network traffic, and state without any SDK or code changes. Composite tools let an agent run a whole interaction flow in a single call instead of one round trip per tap.352MIT