.mux/skills/mobile-dev-server-sandbox/SKILL.md
Connects Mux mobile (Expo web/native) to an isolated dev-server sandbox with deterministic port setup, backend pairing, and Chrome MCP interaction. Use when implementing or validating mobile features against a sandboxed Mux backend.
npx skillsauth add coder/mux mobile-dev-server-sandboxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
dev-server-sandboxUse this skill when work needs the mobile app connected to an isolated backend, especially for UI tasks in Expo web where an agent can interact through Chrome MCP.
make dev-server-sandbox delegates to make dev-server, and the dev server runs with --no-auth.
For this sandbox flow:
BACKEND_PORT=3900 \
VITE_PORT=5174 \
MOBILE_CORS_PROXY_PORT=3901 \
KEEP_SANDBOX=1 \
make mobile-sandbox
This starts:
dev-server-sandbox) on 127.0.0.1:3900127.0.0.1:3901 → forwards to backendhttp://localhost:8081Why the proxy exists:
/orpc is intentionally strict:8081 vs :3900)BACKEND_PORT=3900 \
VITE_PORT=5174 \
KEEP_SANDBOX=1 \
make dev-server-sandbox
MOBILE_BACKEND_PORT=3900 \
MOBILE_CORS_PROXY_PORT=3901 \
# Optional when the mobile origin is not localhost:8081:
# MOBILE_CORS_ALLOWED_ORIGINS="http://localhost:8081,http://127.0.0.1:8081"
make mobile-cors-proxy
EXPO_PUBLIC_BACKEND_URL=http://127.0.0.1:3901 make mobile-web
EXPO_PUBLIC_BACKEND_URLnow feeds Expoextra.mux.baseUrldefaults. Settings can still override it.
In the mobile UI (http://localhost:8081):
http://127.0.0.1:3901 (proxy)After this, the URL persists in app storage.
Copy this checklist and keep it updated while working:
Mobile sandbox progress:
- [ ] Step 1: Start backend + proxy + mobile (`make mobile-sandbox`)
- [ ] Step 2: Verify Base URL points to proxy (:3901) and token is empty
- [ ] Step 3: Verify project/workspace list loads
- [ ] Step 4: Implement UI change
- [ ] Step 5: Re-verify via Chrome MCP + screenshots
pkill, kill -9) while using MCP; restart the workspace instead if MCP gets wedged.Use this exact order for reliable UI automation:
chrome_navigate_page → http://localhost:8081chrome_emulate with mobile viewport:
390844deviceScaleFactor: 3isMobile: truehasTouch: truechrome_take_snapshot to identify interactable elementschrome_click / chrome_fill to drive flowschrome_take_screenshot for visual confirmation after each meaningful stepIf testing from a physical device, expose backend on LAN:
BACKEND_HOST=0.0.0.0 \
BACKEND_PORT=3900 \
VITE_PORT=5174 \
KEEP_SANDBOX=1 \
make dev-server-sandbox
Then run a proxy host reachable from the device and set mobile Base URL to that proxy URL.
http://127.0.0.1:3900/health respondshttp://127.0.0.1:3901/health respondsFailed to fetch immediately after changing settings: press Retry once after returning from Settings; initial fetch may still reflect stale state.Origin not allowed from proxy: include your mobile web origin in MOBILE_CORS_ALLOWED_ORIGINS.:3901 (not backend :3900).localhost; use LAN/VPN IPs.KEEP_SANDBOX=1.Use these files when behavior needs to be confirmed:
scripts/dev-server-sandbox.tsscripts/mobile-cors-proxy.tsmobile/src/orpc/client.tsmobile/src/contexts/AppConfigContext.tsxmobile/src/shims/backendBaseUrl.tsmobile/app.config.jsmobile/metro.config.jssrc/node/orpc/server.tssrc/node/services/serverLockfile.tsMakefile targets: mobile-sandbox, mobile-cors-proxy, dev-server-sandbox, mobile-web, test-mobile, typecheck-react-nativetesting
Testing doctrine, commands, and test layout conventions
data-ai
Terminal-Bench integration for Mux agent benchmarking and failure analysis
development
Guidelines for when to use (and avoid) useEffect in React components
documentation
Guidelines for creating and managing Pull Requests in this repo