{"at":"2026-11-23T04:34:44.513Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T04:34:45.094Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T04:34:45.194Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T04:34:45.770Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"prompts":{"listChanged":true},"tools":{"listChanged":true}},"instructions":"You can see and operate the user's Expo / React Native app through this server (headless render, no emulator).\n\nMANDATORY WORKFLOW whenever you add or change app code (a new feature, screen, button, form, bug fix, refactor):\n1. refresh_screen to rebuild and look at the result. Read the screenshot AND the \"Layout warnings\" and \"App console\" text.\n2. Exercise the new/changed behaviour yourself: click_screen every new control, type_text into every new field (valid, empty, too short, too long, special characters), scroll_screen to reach content below the fold, answer Alerts with click_screen target \"alert:<button>\".\n3. Run auto_test to monkey-test the whole app for crashes, console errors, layout overlaps, clipped text and dead buttons. Also use describe_screen when you need exact coordinates or a text outline.\n4. If anything is wrong (wrong text, overlap, off-screen element, crash, console error, button that does nothing), fix the code, then go back to step 1 and verify again. Repeat until a full pass is clean.\n5. After the final fix, re-check the features you did NOT touch (auto_test covers this) to catch regressions. Never report a feature as done without having seen it work on screen.\nState resets on every refresh_screen, so re-do the steps (e.g. type the form again) after each rebuild.\nMultilingual: test with several languages and scripts (e.g. Cyrillic, CJK, Arabic/Hebrew RTL, emoji, long German words) because translated text is a common cause of overflow and clipping; auto_test already does this for text inputs. Always answer the user in the language they write in.\nREAL DEVICE MODE (optional; Android emulator or USB phone via adb on Windows/macOS/Linux, and booted iOS Simulators on macOS with idb; physical iPhones are not supported): only use it when the user asks for testing on a real device/emulator. Call device_list first.\n- If nothing is connected (or adb is missing), say so plainly, change nothing, recommend that the user check the app themselves on their phone/emulator, and offer headless testing instead. Do not try workarounds.\n- If USB debugging is off or not authorized, tell the user how to enable it (device_list gives the steps) and warn them BEFORE you start that you will be tapping, typing and scrolling on their phone.\n- Then call use_target with target=\"device\". It asks the user for consent before controlling a physical phone, before installing Expo Go (when it is missing), and before replacing an Expo Go that does not match the project's SDK. If the user declines, do nothing more and never retry. If a tool asks you to relay a question to the user, ask it verbatim and only continue if they agree.\n- On a device only click_screen / type_text / scroll_screen / describe_screen / press_key / refresh_screen work, and only inside Expo Go. auto_test is headless-only (it taps everything, which is unsafe on a real phone). Non-ASCII text cannot be typed on a device: test other languages in headless mode.\n- Call use_target with target=\"headless\" when done (it also stops the dev server).\nLimits: this is an approximate renderer (fonts/shadows/animations differ from a device; expo-router/react-navigation are not supported). Say so if a problem might be a renderer artefact.","protocolVersion":"2025-11-25","serverInfo":{"name":"expo-headless-mcp","version":"0.2.0"}}}}
{"at":"2026-11-23T04:34:45.770Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T04:34:45.770Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T04:34:45.773Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Bundles the Expo / React Native project (no emulator, phone or browser), renders it headlessly and returns a PNG screenshot of the screen. Call first; call again after editing code (re-bundles and restarts the app). Pass reload=false to just re-capture the current state.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"entry":{"description":"Entry file relative to the project, e.g. App.tsx","type":"string"},"height":{"description":"Screen height in dp (default 844)","type":"number"},"projectPath":{"description":"Expo project directory (default: EXPO_PROJECT env or server cwd)","type":"string"},"reload":{"description":"Re-bundle and restart the app (default true)","type":"boolean"},"scale":{"description":"PNG pixel scale (default 1.5)","type":"number"},"width":{"description":"Screen width in dp (default 390)","type":"number"}},"type":"object"},"name":"refresh_screen"},{"description":"Taps the screen at (x, y) in screen dp coordinates, or an element by \"target\" (testID, accessibilityLabel, or visible text). Fires onPress of the nearest pressable, focuses TextInputs, then returns a new screenshot. Use target \"alert:<button>\" to answer an Alert.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"long":{"description":"Long press","type":"boolean"},"target":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"type":"object"},"name":"click_screen"},{"description":"Types text into a TextInput (replacing its value unless append=true) so forms and validation can be tested. Locate the field by \"target\" (testID, placeholder, accessibilityLabel, current value), by x/y, or omit both to use the focused field. Returns a new screenshot.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"append":{"type":"boolean"},"submit":{"description":"Also fire onSubmitEditing (Enter)","type":"boolean"},"target":{"type":"string"},"text":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"required":["text"],"type":"object"},"name":"type_text"},{"description":"Scrolls the ScrollView/FlatList under (x, y) by dy (vertical) or dx (horizontal) dp; positive dy scrolls down. Returns a new screenshot.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"dx":{"type":"number"},"dy":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"type":"object"},"name":"scroll_screen"},{"description":"Text outline of the current screen: every text, input, image and pressable with its position, size and tap-center, plus detected layout problems (overlaps, clipped text, off-screen elements). No image.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"describe_screen"},{"description":"Automatically exercises the whole app: reloads it several times, fills every TextInput with different data (empty, invalid, valid, very long, special characters), taps every button/switch (scrolling to reach them), dismisses alerts, and reports crashes, console errors/warnings, layout problems (overlaps, clipped text, off-screen elements) and buttons that do nothing, with screenshots of problems. Run it after every change, then fix what it reports and run it again.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"maxStepsPerRound":{"description":"Max taps per round (default 30)","maximum":100,"minimum":1,"type":"integer"},"rounds":{"description":"How many data rounds / app reloads (default 4)","maximum":8,"minimum":1,"type":"integer"}},"type":"object"},"name":"auto_test"},{"description":"Lists connected Android emulators / USB phones (adb) and booted iOS Simulators (macOS only) and tells what, if anything, must be done before they can be used (USB debugging, authorization, idb). Read-only: changes nothing. If nothing is connected, tell the user and recommend they check the app themselves. Physical iPhones cannot be driven.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"device_list"},{"description":"Chooses where the app is tested: \"headless\" (default, built-in renderer) or \"device\" (Expo Go on an Android emulator / USB phone via adb, or a booted iOS Simulator on macOS). Selecting \"device\" first asks the user for consent to control a physical phone, to install Expo Go if missing, and to replace an Expo Go whose SDK does not match the project; then starts the Expo dev server and opens the app. If the user declines, nothing is changed.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"confirmed":{"description":"Consent keys the user approved in chat (only when a previous call asked you to relay a question)","items":{"type":"string"},"type":"array"},"projectPath":{"type":"string"},"serial":{"description":"adb serial or iOS simulator UDID from device_list (needed if several targets are ready)","type":"string"},"target":{"enum":["headless","device"],"type":"string"}},"required":["target"],"type":"object"},"name":"use_target"},{"description":"Device mode only: presses a hardware key inside Expo Go. Allowed: back (Android only), enter, tab, delete.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"key":{"enum":["back","enter","tab","delete"],"type":"string"}},"required":["key"],"type":"object"},"name":"press_key"}]}}}
