# Metro MCP

Connects coding assistants to the Metro bundler via Chrome DevTools Protocol. Enables runtime inspection and debugging for Expo and React Native apps.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 85
- Author: steve228uk
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/steve228uk/metro-mcp
- Updated: 2026-09-04
- HTML: https://affpapa.org/en/nevibecode/mcp/metro-mcp

## What it does

The server detects Metro by scanning default ports such as 8081, 8082, or 19000–19002, then hooks into Hermes using CDP. Standard debugging features require zero edits in your application code. Your assistant gets access to console streams, network traffic, bundle build errors, and the React component hierarchy.

Modular plugins allow the model to evaluate JavaScript in the running client, read AsyncStorage values, check navigation routes, and read or dispatch Redux actions. It can also drive simulators with taps, swipes, permission updates, and deep links. Multiple agents connect to the same local daemon concurrently without resource conflicts.

Running the server requires Node.js 18+ or Bun 1.0+. Mobile automation relies on Xcode 14+ for iOS and `adb` in your system `PATH` for Android. Without an active Metro dev server paired with Hermes, the server cannot hook into the runtime.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add metro-mcp -- npx -y metro-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add metro-mcp -- npx -y metro-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "metro-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "metro-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "metro-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "metro-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add metro-mcp npx -y metro-mcp
```

## When to use it
- inspect live network requests and response bodies in React Native
- stream console logs and Hermes runtime exceptions directly to the model
- simulate UI actions like taps and swipes on mobile emulators
- examine AsyncStorage and Redux store values during development

## Example prompts
- Show the latest runtime errors logged by Metro
- Inspect the active React Navigation route and AsyncStorage keys
- Trigger deep link `myapp://checkout` in the running iOS simulator

## Similar
- [mobile-mcp](https://affpapa.org/en/nevibecode/mcp/mobile-mcp.md) — MCP server · ★ 9946
- [mobilerun](https://affpapa.org/en/nevibecode/mcp/mobilerun.md) — MCP server · ★ 9751
- [e2e](https://affpapa.org/en/nevibecode/mcp/e2e.md) — MCP server · ★ 11912
- [XcodeBuildMCP](https://affpapa.org/en/nevibecode/mcp/xcodebuildmcp.md) — MCP server · ★ 6505
- [ShipSwift](https://affpapa.org/en/nevibecode/mcp/shipswift.md) — MCP server · ★ 3244
- [agent-device](https://affpapa.org/en/nevibecode/mcp/agent-device.md) — MCP server · ★ 5149

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
