metro-mcp 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -2
- package/dist/bin/metro-mcp.js +4099 -77
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +4099 -77
- package/dist/metro/connection.d.ts +14 -1
- package/dist/metro/connection.d.ts.map +1 -1
- package/dist/metro/proxy.d.ts +53 -0
- package/dist/metro/proxy.d.ts.map +1 -0
- package/dist/plugin.d.ts +10 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +48 -0
- package/dist/plugins/console.d.ts.map +1 -1
- package/dist/plugins/debug-globals.d.ts +2 -0
- package/dist/plugins/debug-globals.d.ts.map +1 -0
- package/dist/plugins/device.d.ts.map +1 -1
- package/dist/plugins/devtools.d.ts +2 -0
- package/dist/plugins/devtools.d.ts.map +1 -0
- package/dist/plugins/errors.d.ts.map +1 -1
- package/dist/plugins/inspect-point.d.ts +2 -0
- package/dist/plugins/inspect-point.d.ts.map +1 -0
- package/dist/plugins/network.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/utils/buffer.d.ts +33 -0
- package/dist/utils/buffer.d.ts.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ Works with **Expo**, **bare React Native**, and any project using **Metro + Herm
|
|
|
15
15
|
- [Requirements](#requirements)
|
|
16
16
|
- [How It Works](#how-it-works)
|
|
17
17
|
- [Features](#features)
|
|
18
|
+
- [Chrome DevTools](#chrome-devtools)
|
|
18
19
|
- [Claude Code Status Bar](#claude-code-status-bar)
|
|
19
20
|
- [Test Recording](#test-recording)
|
|
20
21
|
- [App Integration](#app-integration-optional)
|
|
@@ -95,10 +96,10 @@ metro-mcp connects to your running Metro dev server the same way Chrome DevTools
|
|
|
95
96
|
| Plugin | Tools | Description |
|
|
96
97
|
|--------|-------|-------------|
|
|
97
98
|
| **console** | 2 | Console log collection with filtering |
|
|
98
|
-
| **network** |
|
|
99
|
+
| **network** | 6 | Network request tracking, response body inspection, and stats |
|
|
99
100
|
| **errors** | 3 | Runtime exception collection + Metro bundle error detection |
|
|
100
101
|
| **evaluate** | 1 | Execute JavaScript in the app runtime |
|
|
101
|
-
| **device** |
|
|
102
|
+
| **device** | 4 | Device management, connection status, and app reload |
|
|
102
103
|
| **source** | 1 | Stack trace symbolication |
|
|
103
104
|
| **redux** | 3 | Redux state inspection and action dispatch |
|
|
104
105
|
| **components** | 5 | React component tree inspection |
|
|
@@ -112,12 +113,49 @@ metro-mcp connects to your running Metro dev server the same way Chrome DevTools
|
|
|
112
113
|
| **automation** | 3 | Wait/polling helpers for async state changes |
|
|
113
114
|
| **profiler** | 9 | CPU profiling (React DevTools hook) + heap sampling + render tracking |
|
|
114
115
|
| **test-recorder** | 7 | Record interactions and generate Appium, Maestro, or Detox tests |
|
|
116
|
+
| **devtools** | 1 | Open Chrome DevTools alongside the MCP via CDP proxy |
|
|
117
|
+
| **debug-globals** | 1 | Auto-discover Redux stores, Apollo Client, and other debug globals |
|
|
118
|
+
| **inspect-point** | 1 | Coordinate-based React component inspection (experimental) |
|
|
115
119
|
| **statusline** | 1 | Claude Code status bar integration |
|
|
116
120
|
|
|
117
121
|
→ See the [full tools reference](docs/tools.md).
|
|
118
122
|
|
|
119
123
|
---
|
|
120
124
|
|
|
125
|
+
## Chrome DevTools
|
|
126
|
+
|
|
127
|
+
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.
|
|
128
|
+
|
|
129
|
+
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.
|
|
130
|
+
|
|
131
|
+
### Opening DevTools
|
|
132
|
+
|
|
133
|
+
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.
|
|
134
|
+
|
|
135
|
+
The tool automatically finds Chrome or Edge using the same detection as Metro and opens a standalone DevTools window.
|
|
136
|
+
|
|
137
|
+
### What to avoid
|
|
138
|
+
|
|
139
|
+
| Method | What happens |
|
|
140
|
+
|--------|-------------|
|
|
141
|
+
| Pressing **"j"** in Metro terminal | Disconnects the MCP |
|
|
142
|
+
| **"Open Debugger"** in the dev menu | Disconnects the MCP |
|
|
143
|
+
| `open_devtools` MCP tool | Works alongside the MCP |
|
|
144
|
+
|
|
145
|
+
### Configuration
|
|
146
|
+
|
|
147
|
+
The CDP proxy is enabled by default. To change the port or disable it:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Set a fixed proxy port
|
|
151
|
+
METRO_MCP_PROXY_PORT=9222 npx metro-mcp
|
|
152
|
+
|
|
153
|
+
# Disable the proxy entirely
|
|
154
|
+
METRO_MCP_PROXY_ENABLED=false npx metro-mcp
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
121
159
|
## Claude Code Status Bar
|
|
122
160
|
|
|
123
161
|
Get live Metro CDP connection status in your Claude Code status bar.
|