Screen Capture
Tools for capturing screenshots, component tree snapshots, querying native UI trees, and performing visual regression testing.
take_screenshot
Capture the device/simulator screen as a JPEG image (720p).
Parameters
Example
Tips
- Returns base64 JPEG and point size metadata for coordinate conversion.
- Prefer
assert_textorassert_visibleover screenshots when possible — screenshots consume vision tokens. - iOS only supports simulators, not physical devices.
take_snapshot
Capture the React Native component tree. Compact text output for massive token savings.
Parameters
Example
Tips
- Compact output: Over 90% token savings compared to JSON. Hierarchy is represented by indentation.
- Use
interactive: trueto show only tappable/input elements, further reducing tokens. - Use
uidvalues withmeasureView(uid)viaevaluate_scriptto get exact coordinates. - Reduce
maxDepthfor large component trees to limit output size.
describe_ui
Query the native UI/accessibility tree. Compact text output for significant token savings.
Parameters
Example
Tips
- Compact output: Over 78% token savings compared to JSON/XML. Android shows
[clickable],[scrollable],bounds=etc. iOS showsrole=,enabled=,frame=. - Prefer
query_selectorfor querying React Native elements. - iOS uses
idb ui describe-all/describe-point. Android usesuiautomator dump. - Useful for inspecting native components that aren't part of the React tree (e.g., native alerts, system UI).
visual_compare
Compare the current screen against a baseline PNG for visual regression testing.
Parameters
Example
Tips
- Use
updateBaseline: trueto create initial baselines. - Use
selectorto compare only a specific component (e.g.,#header) instead of the full screen. - Lower
thresholdvalues are stricter (0 = pixel-perfect, 1 = any difference passes). - Uses sharp + pixelmatch internally.
Video recording
Start and stop screen recording on the device/simulator. Uses idb on iOS and adb screenrecord on Android. Only one recording can be active per MCP server at a time.
start_video_recording
Start recording the device screen. The recording continues until you call stop_video_recording.
Parameters
Example
Tips
- If a recording is already in progress, the tool returns an error. Call
stop_video_recordingfirst. - On server exit (or session end), any active recording is stopped automatically.
stop_video_recording
Stop the current recording and save the file to the path given when starting.
Parameters
Example
Tips
- Returns the path to the saved file on success.
- iOS: uses idb. Android: uses adb screenrecord (SIGINT to stop and finalize).