Skip to main content
Glama

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 init

react-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:

  1. Install the packages and run init (above).

  2. Mount <AgentBridge /> once, as the last child of your root layout (example at the top of this page).

  3. Run npx expo start in LAN mode and open the app on your phone.

  4. 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_batch fills 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. init installs a skill for Claude Code and an AGENTS.md guide 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

.mcp.json from init, or claude mcp add expo-app -- npx expo-mcp-bridge

Cursor

npx expo-mcp-bridge init --cursor writes .cursor/mcp.json

Antigravity, Windsurf, Cline

MCP settings: {"mcpServers": {"expo-app": {"command": "npx", "args": ["expo-mcp-bridge"]}}}

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

app_status

Connected device, OS, screen size, SDK

app_snapshot

Outline of the visible screen with stable refs ([e3])

app_screenshot

JPEG of the visible screen; saveTo a file; fullScroll for the whole page as one tall image

app_layout

Element positions (dp) and font sizes

Act

Tool

Description

app_tap

Press by ref, testID or text (long: true for a long press)

app_type

Fill an input (submit, append)

app_batch

Several taps, types, scrolls and navigations in one call

app_scroll

Scroll down, up, left, right, to the top or bottom

app_toggle

Flip or set a Switch

app_navigate

Open an expo-router path or deep link (replace keeps the stack shallow)

app_wait

Wait for text or a testID to appear or disappear

app_dismiss_keyboard

Hide the on-screen keyboard

Debug

Tool

Description

app_logs

Console logs and JS errors (cursor-based)

app_network

fetch / XHR requests with status, timing and bodies

app_eval

Run JavaScript inside the app (dev only)

app_reload

Reload the JS bundle, and say honestly if it couldn't

Device

Tool

Description

device_key

volume_up, volume_down, mute, back, home, power and more (Android, via adb)

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

router

expo-router router

—

Used by app_navigate for exact navigation

host

string

from Metro

Computer running the MCP server

port

number

8347

WebSocket port; must match EXPO_MCP_PORT

allowEval

boolean

true

Allow app_eval

enabled

boolean

true in dev

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 --help

Variable

Default

Description

EXPO_MCP_PORT

8347

WebSocket port the phone connects to (match <AgentBridge port>)

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 app

The 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

No app connected

Same Wi-Fi, LAN mode (not --tunnel), firewall allows Node on 8347, <AgentBridge /> mounted. USB-only Android: adb reverse tcp:8347 tcp:8347 and host="localhost".

Port 8347 is already in use

Another agent session runs the server — close it, or set EXPO_MCP_PORT and the port prop.

Metro: Unable to resolve "expo-mcp-bridge"

npx expo start --clear

app_reload can't reload

Metro was restarted; shake the phone and choose Reload once.

Screenshots fail

Install react-native-view-shot (rebuild the dev client if you use one).

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.

  • 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 test

The tests run the bridge in Node against the real MCP server. See CONTRIBUTING.md for details.

License

MIT © Rudra Samadhiya

Available Tools

17 tools
app_batchRun several actionsA
Destructive

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 keyboardA
Idempotent

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 appA
Destructive

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 sizesA
Read-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 errorsA
Read-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_navigateGo to a screenA
Idempotent

Jump straight to a screen: an expo-router path like "/settings" or "/product/42" (needs router passed to ), or a full deep link "myapp://…". Pushes the screen onto the stack; replace=true swaps the current one. Faster than tapping through menus; 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: path (required), full, replace, snapshot.

app_networkNetwork requestsA
Read-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 bundleA
Idempotent

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_screenshotScreenshotA
Idempotent

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 outlineA
Read-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 statusA
Read-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_tapTapA
Destructive

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 inputA
Idempotent

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 textA
Read-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

    A4.4/5.0

    Scored across 17 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      Not graded
      maintenance
      An 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.
      16
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Controls Android and iOS devices from AI agents through a token-efficient MCP server, enabling observation, tapping, typing, gestures, navigation, assertions, and safety-gated actions.
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      27
      439 npm
      2
      MIT