🚇 A plugin-based MCP server for React Native runtime debugging, inspection, and automation. Connects to Metro bundler via Chrome DevTools Protocol — no app code changes needed for most features.
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
claude mcp add metro-mcp -- npx -y metro-mcp{
"mcpServers": {
"metro-mcp": {
"command": "npx",
"args": ["-y", "metro-mcp"]
}
}
}MCP Servers overview
# metro-mcp
[](https://vscode.dev/redirect/mcp/install?name=metro-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22metro-mcp%22%5D%2C%22env%22%3A%7B%7D%7D)
[](https://cursor.com/en/install-mcp?name=metro-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1ldHJvLW1jcCJdLCJlbnYiOnt9fQ==)
A plugin-based MCP server for React Native runtime debugging, inspection, and automation. Connects to Metro bundler via Chrome DevTools Protocol — **no app code changes needed** for most features.
Works with **Expo**, **bare React Native**, and any project using **Metro + Hermes**.
---
## Contents
- [Quick Start](#quick-start)
- [Requirements](#requirements)
- [How It Works](#how-it-works)
- [Features](#features)
- [Chrome DevTools](#chrome-devtools)
- [Claude Code Status Bar](#claude-code-status-bar)
- [Test Recording](#test-recording)
- [App Integration](#app-integration-optional)
- [Configuration](#configuration)
- [Custom Plugins](#custom-plugins)
- [Compatibility](#compatibility)
---
## Quick Start
### Claude Code
```bash
claude mcp add metro-mcp -- npx -y metro-mcp
# or with Bun
claude mcp add metro-mcp -- bunx metro-mcp
```
### Codex
```bash
codex mcp add metro-mcp -- npx -y metro-mcp
# or with Bun
codex mcp add metro-mcp -- bunx metro-mcp
```
Codex stores MCP servers in `~/.codex/config.toml` by default, and the Codex CLI and IDE extension share that configuration.
If you prefer to configure it manually:
```toml
[mcp_servers.metro-mcp]
command = "npx"
args = ["-y", "metro-mcp"]
```
### OpenCode
Run OpenCode's interactive MCP installer:
```bash
opencode mcp add
```
Choose a local server, name it `metro-mcp`, and use `npx -y metro-mcp` as the command.
If you prefer to configure it manually, add this to `opencode.json` in your project, or to `~/.config/opencode/opencode.json` for a global install:
```json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"metro-mcp": {
"type": "local",
"command": ["npx", "-y", "metro-mcp"],
"enabled": true
}
}
}
```
Or with Bun:
```json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"metro-mcp": {
"type": "local",
"command": ["bunx", "metro-mcp"],
"enabled": true
}
}
}
```
### Cursor / VS Code
```json
{
"mcpServers": {
"metro-mcp": {
"command": "npx",
"args": ["-y", "metro-mcp"]
}
}
}
```
Or with Bun:
```json
{
"mcpServers": {
"metro-mcp": {
"command": "bunx",
"args": ["metro-mcp"]
}
}
}
```
### Install across multiple agents
If you use several MCP clients, [`add-mcp`](https://github.com/neondatabase/add-mcp) can write the config for supported agents, including Claude Code, Codex, Cursor, OpenCode, and VS Code:
```bash
npx add-mcp metro-mcp --all -g -y
```
metro-mcp supports multiple agents at the same time. Standard stdio installs start or reuse a local shared daemon for the same project directory and Metro/config options, so Codex, Claude Code, Cursor, and other clients can connect concurrently to the same running Metro app and see the same logs, network requests, errors, and runtime state.
### Shared HTTP server / Supergateway
If you want to expose one long-lived MCP endpoint yourself, start the shared server explicitly:
```bash
npx -y metro-mcp serve --mcp-port 8765
```
This serves Streamable HTTP at `http://127.0.0.1:8765/mcp` and legacy SSE at `http://127.0.0.1:8765/sse`. Tools such as [`supergateway`](https://github.com/supercorp-ai/supergateway) can point at the Streamable HTTP endpoint instead of launching a fresh stdio process per request.
### With custom Metro port
```bash
codex mcp add metro-mcp -- npx -y metro-mcp --port 19000
# or
claude mcp add metro-mcp -- npx -y metro-mcp --port 19000
```
For OpenCode, add the port to the command array:
```json
"command": ["npx", "-y", "metro-mcp", "--port", "19000"]
```
---
## Requirements
- **Node.js** 18+ or **Bun** 1.0+
- **iOS**: Xcode 14+ with Simulator (`xcrun simctl` is used for most operations)
- **Android**: Android SDK with `adb` on your PATH
- **IDB** *(optional)*: Some iOS operations fall back to [IDB (idb-companion)](https://github.com/facebook/idb) — install with `brew install idb-companion`. Tools will tell you when IDB is needed.
---
## How It Works
metro-mcp connects to your running Metro dev server the same way Chrome DevTools does:
1. Discovers Metro via port scanning (8081, 8082, 19000–19002)
2. Connects to Hermes via Chrome DevTools Protocol (CDP)
3. Streams console logs, network requests, and errors into buffers
4. Exposes everything as MCP tools, resources, and prompts
**No app modifications required** for core debugging features.
---
## Features
| Plugin | Tools | Description |
|--------|-------|-------------|
| **console** | 2 | Console log collection with filtering |
| **network** | 6 | Network request tracking, response body inspection, and stats |
| **errors** | 3 | Runtime exception collection + Metro bundle error detection |
| **evaluate** | 1 | Execute JavaScript in the app runtime |
| **device** | 4 | Device management, connection status, and app reload |
| **environment** | 4 | Build flags, platform constants, env vars, and Expo config inspection |
| **source** | 1 | Stack trace symbolication |
| **redux** | 3 | Redux state inspection and action dispatch |
| **components** | 5 | React component tree inspection |
| **storage** | 3 | AsyncStorage reading |
| **simulator** | 6 | iOS simulator / Android device control |
| **deeplink** | 2 | Cross-platform deep link testing |
| **permissions** | 5 | Inspect and manage app permissions on iOS Simulator and Android Emulator |
| **ui-interact** | 6 | UI automation (tap, swipe, type) |
| **navigation** | 4 | React Navigation / Expo Router state |
| **accessibility** | 3 | Accessibility auditing |
| **commands** | 2 | Custom app commands |
| **automation** | 3 | Wait/polling helpers for async state changes |
| **profiler** | 9 | CPU profiling (React DevTools hook) + heap sampling + render tracking |
| **test-recorder** | 7 | Record interactions and generate Appium, Maestro, or Detox tests |
| **filesystem** | 5 | Browse and read files in app sandbox directories (Documents, caches, SQLite DBs) |
| **devtools** | 1 | Open Chrome DevTools alongside the MCP via CDP proxy |
| **debug-globals** | 1 | Auto-discover Redux stores, Apollo Client, and other debug globals |
| **inspect-point** | 1 | Coordinate-based React component inspection (experimental) |
| **statusline** | 1 | Claude Code status bar integration |
→ See the [full tools reference](docs/tools.md).
---
## Chrome DevTools
Hermes (the React Native JavaScript engine) only allows a **single CDP debugger connection** at a time. Since metro-mcp uses that connection, pressing **"j" in Metro** or tapping **"Open Debugger"** in the dev menu will steal the connection and disconnect the MCP.
metro-mcp solves this with a built-in **CDP proxy** that multiplexes the single Hermes connection, allowing Chrome DevTools and the MCP to work simultaneously.
### Opening DevTools
Use the `open_devtools` MCP tool instead of the usual methods. It opens the same React Native DevTools frontend (rn_fusebox) that Metro uses, but routes the WebSocket connection through the proxy so both can coexist.
The tool automatically finds Chrome or Edge using the same detection as Metro and opens a standalone DevTools window.
### What to avoid
| Method | What happens |
|--------|-------------|
| Pressing **"j"** in Metro terminal | Disconnects the MCP |
| **"Open Debugger"** in the dev menu | Disconnects the MCP |
| `open_devtools` MCP tool | Works alongside the MCP |
### Configuration
The CDP proxy is enabled by default. To change the port or disable it:
```bash
# Set a fixed proxy port
METRO_MCP_PROXY_PORT=9222 npx metro-mcp
# Disable the proxy entirely
METRO_MCP_PROXY_ENABLED=false npx metro-mcp
```
---
## Claude Code Status Bar
Get live Metro CDP connection status in your Claude Code status bar.
Run `setup_statusline` in Claude Code — it writes a script to `~/.claude/metro-mcp-statusline.sh`, then ask Claude to add it to your status bar:
```
/statusline add the script at ~/.claude/metro-mcp-statusline.sh
```
The status bar segment shows three states:
| State | Display |
|-------|---------|
| Not running | `Metro ○` (dimmed) |
| Running, not connected | `Metro ●` (red) |
| Connected | `Metro ● localhost:8081` (green) |
---
## Test Recording
Record real user interactions (taps, text entry, scrolls) and generate production-ready tests — no app code changes required.
### AI-driven test generation
Describe a flow and the AI navigates the app, then generates the test:
> *"Write an Appium test for the guest checkout flow — start by tapping 'Start Shopping' on the welcome screen and end when the cart screen is visible."*
The AI calls `start_test_recording`, navigates using `tap_element`/`type_text`/`swipe`, then generates a complete test with real selectors observed from the fiber tree.
### Manual recording
```
start_test_recording → inject interceptors
(interact with the app)
stop_test_recording → retrieve event log
generate_test_from_recording format=appium
```
Supports **Appium (WebdriverIO)**, **Maestro YAML**, and **Detox**.
→ See the [testing guide](docs/testing.md) for full details, format examples, and tips.
---
## App Integration (Optional)
Register custom commands and expose state to the MCP server — no package needed. Add this to your app entry point in dev mode:
```typescript
if (__DEV__) {
globalThis.__METRO_BRIDGE__ = {
commands: {
// Run custom actions from the MCP client
login: async ({ email, password }) => {
return await authService.What people ask about metro-mcp
What is steve228uk/metro-mcp?
+
steve228uk/metro-mcp is mcp servers for the Claude AI ecosystem. 🚇 A plugin-based MCP server for React Native runtime debugging, inspection, and automation. Connects to Metro bundler via Chrome DevTools Protocol — no app code changes needed for most features. It has 73 GitHub stars and was last updated today.
How do I install metro-mcp?
+
You can install metro-mcp by cloning the repository (https://github.com/steve228uk/metro-mcp) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is steve228uk/metro-mcp safe to use?
+
Our security agent has analyzed steve228uk/metro-mcp and assigned a Trust Score of 87/100 (tier: Trusted). See the full breakdown of passed checks and flags on this page.
Who maintains steve228uk/metro-mcp?
+
steve228uk/metro-mcp is maintained by steve228uk. The last recorded GitHub activity is from today, with 0 open issues.
Are there alternatives to metro-mcp?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy metro-mcp to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/steve228uk-metro-mcp)<a href="https://claudewave.com/repo/steve228uk-metro-mcp"><img src="https://claudewave.com/api/badge/steve228uk-metro-mcp" alt="Featured on ClaudeWave: steve228uk/metro-mcp" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!