Supports capturing console logs from Expo SDK 54+ applications running with React Native Bridgeless architecture through Metro bundler integration.
Captures and retrieves React Native console logs from Metro bundler, enabling real-time access to app logs with filtering, searching, and auto-discovery of running Metro servers.
Captures console.log, console.warn, and console.error output from React Native applications (RN 0.70+) running with Hermes runtime via Chrome DevTools Protocol.
Metro Logs MCP
An MCP (Model Context Protocol) server that captures React Native console logs from Metro bundler, enabling AI assistants like Claude to access app logs without manual copy/paste.
Features
Captures
console.log,console.warn,console.errorfrom React Native appsSupports both Expo SDK 54+ (React Native Bridgeless) and RN 0.70+ (Hermes)
Auto-discovers running Metro servers on common ports
Filters logs by level (log, warn, error, info, debug)
Circular buffer stores last 1000 log entries
Requirements
Node.js 18+
React Native app running with Metro bundler
Installation
Note: This package is not published to npm. Only local build installation is available.
Option 1: Clone and Build
Option 2: Manual Setup
Copy the source files and build:
Claude Code Setup
Global (all projects)
Project-specific
Manual Configuration
Add to ~/.claude.json (user scope) or .mcp.json (project scope):
Restart Claude Code after adding the configuration.
Available Tools
Tool | Description |
| Scan for running Metro servers and auto-connect |
| Connect to a specific Metro port |
| List connected React Native apps |
| Retrieve console logs (with optional filtering and start position) |
| Search logs for specific text (case-insensitive) |
| Clear the log buffer |
Usage
Start your React Native app:
npm start # or expo startIn Claude Code, scan for Metro:
Use scan_metro to find and connect to MetroGet logs:
Use get_logs to see recent console output
Filtering Logs
Available levels: all, log, warn, error, info, debug
Start from Specific Line
This finds the last (most recent) line containing the text and returns logs from that point forward. Useful for getting logs since the last app reload.
Search Logs
Case-insensitive search across all log messages.
Supported React Native Versions
Version | Runtime | Status |
Expo SDK 54+ | React Native Bridgeless | ✓ |
RN 0.70 - 0.76 | Hermes React Native | ✓ |
RN < 0.70 | JSC | Not tested |
How It Works
Fetches device list from Metro's
/jsonendpointConnects to the main JS runtime via CDP (Chrome DevTools Protocol) WebSocket
Enables
Runtime.enableto receiveRuntime.consoleAPICalledeventsStores logs in a circular buffer for retrieval
Troubleshooting
No devices found
Make sure the app is running on a simulator/device
Check that Metro bundler is running (
npm start)
Wrong device connected
The server prioritizes devices in this order:
React Native Bridgeless (SDK 54+)
Hermes React Native
Any React Native (excluding Reanimated/Experimental)
Logs not appearing
Ensure the app is actively running (not just Metro)
Try
clear_logsthen trigger some actions in the appCheck
get_appsto verify connection status
License
MIT