MCP server for controlling Android emulator GPS location during QA testing. Sets mock locations via adb emu geo fix.
Communication: MCP client ←MCP (stdio)→ Server ←adb emu geo fix→ Android Emulator
# Server
cd server && npm install && npm run build && npm start
# Test connection (after emulator started)
adb devices # should show emulator-5554 or similarserver/src/
index.ts # MCP server, all 11 tool definitions (Zod schemas)
emulator.ts # Emulator connection management, location setting via `geo fix`
adb.ts # ADB command execution with timeouts, emulator validation
geocode.ts # Geocoding providers (Nominatim/Google/Mapbox)
routing.ts # Routing providers (OSRM/Google/Mapbox)
gpx-kml.ts # GPX/KML file parsing for track replay
geo-math.ts # Haversine distance calculation
fetch-utils.ts # Shared fetch with timeout helper
Set PROVIDER env var in MCP client config: osm (default), google, mapbox.
osm— Nominatim geocoding + OSRM routing. Free, no API key. Rate-limited (1 req/sec).google— RequiresGOOGLE_API_KEY. Full profile support (car/foot/bike).mapbox— RequiresMAPBOX_ACCESS_TOKEN. Full profile support.
See server/README.md for full provider reference and env var table.
- Emulators only: Only Android emulators are supported. Physical devices are not supported since mock location is set via
adb emu geo fixwhich is an emulator-specific command. - OSRM car-only: Public OSRM server only supports
carprofile.foot/bikesilently return car routes. Usegoogleormapboxfor walking/cycling. - Nominatim rate limit: 1 req/sec. Server hints AI to pass lat/lng directly when using OSM provider.
- Single simulation: Only one simulation runs at a time. Starting a new one stops the previous.
- TypeScript strict mode, ES modules (
"type": "module"in package.json) - Zod for MCP tool input validation (schemas in
index.ts) - Provider pattern: implement
GeocodeProviderorRoutingProvidertype, add case toselectProvider()in respective file - Tool parameter names/types are defined in
index.tsZod schemas — keepserver/README.mdin sync when changing