Use when starting Metro bundler for Expo development, debugging Metro errors, or enabling expo-mcp local capabilities - manages Metro lifecycle with EXPO_UNSTABLE_MCP_SERVER=1 flag for autonomous...
Manage Metro bundler lifecycle with EXPO_UNSTABLE_MCP_SERVER=1 environment variable to enable expo-mcp local capabilities.
Core principle: Start Metro with MCP flag. Monitor health. Enable autonomous testing.
Announce at start: "I'm using the claude-mobile-metro-manager skill to start Metro with expo-mcp support."
ALWAYS start Metro with expo-mcp flag:
EXPO_UNSTABLE_MCP_SERVER=1 npx expo start
Why: Enables expo-mcp local capabilities:
Without flag: Only server tools available (search_documentation, add_library, generate_*_md, learn)
| Task | Command | Tool |
|---|---|---|
| Start with MCP | ./scripts/start-metro.sh | Serena execute_shell_command |
| Start + clear cache | ./scripts/start-metro.sh --clear-cache | Serena |
| Check health | Read logs/metro.log | morphllm read_file |
| Stop Metro | ./scripts/stop-metro.sh | Serena |
| Verify MCP enabled | Check for "expo-mcp server" in logs | morphllm |
mcp__serena__execute_shell_command({
command: "./scripts/start-metro.sh",
cwd: "/Users/nick/Desktop/claude-mobile-expo"
});
// Script includes: EXPO_UNSTABLE_MCP_SERVER=1 npm start
// Verify success
mcp__morphllm__read_file({
path: "/Users/nick/Desktop/claude-mobile-expo/logs/metro.log",
head: 100
});
// Must show: "Metro.*waiting" AND "expo-mcp server" or "MCP server"
After Metro starts with flag, verify local capabilities:
"Take a screenshot to test expo-mcp"
If successful: expo-mcp local tools are working ✅
If error: Check Metro logs for MCP server status
mcp__serena__execute_shell_command({
command: "./scripts/start-metro.sh --clear-cache"
});
When to clear:
Port 8081 in use:
mcp__serena__execute_shell_command({
command: "pkill -f metro && ./scripts/start-metro.sh"
});
Module resolution failed:
mcp__serena__execute_shell_command({
command: "./scripts/start-metro.sh --clear-cache"
});
| Mistake | Reality |
|---|---|
| "Start without MCP flag" | WRONG. Local tools won't work. Must use EXPO_UNSTABLE_MCP_SERVER=1. |
| "npm start is fine" | WRONG. Use script with logging and MCP flag. |
| "Don't check logs" | WRONG. Verify MCP server started. |
| "Cache clear is slow" | WRONG. 10s vs hours debugging. |
cd claude-code-mobile && npx expo start # Missing MCP flag!
cd claude-code-mobile && EXPO_UNSTABLE_MCP_SERVER=1 npx expo start
# OR use automation script:
./scripts/start-metro.sh # Has flag built-in
@claude-mobile-ios-testing (requires Metro with MCP)Metro should show in logs:
✅ Metro waiting on port 8081
✅ expo-mcp server listening (or MCP server enabled)