expo-mcp-bridge
This server lets an AI agent inspect and drive a live Expo/React Native app on a real phone over Wi-Fi — reading the screen cheaply, acting through real handlers, and checking what broke.
Inspect the app —
app_status(connection, device, OS, screen size, SDK),app_snapshot(compact text outline of the visible screen with[e3]refs),app_layout(element positions in dp and font sizes),app_screenshot(JPEG, save to file, or full-page tall capture viafullScroll).Interact like a user —
app_tap(by ref,testIDor text; long-press),app_type(fill, append, submit),app_scroll(down/up/left/right/top/bottom),app_toggle(flip or set a Switch),app_navigate(expo-router path or deep link, optionalreplace).Run flows in one shot —
app_batchchains up to 30 tap/type/scroll/toggle/navigate/wait/dismiss_keyboard steps and returns the resulting screen.Synchronise instead of polling —
app_waitfor text/testIDto appear or disappear (with timeout);app_dismiss_keyboardto hide the keyboard.Debug what broke —
app_logs(console logs and JS errors, cursor-based, filter by level/search),app_network(fetch/XHR with status, timing, bodies, failed-only),app_eval(run JavaScript inside the app withbridgeandRNin scope),app_reload(reload the JS bundle).Control Android hardware keys —
device_keyfor volume_up/down, mute, back, home, app_switch, enter, tab, delete, power, menu, escape (via adb, with repeat).Stay token-cheap and safe — every action returns only a diff of what changed plus any new errors; the whole bridge is dev-only (
__DEV__) and inert in production builds.
Enables control of Android hardware keys (volume up/down, mute, back, home, power) via adb and supports USB-only Android device connections through adb reverse.
Allows AI agents to inspect and interact with a live Expo / React Native app running in Expo Go or a dev build, including reading the visible screen outline, tapping, typing, scrolling, navigating, taking screenshots, and reading console logs and network requests.
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., "@expo-mcp-bridge open the app, try the sign-up form with bad input, and tell me what breaks"
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.
expo-mcp-bridge gives AI agents — Claude Code, Antigravity, Cursor and any other MCP client — eyes and hands inside your Expo / React Native app, running live on your real phone. The agent reads the screen, taps, types, scrolls, takes screenshots, reads console errors and network requests, and presses hardware keys. No more pasting screenshots into the chat.
import { Stack, router } from 'expo-router';
import { AgentBridge } from 'expo-mcp-bridge';
export default function RootLayout() {
return (
<>
<Stack />
<AgentBridge router={router} />
</>
);
}"Open the app, try the sign-up form with bad input, and tell me what breaks."
Table of contents
Related MCP server: dejank
Installation
npx expo install expo-mcp-bridge react-native-view-shot
npx expo-mcp-bridge initreact-native-view-shot powers screenshots and ships with Expo Go; in a custom dev build, rebuild the client once after installing it. init writes your agent's MCP config, installs the agent skill and adds a guide to AGENTS.md.
Requirements: macOS, Linux or Windows with Node.js 20 or newer (tested on all three in CI) · an Expo (or React Native) app · phone and computer on the same Wi-Fi.
Quick start
The one-shot way. Paste this into Claude Code, Antigravity or Cursor inside your Expo project and the agent installs, mounts and verifies everything itself:
Read https://raw.githubusercontent.com/Rudrasamadhiya/expo-mcp-bridge/main/AI_SETUP.md and set it up in this project.By hand, in two minutes:
Install the packages and run
init(above).Mount
<AgentBridge />once, as the last child of your root layout (example at the top of this page).Run
npx expo startin LAN mode and open the app on your phone.Restart your agent and ask it to do something in the app.
Features
Real devices, zero native setup. Expo Go or a dev build, iPhone or Android, over Wi-Fi. One component, no native linking.
Token-cheap by design. The agent reads a compact outline of the visible screen — about 70 tokens instead of about 1,000 for a screenshot — and every action returns only what changed.
Fast flows. Actions finish the moment the UI settles.
app_batchfills a whole form in one call.Sees what broke. New JS errors and failed requests are attached to the action that caused them.
Full control. Tap, type, scroll, toggle, navigate, wait, screenshots, layout, logs, network, eval — and volume / back / home keys.
Agent skill included.
initinstalls a skill for Claude Code and anAGENTS.mdguide for Antigravity, Cursor, Codex and others, so agents use the tools well from the first message.Dev only. In production builds
<AgentBridge />renders its children and nothing else.
What the agent sees
A real login screen, as returned by app_snapshot:
scroll [e1]
button "icon:chevron-back" [e2]
text "Welcome back"
input "you@example.com" value="" [e3]
input "••••••••" value="" (secure) [e4]
button "icon:eye" [e5]
button "Log In" [e7]Tapping e5 (show password) returns just the difference:
Tapped.
Changes (+ added, - removed):
~ input "••••••••" value="" [e4]
+ button "icon:eye-off" [e9]
- button "icon:eye" [e5]Common questions
How do I let Claude Code, Cursor or Antigravity see my Expo app?
Install this package, run npx expo-mcp-bridge init, and mount <AgentBridge /> in your root layout. Your agent then gets MCP tools such as app_snapshot (read the visible screen), app_tap, app_type and app_screenshot, and works directly against the app running on your phone.
My AI agent keeps asking me for screenshots of my React Native app. How do I stop that?
That is exactly what this package replaces. Instead of you taking screenshots and pasting them into the chat, the agent calls app_snapshot itself and receives a compact outline of the screen (about 70 tokens instead of about 1,000 for an image), or app_screenshot when it really needs pixels.
Can an AI agent test my React Native app on a real phone?
Yes. The agent taps, types, scrolls and navigates through your real handlers, reads new JS errors and failed network requests after every action, and reports what broke. It works in Expo Go or a dev build, on iPhone and Android, over Wi-Fi.
Does it work with Expo Go?
Yes. Both the bridge and its screenshot dependency (react-native-view-shot) run in Expo Go. No native code, no config plugin and no rebuild are needed.
How is this different from Detox, Maestro or Appium?
Those are end-to-end test frameworks: you write test scripts or flows and run them in CI. expo-mcp-bridge is for development with an AI agent: the agent explores and drives the live app interactively and fixes the code in the same session. It needs no native setup and reads the React tree directly, so it complements a test framework rather than replacing one.
Is it safe to leave in my app?
<AgentBridge /> only runs in development (__DEV__) and only connects to your own computer. In production builds it renders its children and nothing else.
Connecting your agent
init writes .mcp.json for Claude Code. Other agents use the same server:
Agent | Configuration |
Claude Code |
|
Cursor |
|
Antigravity, Windsurf, Cline | MCP settings: |
On Windows use "command": "cmd", "args": ["/c", "npx", "expo-mcp-bridge"].
Tools
Target elements by ref from a snapshot, by testID, or by visible text. Full parameters are in the tools reference.
Read
Tool | Description |
| Connected device, OS, screen size, SDK |
| Outline of the visible screen with stable refs ( |
| JPEG of the visible screen; |
| Element positions (dp) and font sizes |
Act
Tool | Description |
| Press by ref, |
| Fill an input ( |
| Several taps, types, scrolls and navigations in one call |
| Scroll down, up, left, right, to the top or bottom |
| Flip or set a |
| Open an expo-router path or deep link ( |
| Wait for text or a |
| Hide the on-screen keyboard |
Debug
Tool | Description |
| Console logs and JS errors (cursor-based) |
| fetch / XHR requests with status, timing and bodies |
| Run JavaScript inside the app (dev only) |
| Reload the JS bundle, and say honestly if it couldn't |
Device
Tool | Description |
|
|
Component API
<AgentBridge
router={router} // expo-router's router, for exact app_navigate
host="192.168.1.20" // your computer's IP (auto-detected from Metro)
port={8347} // must match EXPO_MCP_PORT
allowEval={false} // disable app_eval
enabled={false} // turn the bridge off
/>Prop | Type | Default | Description |
| expo-router | — | Used by |
|
| from Metro | Computer running the MCP server |
|
|
| WebSocket port; must match |
|
|
| Allow |
|
|
| Turn the bridge on or off |
CLI and environment
npx expo-mcp-bridge init # .mcp.json + agent skill + AGENTS.md section
npx expo-mcp-bridge init --cursor # also write .cursor/mcp.json
npx expo-mcp-bridge # run the MCP server (your agent starts this for you)
npx expo-mcp-bridge --helpVariable | Default | Description |
|
| WebSocket port the phone connects to (match |
You normally never run the server yourself — the agent launches it over stdio. To try it by hand, any MCP client works: npx @modelcontextprotocol/inspector npx expo-mcp-bridge.
How it works
AI agent ──MCP (stdio)──▶ expo-mcp-bridge server ◀──WebSocket :8347── <AgentBridge /> in your appThe in-app component reads React's live component tree, so it sees exactly what you rendered: your testIDs, labels, inputs and lists. It calls your real onPress and onChangeText handlers, so app logic runs exactly as if a user did it. Native-stack screens hidden under the current one are skipped, modals are captured as overlays, and screenshots capture the visible screen view.
Troubleshooting
Symptom | Fix |
| Same Wi-Fi, LAN mode (not |
| Another agent session runs the server — close it, or set |
Metro: |
|
| Metro was restarted; shake the phone and choose Reload once. |
Screenshots fail | Install |
More in the troubleshooting guide.
Limits
An in-app library controls your own app only; the OS blocks system dialogs and other apps. device_key covers hardware keys via adb on Android. Gestures that exist only in native code (a pan handler with no onPress) can't be triggered from JavaScript.
Related
expo-launch-video — builds on this bridge: your agent records the app live from the phone and cuts a launch video with motion graphics, pop-outs and sound, in a studio you can prompt.
Expo Agent Kit — the website and full documentation for both libraries.
Contributing
npm install
npm testThe tests run the bridge in Node against the real MCP server. See CONTRIBUTING.md for details.
License
MIT © Rudra Samadhiya
Available Tools
17 toolsapp_batchRun several actionsADestructive
Run up to 30 actions in order in one call: the fastest way to fill a form or walk a known flow. Each step is {action, ...the same arguments as that tool}, where action is "tap", "type", "scroll", "toggle", "navigate", "wait" or "dismiss_keyboard". Example: [{action:"type", testID:"email", value:"a@b.co"}, {action:"tap", text:"Sign in"}, {action:"wait", text:"Welcome"}]. Stops at the first failing step and says which. Steps can submit forms or trigger app actions, same as the single tools. Returns a confirmation (screen reported once, at the end), what changed on screen (+ added, - removed lines), and any new JS errors or failed network requests the action caused.
Inputs: steps (required), full, snapshot.
app_dismiss_keyboardHide the keyboardAIdempotent
Hide the on-screen keyboard (Keyboard.dismiss). Use it after app_type when the keyboard covers a button you need to tap or a screenshot should show the full screen. Typed text is kept and nothing is submitted; to submit a field use app_type with submit=true instead. Inside app_batch use the step {action:"dismiss_keyboard"}. Returns a confirmation.
Inputs: no named parameters.
app_evalRun JavaScript in the appADestructive
Run JavaScript inside the running app and return the result as JSON (promises are awaited). Pass an expression ("RN.Dimensions.get('window')") or statements ending with return. bridge (the agent bridge) and RN (react-native) are in scope. Development builds only; the app can turn it off with allowEval={false}. The code runs with the app's full access, so it can change app state or storage: prefer the other tools and use this for inspection.
Inputs: code (required).
app_layoutElement positions and sizesARead-onlyIdempotent
List elements on the current screen with their position and size in dp (window coordinates), font size and scroll content height, one per line: role "label" [ref] x,y wxh fsN. Use it to check layout: overlaps, alignment, text that is too small, content cut off. For acting on the screen app_snapshot is cheaper. Read-only.
Inputs: limit.
app_logsConsole logs and errorsARead-onlyIdempotent
Read console output and JavaScript errors captured inside the app (the last 300 entries, each cut to 2000 chars), one per line: time LEVEL message, then a cursor. Use it to debug crashes, red screens and unexpected behaviour; for failed API calls use app_network. Action tools already report new errors they cause, so call this for the full context. Pass that cursor as since next time to see only new entries. Read-only unless clear=true, which empties the captured logs and network requests (the app itself is unaffected).
Inputs: clear, level, limit, since, +1 more.
app_networkNetwork requestsARead-onlyIdempotent
List HTTP requests the app made through fetch or XMLHttpRequest (the last 150), one per line: time METHOD url -> status or error, duration; optionally with truncated request and response bodies. Ends with a cursor for since. Use it to debug failing API calls, slow requests or wrong payloads; for JavaScript errors and console output use app_logs. Read-only. Requests made by native modules outside fetch/XHR (e.g. image loading) are not captured.
Inputs: limit, since, bodies, search, +1 more.
app_reloadReload the JS bundleAIdempotent
Reload the app's JavaScript bundle, like pressing r in Metro, and wait up to 90 s for it to reconnect. Use after changing code when Fast Refresh did not pick it up. In-memory state (form input, navigation stack) is reset; stored data is kept. Returns "Reloaded and reconnected" or why it did not happen.
Inputs: no named parameters.
app_screenshotScreenshotAIdempotent
Take a JPEG screenshot of the app (needs react-native-view-shot in the app). Use it only for visual questions (colours, images, spacing, how it looks); app_snapshot is far cheaper for finding and acting on elements. Returns the image, or with saveTo writes the file on this computer and returns only its path (no image tokens; overwrites an existing file). fullScroll stitches the whole scroll view into one tall image. Read-only for the app.
Inputs: area, saveTo, quality, maxWidth, +1 more.
app_scrollScrollA
Scroll a ScrollView, FlatList or SectionList to reveal more content. Without a target it scrolls the first scrollable view on screen. "down"/"up"/"left"/"right" move by one page (about 70% of the screen); "top"/"bottom" jump to the start or end. Only moves the view, changes no data. Returns a confirmation, what changed on screen (+ added, - removed lines), and any new JS errors or failed network requests the action caused.
Inputs: ref, full, text, amount, +3 more.
app_snapshotScreen outlineARead-onlyIdempotent
Read the current screen as a compact text outline: buttons, inputs (with values), switches, text and lists, indented by nesting, each actionable element tagged with a ref like [e3] and its testID. This is the cheapest way to see the app and the source of refs for app_tap, app_type, app_scroll and app_toggle. Use it instead of app_screenshot unless you need pixels, and instead of app_layout unless you need positions. Read-only.
Inputs: maxLines.
app_statusApp connection statusARead-onlyIdempotent
Check whether the Expo / React Native app is connected and on which device. Call this first in every session. Waits up to about 6 s for the app to (re)connect. Returns one line per connected app: name, platform and OS version, Expo Go or dev build, window size and Expo SDK; the active one is marked with *. If nothing is connected it returns setup steps (add to the app, same Wi-Fi or adb reverse) instead of failing. Read-only.
Inputs: no named parameters.
app_tapTapADestructive
Press a button or other pressable element by calling its onPress (or onLongPress), like a finger tap. Pick the element with exactly one of ref, testID or text. The press runs the app's own handler, which may submit, delete or send data, so check what a button does before pressing anything irreversible. For switches use app_toggle; for text fields use app_type. Returns a confirmation, what changed on screen (+ added, - removed lines), and any new JS errors or failed network requests the action caused.
Inputs: ref, full, long, text, +2 more.
app_toggleFlip a switchA
Change a Switch by calling its onValueChange: flips it, or sets it to value when given (setting a value is idempotent). Pick the element with exactly one of ref, testID or text. The app's handler runs, so the setting may be saved immediately. For buttons use app_tap. Returns a confirmation, what changed on screen (+ added, - removed lines), and any new JS errors or failed network requests the action caused.
Inputs: ref, full, text, value, +2 more.
app_typeType into an inputAIdempotent
Set the text of a TextInput, firing onChangeText like real typing (no keyboard needed). Replaces the current text unless append=true. Pick the element with exactly one of ref, testID or text. (text matches the placeholder or label.) submit=true also fires onSubmitEditing, which may submit the form. Returns a confirmation, what changed on screen (+ added, - removed lines), and any new JS errors or failed network requests the action caused.
Inputs: value (required), ref, full, text, +4 more.
app_waitWait for textARead-onlyIdempotent
Wait until some text or a testID appears on screen, or disappears with gone=true (spinners, loading states, toasts). Cheaper than polling app_snapshot. Give text or testID. Read-only. Returns how long it took and the screen; returns an error if the timeout passes first.
Inputs: gone, text, testID, timeout.
device_keyPress a hardware key (Android)A
Press a hardware or system key on an Android phone or emulator through adb (needs USB debugging or wireless debugging; iOS is not supported). Keys: volume_up, volume_down, mute, back, home, app_switch, enter, tab, delete, power, menu, escape. "back" is the Android back button, "home" leaves the app (it keeps running), "power" turns the screen off. Nothing is deleted. Returns a confirmation.
Inputs: key (required), repeat.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Tools are cleanly separated by purpose: inspection (app_snapshot, app_layout, app_screenshot), interaction (app_tap, app_type, app_scroll, app_toggle), lifecycle (app_status, app_reload), and debugging (app_logs, app_network, app_eval). Descriptions explicitly recommend one tool over another (e.g. snapshot vs screenshot vs layout), so an agent can reliably choose the right tool.
All tools use snake_case, and 16 of 17 share the app_ prefix with consistent noun/verb suffixes. device_key is a deliberate outlier for device-level hardware keys, which is a minor deviation from an otherwise predictable convention.
17 tools is slightly above the ideal 3-15 range, but each tool has a distinct role across inspection, interaction, batching, debugging, and lifecycle management. The set is well-scoped with no obviously redundant tools.
The surface covers connection, screen inspection, interaction, waiting, batch flows, debugging, eval, and reload, so core app-automation workflows are supported. Minor gaps include no explicit gesture/swipe beyond scroll views, no iOS hardware key support, and no dedicated back-navigation action outside Android.
Maintenance
Related MCP Connectors
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Open a React Native app in a simulated phone: read the screen, tap, type, set device state.
Remote MCP server to control your Android phone from AI assistants with per-app permissions.
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.2230 npm5MIT
- AlicenseBqualityNot gradedmaintenanceAn MCP server that gives AI agents hands-on control of a live React Native app, enabling UI taps, screenshots, UI/component trees, native logs, and JS/React profiling to debug, verify fixes, and diagnose performance issues.16MIT
- AlicenseNot gradedqualityCmaintenanceControls Android and iOS devices from AI agents through a token-efficient MCP server, enabling observation, tapping, typing, gestures, navigation, assertions, and safety-gated actions.2MIT
- AlicenseAqualityBmaintenanceEnables an AI agent to screen-record a live Expo app on a connected phone, auto-plan and direct the footage with captions, motion graphics, pop-outs and sound, then export a 1080p MP4. It also opens an interactive studio where users refine scenes by dragging, resizing, or typing prompts, and exposes all app_* control tools from expo-mcp-bridge in the same session.27439 npm2MIT