device-mcp
v0.10.0MCP server for mobile device interaction — iOS (IDB), Android (ADB), and Appium/BrowserStack
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
device_snapshot Device Snapshot
Capture the current UI hierarchy from the device. Returns all visible elements with their types, labels, identifiers, values, frames, and enabled state. Call this FIRST to see what is on screen before interacting.
device_screenshot Screenshot
Capture a screenshot of the current device screen. Returns base64-encoded PNG data. Optionally saves to a file path.
| Parameter | Type | Description |
|---|---|---|
outputPath | string | File path to save the screenshot (optional) |
device_info Device Info
Get information about the connected device: platform, name, OS version, device ID.
device_tap_element Tap Element
Find an element in the UI hierarchy by query and tap its center. Specify at least one of: label, identifier, text, type. Call device_snapshot first to see available elements.
| Parameter | Type | Description |
|---|---|---|
identifier | string | Accessibility identifier (iOS) or resource-id (Android) |
label | string | Accessibility label (iOS) or content-description (Android) |
text | string | Visible text content |
type | string | Element type/class name |
device_tap_coordinates Tap Coordinates
Tap at exact screen coordinates. Use as a last resort when an element cannot be found by label/identifier/text. Get coordinates from device_snapshot frame data.
| Parameter | Type | Description |
|---|---|---|
x * | number | X coordinate in pixels |
y * | number | Y coordinate in pixels |
device_type Type Text
Type text into the currently focused input field. Tap an input element first to focus it, then call this. The field is cleared before typing on all backends. An empty string only clears the field.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to type |
device_swipe Swipe
Swipe on the device screen. Use natural scrolling: swipe "up" to scroll down. Optionally specify start coordinates and distance. Coordinates are logical points, not screenshot pixels. The gesture runs with a fixed 0.3s duration; command completion does not verify that content moved — confirm with a screenshot or snapshot.
| Parameter | Type | Description |
|---|---|---|
direction * | string | Swipe direction |
distance | number | Swipe distance in pixels (default: 500) |
startX | number | Start X coordinate |
startY | number | Start Y coordinate |
device_long_press Long Press
Long press an element. Used for context menus, drag initiation, and other long-press interactions. Default duration is 1000ms.
| Parameter | Type | Description |
|---|---|---|
durationMs | number | Press duration in ms (default: 1000) |
identifier | string | Identifier/resource-id |
label | string | Accessibility label |
text | string | Text content |
type | string | Element type |
device_wait_for Wait For Element
Poll the UI hierarchy until an element matching the query appears (and, when it appears during the wait, stops moving). Useful for waiting on transitions, loading states, or navigation.
| Parameter | Type | Description |
|---|---|---|
identifier | string | Identifier/resource-id to match |
label | string | Accessibility label to match |
text | string | Text content to match |
timeoutMs | number | Max wait time in ms (default: 10000) |
type | string | Element type to match |
device_app_state App State
Get the current state of an app by bundle ID. Returns whether the app is running, installed, or not found.
| Parameter | Type | Description |
|---|---|---|
bundleId * | string | App bundle ID (e.g. io.metamask or io.metamask.debug) |
device_open_app Open App
Launch or bring to foreground an app by bundle ID. iOS: bundle ID (e.g. io.metamask). Android: package name (e.g. io.metamask).
| Parameter | Type | Description |
|---|---|---|
bundleId * | string | App bundle ID or package name |
device_close_app Close App
Force-stop an app by bundle ID. The app process is terminated.
| Parameter | Type | Description |
|---|---|---|
bundleId * | string | App bundle ID or package name |
device_press_button Press Button
Press a device button. "enter" sends the Return key and can submit a form. iOS has no back button: "back" fails with UNSUPPORTED_ON_IOS; tap the screen's back control instead.
| Parameter | Type | Description |
|---|---|---|
button * | string | Button to press |
device_dismiss_keyboard Dismiss Keyboard
Hide the on-screen keyboard. Call after typing to reveal elements that may be obscured by the keyboard. On iOS this presses Return when a keyboard is shown (which can submit a single-field form) and does nothing otherwise. On Android it does nothing when no keyboard is shown, and fails when the keyboard is still shown after ESCAPE and BACK.
device_dismiss_alert Dismiss Alert
Accept or dismiss a system alert or permission dialog. Use accept=true for "Allow"/"OK", accept=false for "Deny"/"Cancel". Check device_snapshot first to confirm an alert is present.
| Parameter | Type | Description |
|---|---|---|
accept * | boolean | true to accept (Allow/OK), false to dismiss (Deny/Cancel) |
device_logs Device Logs
Capture recent device logs. iOS: system log via IDB. Android: logcat. Optionally filter by text pattern.
| Parameter | Type | Description |
|---|---|---|
durationSeconds | number | How many seconds of logs to retrieve (default: 30) |
filter | string | Text pattern to filter log entries |
device_scroll_to_element Scroll To Element
Swipe until an element matching the query is inside the viewport (being in the UI tree is not enough), and report how many swipes it took. Fails when the element is not in view after maxAttempts swipes or the screen stops moving. Specify at least one of: label, identifier, text, type.
| Parameter | Type | Description |
|---|---|---|
direction | string | Finger direction: "up" reveals content below, "down" content above. Default "auto": from where the element is, searching downward first when it is not in the UI tree yet. |
identifier | string | Identifier/resource-id to match |
label | string | Accessibility label to match |
maxAttempts | number | Maximum number of swipes (default: 10) |
text | string | Text content to match |
type | string | Element type to match |
device_get_alert_text Get Alert Text
Get the text content of the currently displayed system alert or dialog. Call this before device_dismiss_alert to understand what the alert says.
device_get_window_size Get Window Size
Get the width and height of the device screen in pixels (Android) or points (iOS).
device_context Context
List or switch between app contexts (NATIVE_APP, WEBVIEW, etc.). Use action=list to see available contexts, action=switch to change. On Android (adb), WEBVIEW appears when a debuggable in-app WebView is open; use webview_cdp to drive its DOM. On iOS, WebView contexts require the Appium backend.
| Parameter | Type | Description |
|---|---|---|
action * | string | Action: list available contexts or switch to one |
context | string | Context name to switch to (required for action=switch) |
device_clipboard Clipboard
Read or write the device clipboard. Use action=get to read clipboard text, action=set to write. On Android (adb), only action=set is supported; reading requires the Appium backend.
| Parameter | Type | Description |
|---|---|---|
action * | string | Action: get clipboard content or set it |
text | string | Text to set on the clipboard (required for action=set) |
device_screen_recording Screen Recording
Start or stop recording the device screen as an MP4 video. Call with action=start to begin, action=stop to end and save. Returns the file path on stop.
| Parameter | Type | Description |
|---|---|---|
action * | string | Action: start or stop recording |
outputPath | string | File path to save the recording (optional, for start) |
device_generate_locators Generate Locators
Generate ranked locator suggestions for all interactive elements on the current screen. Each element gets a prioritized list: identifier (testID/resource-id) > label > text > type. Use this after healing to find the correct selector for updating test source code.
device_get_element_text Get Element Text
Find an element in the UI hierarchy by query and return its text content (label or value). Specify at least one of: label, identifier, text, type. Call device_snapshot first to see available elements.
| Parameter | Type | Description |
|---|---|---|
identifier | string | Accessibility identifier (iOS) or resource-id (Android) |
label | string | Accessibility label (iOS) or content-description (Android) |
text | string | Visible text content |
type | string | Element type/class name |
device_list_devices List Devices
List all connected devices and simulators/emulators.
device_select_device Select Device
Select a device to use for this session. Call device_list_devices first to see available devices.
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | Device ID to select (UDID for iOS, serial for Android) |
hermes_cdp Hermes CDP
Speak raw Chrome DevTools Protocol (CDP) to the React Native Hermes JS runtime of a running app via Metro’s inspector proxy (iOS and Android). Requires a DEBUG build with Metro running; release builds expose no inspector. Blocked methods (for safety): Runtime.terminateExecution, Inspector.detached. Node 20 must be launched with NODE_OPTIONS="--experimental-websocket" (Node 22+ works out of the box). Example: method "Runtime.evaluate" with params {"expression":"1+1","returnByValue":true} — the raw response nests the value at result.result.value.
| Parameter | Type | Description |
|---|---|---|
method * | string | The CDP method to invoke, e.g. "Runtime.evaluate". |
appId | string | Override the expected app bundle identifier. |
metroPort | number | Override the Metro inspector proxy port for this call. |
origin | string | Override the debugger WebSocket HTTP(S) Origin to match a custom Metro server base URL (default: http://127.0.0.1:<metroPort>). |
params | object | Optional CDP method parameters. |
timeoutMs | integer | Timeout in milliseconds applied to each phase independently: discovery, socket open, identity probe, and the CDP call (default 30000, floored to 1000, max 120000). |
hermes_targets Hermes Targets
List and diagnose the debuggable React Native Hermes targets that Metro’s inspector proxy currently exposes (iOS and Android). Reports each candidate (id / title / appId / logicalDeviceId / nativePageReloads / wsUrl) plus which target would be chosen or why it is ambiguous. Use it to confirm Metro is running and your app is registered. Requires a DEBUG build with Metro running.
| Parameter | Type | Description |
|---|---|---|
all | boolean | Bypass the appId filter and list ALL candidates (diagnostics). |
appId | string | Override the expected app bundle identifier. |
metroPort | number | Override the Metro inspector proxy port for this call. |
webview_cdp WebView CDP
Speak raw Chrome DevTools Protocol (CDP) to a debuggable in-app Android WebView — the web page inside the app’s in-app browser. Unlike hermes_cdp (React Native JS engine, no DOM), this targets the Chromium page and exposes the full Chrome surface (Runtime, DOM, Page, Network, Input). Android only; the app must call WebView.setWebContentsDebuggingEnabled(true). Blocked methods (for safety): Browser.close, Target.closeTarget, Target.disposeBrowserContext, Browser.crashGpuProcess. Node 20 must be launched with NODE_OPTIONS="--experimental-websocket" (Node 22+ works out of the box). Example: m…
| Parameter | Type | Description |
|---|---|---|
method * | string | The CDP method to invoke, e.g. "Runtime.evaluate". |
params | object | Optional CDP method parameters. |
timeoutMs | integer | Timeout in milliseconds for discovery and each CDP round-trip (default 30000, floored to 1000, max 120000). |
urlFilter | string | Select the WebView page whose URL contains this substring when several WebView pages are open. |