metro-mcp 0.2.0 → 0.4.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 CHANGED
@@ -7,6 +7,23 @@ A plugin-based MCP server for React Native runtime debugging, inspection, and au
7
7
 
8
8
  Works with **Expo**, **bare React Native**, and any project using **Metro + Hermes**.
9
9
 
10
+ ---
11
+
12
+ ## Contents
13
+
14
+ - [Quick Start](#quick-start)
15
+ - [Requirements](#requirements)
16
+ - [How It Works](#how-it-works)
17
+ - [Features](#features)
18
+ - [Claude Code Status Bar](#claude-code-status-bar)
19
+ - [Test Recording](#test-recording)
20
+ - [App Integration](#app-integration-optional)
21
+ - [Configuration](#configuration)
22
+ - [Custom Plugins](#custom-plugins)
23
+ - [Compatibility](#compatibility)
24
+
25
+ ---
26
+
10
27
  ## Quick Start
11
28
 
12
29
  ### Claude Code
@@ -49,6 +66,8 @@ Or with Bun:
49
66
  claude mcp add metro-mcp -- npx -y metro-mcp --port 19000
50
67
  ```
51
68
 
69
+ ---
70
+
52
71
  ## Requirements
53
72
 
54
73
  - **Node.js** 18+ or **Bun** 1.0+
@@ -56,42 +75,95 @@ claude mcp add metro-mcp -- npx -y metro-mcp --port 19000
56
75
  - **Android**: Android SDK with `adb` on your PATH
57
76
  - **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.
58
77
 
78
+ ---
79
+
59
80
  ## How It Works
60
81
 
61
82
  metro-mcp connects to your running Metro dev server the same way Chrome DevTools does:
62
83
 
63
- 1. Discovers Metro via port scanning (8081, 8082, 19000-19002)
84
+ 1. Discovers Metro via port scanning (8081, 8082, 1900019002)
64
85
  2. Connects to Hermes via Chrome DevTools Protocol (CDP)
65
- 3. Streams console logs, network requests, errors into buffers
86
+ 3. Streams console logs, network requests, and errors into buffers
66
87
  4. Exposes everything as MCP tools, resources, and prompts
67
88
 
68
89
  **No app modifications required** for core debugging features.
69
90
 
91
+ ---
92
+
70
93
  ## Features
71
94
 
72
95
  | Plugin | Tools | Description |
73
96
  |--------|-------|-------------|
74
97
  | **console** | 2 | Console log collection with filtering |
75
- | **network** | 3 | Network request tracking and search |
76
- | **errors** | 2 | Exception collection with auto-symbolication |
77
- | **evaluate** | 1 | Execute JavaScript in app runtime |
98
+ | **network** | 4 | Network request tracking and response body inspection |
99
+ | **errors** | 3 | Runtime exception collection + Metro bundle error detection |
100
+ | **evaluate** | 1 | Execute JavaScript in the app runtime |
78
101
  | **device** | 3 | Device and connection management |
79
102
  | **source** | 1 | Stack trace symbolication |
80
103
  | **redux** | 3 | Redux state inspection and action dispatch |
81
- | **components** | 4 | React component tree inspection |
104
+ | **components** | 5 | React component tree inspection |
82
105
  | **storage** | 3 | AsyncStorage reading |
83
- | **bundle** | 2 | Metro bundle diagnostics |
84
106
  | **simulator** | 6 | iOS simulator / Android device control |
85
107
  | **deeplink** | 2 | Cross-platform deep link testing |
86
108
  | **ui-interact** | 6 | UI automation (tap, swipe, type) |
87
109
  | **navigation** | 4 | React Navigation / Expo Router state |
88
110
  | **accessibility** | 3 | Accessibility auditing |
89
111
  | **commands** | 2 | Custom app commands |
90
- | **profiler** | 5 | CPU profiling (Hermes CDP) + React render tracking |
91
- | **maestro** | 2 | Maestro test flow generation |
92
- | **appium** | 3 | Appium/WebdriverIO Jest test generation |
112
+ | **automation** | 3 | Wait/polling helpers for async state changes |
113
+ | **profiler** | 9 | CPU profiling (React DevTools hook) + heap sampling + render tracking |
114
+ | **test-recorder** | 7 | Record interactions and generate Appium, Maestro, or Detox tests |
115
+ | **statusline** | 1 | Claude Code status bar integration |
116
+
117
+ → See the [full tools reference](docs/tools.md).
118
+
119
+ ---
120
+
121
+ ## Claude Code Status Bar
122
+
123
+ Get live Metro CDP connection status in your Claude Code status bar.
124
+
125
+ 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:
126
+
127
+ ```
128
+ /statusline add the script at ~/.claude/metro-mcp-statusline.sh
129
+ ```
130
+
131
+ The status bar segment shows three states:
132
+
133
+ | State | Display |
134
+ |-------|---------|
135
+ | Not running | `Metro ○` (dimmed) |
136
+ | Running, not connected | `Metro ●` (red) |
137
+ | Connected | `Metro ● localhost:8081` (green) |
93
138
 
94
- **Total: 55 tools, 9 resources, 7 prompts** — see the [full tools reference](docs/tools.md).
139
+ ---
140
+
141
+ ## Test Recording
142
+
143
+ Record real user interactions (taps, text entry, scrolls) and generate production-ready tests — no app code changes required.
144
+
145
+ ### AI-driven test generation
146
+
147
+ Describe a flow and the AI navigates the app, then generates the test:
148
+
149
+ > *"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."*
150
+
151
+ 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.
152
+
153
+ ### Manual recording
154
+
155
+ ```
156
+ start_test_recording → inject interceptors
157
+ (interact with the app)
158
+ stop_test_recording → retrieve event log
159
+ generate_test_from_recording format=appium
160
+ ```
161
+
162
+ Supports **Appium (WebdriverIO)**, **Maestro YAML**, and **Detox**.
163
+
164
+ → See the [testing guide](docs/testing.md) for full details, format examples, and tips.
165
+
166
+ ---
95
167
 
96
168
  ## App Integration (Optional)
97
169
 
@@ -124,14 +196,20 @@ Use `list_commands` and `run_command` to call these from the MCP client.
124
196
 
125
197
  For enhanced features like real-time Redux action tracking, navigation events, performance marks, and React render profiling, see the [optional client SDK](docs/sdk.md) and [profiling guide](docs/profiling.md).
126
198
 
199
+ ---
200
+
127
201
  ## Configuration
128
202
 
129
203
  See [configuration docs](docs/configuration.md) for environment variables, CLI arguments, and config file options.
130
204
 
205
+ ---
206
+
131
207
  ## Custom Plugins
132
208
 
133
209
  metro-mcp is fully extensible. See the [plugins guide](docs/plugins.md) to build your own tools and resources.
134
210
 
211
+ ---
212
+
135
213
  ## Compatibility
136
214
 
137
215
  - **React Native**: 0.70+ (Hermes required)