Metro MCP — Claude Code MCP server: what it does, how to install
Connects coding assistants to the Metro bundler via Chrome DevTools Protocol. Enables runtime inspection and debugging for Expo and React Native apps.
claude mcp add metro-mcp -- npx -y metro-mcpWhat Metro MCP 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.
What it helps with
- 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 for the agent
- Show the latest runtime errors logged by Metro
- Inspect the active React Navigation route and AsyncStorage keys
- Trigger deep link
myapp://checkoutin the running iOS simulator
How to install Metro MCP
Platform CLI
claude mcp add metro-mcp -- npx -y metro-mcpPlatform CLI
codex mcp add metro-mcp -- npx -y metro-mcpConfig file
{
"mcpServers": {
"metro-mcp": {
"command": "npx",
"args": [
"-y",
"metro-mcp"
]
}
}
}Config file
{
"servers": {
"metro-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"metro-mcp"
]
}
}
}Platform CLI
gemini mcp add metro-mcp npx -y metro-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Metro MCP
How to install Metro MCP in Claude Code?
Run claude mcp add metro-mcp -- npx -y metro-mcp in your terminal. For Bun environments, replace the command with bunx metro-mcp.
What does Metro MCP do?
It connects AI coding tools to the Hermes runtime via Metro bundler ports. The model can inspect console logs, examine network traffic, read application state, and drive simulator interactions.
What tools are needed for simulator automation?
You need Xcode 14+ with Simulator for iOS, and Android SDK with adb available in your PATH. Some iOS operations fall back to idb-companion.