Skip to main content
Glama
expo-devtools-mcp

expo-devtools-mcp

by fysnerd

expo-devtools-mcp

A Model Context Protocol (MCP) server for debugging Expo/React Native apps with Claude Code (or any MCP-compatible AI assistant).

Control your React Native app directly from your AI assistant - take screenshots, read logs, navigate, and more.

Demo

Features

Command

Description

take_screenshot

Capture the current screen

get_logs

Get console logs from the app

navigate

Navigate to any Expo Router route

scroll

Scroll up/down/left/right

tap

Tap on registered elements

fill

Fill text inputs

take_snapshot

Get accessibility tree with element UIDs

get_state

Read Zustand store state

connection_status

Check if app is connected

Related MCP server: React Native Debugger MCP Server

Quick Start

1. Install the MCP server

npm install -g expo-devtools-mcp

Or add to your Claude Code MCP config (~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "expo-devtools": {
      "command": "npx",
      "args": ["expo-devtools-mcp"],
      "env": {
        "EXPO_DEVTOOLS_PORT": "19876"
      }
    }
  }
}

2. Install the client in your Expo app

cd your-expo-app
npx expo install expo-devtools-client expo-file-system react-native-view-shot

3. Wrap your app with DevToolsProvider

// app/_layout.tsx
import { DevToolsProvider } from 'expo-devtools-client';

export default function RootLayout() {
  return (
    <DevToolsProvider>
      <Stack />
    </DevToolsProvider>
  );
}

4. Start your app and connect

# Terminal 1: Start Expo
npx expo start

# Terminal 2: Start Claude Code
claude

The app will automatically connect to the MCP server. You'll see in Metro logs:

[DevTools] Connected to MCP server!

Configuration

Environment Variables

Variable

Default

Description

EXPO_DEVTOOLS_PORT

19876

WebSocket server port

EXPO_DEVTOOLS_HOST

Auto-detected

Your computer's IP address

Client Options

<DevToolsProvider
  enabled={__DEV__}           // Only enable in dev mode (default: true)
  port={19876}                // WebSocket port (default: 19876)
  host="192.168.1.100"        // Override auto-detected IP
  autoConnect={true}          // Auto-connect on mount (default: true)
  reconnectInterval={3000}    // Reconnection delay in ms (default: 3000)
>
  {children}
</DevToolsProvider>

Usage Examples

Take a screenshot

Claude: take a screenshot of the app
→ [Shows current screen]

Navigate to a screen

Claude: navigate to the settings screen
→ Navigated to: /settings

Debug with logs

Claude: show me the recent console logs
→ [LOG] User logged in
→ [ERROR] API call failed: 401

Check app state

Claude: what's in the auth store?
→ { user: { id: 1, email: "..." }, isAuthenticated: true }

Advanced: Register Interactive Elements

To enable tap and fill commands, register your interactive elements:

import { useDevTools } from 'expo-devtools-client';

function LoginScreen() {
  const { registerElement } = useDevTools();
  const [email, setEmail] = useState('');

  return (
    <TextInput
      ref={(ref) => registerElement({
        ref,
        type: 'textinput',
        accessibilityLabel: 'Email input',
        onChangeText: setEmail,
      })}
      value={email}
      onChangeText={setEmail}
    />
  );
}

Advanced: Register Zustand Stores

To enable get_state command:

import { useDevTools } from 'expo-devtools-client';
import { useAuthStore } from './stores/authStore';

function App() {
  const { registerStore } = useDevTools();

  useEffect(() => {
    registerStore('auth', useAuthStore.getState);
  }, []);

  return <MyApp />;
}

How It Works

┌─────────────────┐         WebSocket          ┌─────────────────┐
│   Claude Code   │ ◄─────────────────────────► │   Expo App      │
│   (MCP Client)  │                             │ (DevToolsClient)│
└────────┬────────┘                             └─────────────────┘
         │
         │ MCP Protocol
         ▼
┌─────────────────┐
│  MCP Server     │
│ (This package)  │
└─────────────────┘
  1. The MCP server runs on your computer and listens for WebSocket connections

  2. Your Expo app connects to the MCP server via WebSocket

  3. Claude Code sends commands through MCP protocol

  4. Commands are forwarded to the app, results returned to Claude

Troubleshooting

"Not connected to Expo Go app"

  1. Make sure your phone/simulator is on the same network as your computer

  2. Check the IP address in the DevToolsProvider logs

  3. Try setting the host explicitly: <DevToolsProvider host="YOUR_IP">

Screenshot returns small/corrupted image

Make sure you have expo-file-system installed:

npx expo install expo-file-system

Connection drops frequently

Increase the reconnect interval:

<DevToolsProvider reconnectInterval={5000}>

Requirements

  • Expo SDK 51+

  • React Native 0.74+

  • Node.js 18+

  • Claude Code or any MCP-compatible client

Contributing

Contributions welcome! Please read CONTRIBUTING.md first.

License

MIT - see LICENSE

Credits

Created by @fysnerd

Inspired by Chrome DevTools MCP

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • 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
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents such as Cursor and Claude Desktop to read a running debugger's captured console logs and network sessions, inspect full request/response payloads, diagnose crashes and failed API calls, and trigger React Native reloads or the developer menu.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables coding agents to drive, inspect, and debug paired web and Expo apps by running registered actions, reading app state, inspecting network calls and errors, and capturing pixel-exact panel screenshots.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Lets coding agents drive a running React Native or Expo dev build from inside: each tool the app registers (screen snapshot, press and fill, state stores, network mocks, navigation) becomes an MCP tool. bridge.restore undoes everything the agent changed.
      19
      434 npm
      4
      MIT