Skip to main content
Glama
expo-headless-mcp

expo-headless-mcp

expo-headless-mcp

An MCP server that lets an AI see and operate an Expo / React Native app without an emulator, a phone or a browser — real PNG screenshots, taps, typing, scrolling and automatic bug hunting. (Русская версия: README.ru.md)

Documentation

Related MCP server: React Native Debug MCP

How it works

Metro + Expo Go need a native runtime, so instead:

  1. esbuild bundles your project (App.* or main), swapping react-native for a light shim (src/shim/rn.js) and native-only packages (expo-*, react-native-*) for stubs.

  2. The app runs in Node; React renders into our own tree (react-reconciler).

  3. Layout is computed by Yoga (the flexbox engine React Native uses) and painted by Skia (@napi-rs/canvas) into a PNG.

Limits: an approximation, not real iOS/Android — fonts, shadows, animations and native modules differ; expo-router / react-navigation are not supported; state resets on refresh_screen.

Tools

  • refresh_screen — rebuild and show the screen (projectPath, entry, width, height, scale, reload)

  • click_screen — tap at x,y or by target (testID / text), long, or alert:<button>

  • type_text — type into a TextInput (target or x,y, submit, append)

  • scroll_screen — scroll the area under x,y

  • describe_screen — text outline of elements + layout warnings (overlap, clipped text, off-screen)

  • auto_test — monkey-test everything: several rounds of reload, fill every input with varied data (empty, invalid, valid, very long, special characters, Cyrillic, CJK, Arabic/Hebrew, emoji), tap every button/switch (scrolling to reach it), dismiss alerts. Reports crashes, console errors, layout problems and dead buttons with screenshots.

The server ships built-in instructions: after any code change the AI must rebuild, check by hand, run auto_test, fix and repeat until a full pass is clean. The MCP prompt verify_changes triggers the same loop.

Languages

The server's text is English, and the AI answers in whatever language the user writes in. Rendering falls back to system fonts for Latin, Cyrillic, CJK, Devanagari, Arabic, Hebrew and emoji (install Noto fonts on Linux). Right-to-left layout (I18nManager) is not simulated; RTL text itself renders.

Install

claude mcp add expo -e EXPO_PROJECT=/path/to/app -- npx -y expo-headless-mcp

Tests: npm test (end-to-end), node test/mcp.js (stdio).

Real device mode (optional)

Besides the headless renderer, the AI can drive Expo Go on an Android emulator or a USB phone through adb (Windows, macOS, Linux) and in a booted iOS Simulator (macOS with Xcode only). Physical iPhones are not supported: Apple does not allow remote input without heavy tooling — open Expo Go on the iPhone yourself.

Tools: device_list (read-only), use_target (device / headless), press_key; refresh_screen, click_screen, type_text, scroll_screen, describe_screen then act on the device.

Safety rules built into the server:

  • Nothing is connected / adb missing → it says so, changes nothing, and recommends that you check the app yourself (or use headless mode).

  • USB debugging off or unauthorized → it explains how to enable it and warns up front that it will tap, type and scroll on your phone.

  • Consent first. It asks you (MCP elicitation, or via the AI in chat if your client lacks it) before controlling a physical phone, before installing Expo Go when it is missing, and before replacing an Expo Go whose SDK does not match the project (the matching build comes from Expo's official release list; a downgrade needs an uninstall first, which is stated in the question). If you decline, nothing is done and it will not retry.

  • It only touches Expo Go: every tap/type/swipe first checks that Expo Go is in the foreground. Allowed keys: back, enter, tab, delete.

  • auto_test is headless-only (it taps everything). Non-ASCII text cannot be typed through adb — test other languages in headless mode.

Status: the Android path has been used on a real phone by the author, and is covered by automated tests against a fake adb.

Starting the dev server runs npx expo start in your project (it asks before running npm install if dependencies are missing). Override with EXPO_MCP_METRO_CMD; set EXPO_MCP_ADB to use a specific adb.

iOS Simulator notes

  • Needs macOS + Xcode (xcrun simctl) and Facebook idb for taps/typing/UI tree (brew tap facebook/fb && brew install idb-companion && pip3 install fb-idb). Without idb the server only tells you how to install it; it never installs it.

  • Expo Go for the project's SDK is installed/replaced only after you consent (official build from Expo's release list).

  • The simulator is disposable, so there is no per-app focus check; there is no hardware Back key on iOS.

  • Status: the iOS path is covered by tests against fake xcrun/idb only — it has not been run on a real Mac yet.

Available Tools

9 tools
auto_testA

Automatically exercises the whole app: reloads it several times, fills every TextInput with different data (empty, invalid, valid, very long, special characters), taps every button/switch (scrolling to reach them), dismisses alerts, and reports crashes, console errors/warnings, layout problems (overlaps, clipped text, off-screen elements) and buttons that do nothing, with screenshots of problems. Run it after every change, then fix what it reports and run it again.

Inputs: rounds, maxStepsPerRound.

click_screenA

Taps the screen at (x, y) in screen dp coordinates, or an element by "target" (testID, accessibilityLabel, or visible text). Fires onPress of the nearest pressable, focuses TextInputs, then returns a new screenshot. Use target "alert:" to answer an Alert.

Inputs: x, y, long, target.

describe_screenA

Text outline of the current screen: every text, input, image and pressable with its position, size and tap-center, plus detected layout problems (overlaps, clipped text, off-screen elements). No image.

Inputs: no named parameters.

device_listA

Lists connected Android emulators / USB phones (adb) and booted iOS Simulators (macOS only) and tells what, if anything, must be done before they can be used (USB debugging, authorization, idb). Read-only: changes nothing. If nothing is connected, tell the user and recommend they check the app themselves. Physical iPhones cannot be driven.

Inputs: no named parameters.

press_keyA

Device mode only: presses a hardware key inside Expo Go. Allowed: back (Android only), enter, tab, delete.

Inputs: key (required).

refresh_screenA

Bundles the Expo / React Native project (no emulator, phone or browser), renders it headlessly and returns a PNG screenshot of the screen. Call first; call again after editing code (re-bundles and restarts the app). Pass reload=false to just re-capture the current state.

Inputs: entry, scale, width, height, +2 more.

scroll_screenA

Scrolls the ScrollView/FlatList under (x, y) by dy (vertical) or dx (horizontal) dp; positive dy scrolls down. Returns a new screenshot.

Inputs: x (required), y (required), dx, dy.

type_textA

Types text into a TextInput (replacing its value unless append=true) so forms and validation can be tested. Locate the field by "target" (testID, placeholder, accessibilityLabel, current value), by x/y, or omit both to use the focused field. Returns a new screenshot.

Inputs: text (required), x, y, append, +2 more.

use_targetA

Chooses where the app is tested: "headless" (default, built-in renderer) or "device" (Expo Go on an Android emulator / USB phone via adb, or a booted iOS Simulator on macOS). Selecting "device" first asks the user for consent to control a physical phone, to install Expo Go if missing, and to replace an Expo Go whose SDK does not match the project; then starts the Expo dev server and opens the app. If the user declines, nothing is changed.

Inputs: target (required), serial, confirmed, projectPath.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 9 tools

    Disambiguation4/5

    Each tool targets a distinct action: refresh (bundled screenshot), click, type, scroll, describe, press_key, auto_test, use_target, device_list. The only mild overlap is between auto_test and refresh_screen (both reload and capture) and between device_list and use_target (both deal with devices), but descriptions clearly delineate the read-only listing vs. target selection and the exhaustive automated pass vs. manual re-capture.

    Naming Consistency4/5

    Eight of nine names use a verb_noun pattern with predictable suffixes (_screen, _text, _key) and a clear action-first style (refresh_screen, click_screen, scroll_screen, describe_screen). The outlier is device_list, which inverts to noun_verb and breaks the otherwise uniform convention.

    Tool Count5/5

    Nine tools is well within the ideal 3-15 range and each earns its place: a coherent interaction loop (refresh/describe/click/type/scroll/press_key) plus higher-level automation (auto_test) and environment setup (use_target, device_list). No redundancy or padding.

    Completeness4/5

    The surface covers the essential test lifecycle: render, inspect, interact (tap/type/scroll/key), automate, and choose headless vs. device targets. Minor gaps remain—no drag/swipe/pinch gesture tool, no standalone console-log retrieval outside auto_test, and no explicit wait/idle primitive—but these are workaroundable.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables automated testing and development of Expo/React Native apps through session-based Expo dev server management and Maestro UI automation tools for tapping, text input, screenshots, and flow execution.
      5
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Connects 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.
      35
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Lets MCP-capable AI agents control an Expo / React Native app running live in Expo Go on a real phone, reading a compact token-cheap outline of the visible screen and performing taps, text entry, scrolling, toggles and navigation. Also exposes screenshots, layout, console logs, network requests and hardware keys, and attaches new JS errors and failed requests to the action that caused them.
      17
      91 npm
      3
      MIT