scrcpy-mcp
v0.5.0MCP server for Android device control via ADB and scrcpy
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
start_session
Start a scrcpy session for fast input control and screenshots. When a session is active, tap/swipe/text/screenshot are 10-50x faster. Requires scrcpy-server to be installed.
| Parameter | Type | Description |
|---|---|---|
maxFps | integer | Max frames per second (default 30) |
maxSize | integer | Max screen dimension in pixels (default 1024) |
serial | string | Device serial number |
stop_session
Stop the active scrcpy session. Tools will fall back to ADB commands.
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
version
Report which scrcpy version is being used by the MCP server. The version always describes the scrcpy-server file the session pushes: it comes from the SCRCPY_SERVER_VERSION environment variable, or from the scrcpy client belonging to the same install as that server, or a built-in default.
device_list
List all connected Android devices with their serial numbers, state, and model
device_info
Get detailed info about a device: model, Android version, screen size, SDK level, battery level
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number. If omitted, uses the only connected device. |
screen_on
Wake the device screen (turn screen on)
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
screen_off
Turn the device screen off
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
connect_wifi
Enable WiFi ADB and connect to the device wirelessly. Returns the connection address.
| Parameter | Type | Description |
|---|---|---|
port | integer | TCP port for ADB connection (default: 5555) |
serial | string | Device serial number |
disconnect_wifi
Disconnect from a wireless ADB device
| Parameter | Type | Description |
|---|---|---|
address * | string | Device address (e.g., 192.168.1.100:5555) |
rotate_device
Rotate the device screen (requires active scrcpy session)
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
expand_notifications
Expand the notification panel (requires active scrcpy session)
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
expand_settings
Expand the quick settings panel (requires active scrcpy session)
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
collapse_panels
Collapse all open panels (notification, settings) (requires active scrcpy session)
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
screenshot
Take a screenshot of the Android device screen. Returns the image as base64.
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
screen_record_start
Start recording the screen. Recording continues until screen_record_stop is called.
| Parameter | Type | Description |
|---|---|---|
duration | number | Max recording duration in seconds (optional, device limit usually 180s) |
remotePath | string | Path on device to save recording |
serial | string | Device serial number |
screen_record_stop
Stop screen recording and optionally pull the file to the host.
| Parameter | Type | Description |
|---|---|---|
localPath | string | Local path to save recording (only if pullToHost is true) |
pullToHost | boolean | Pull the recording to the host machine |
serial | string | Device serial number |
tap
Tap at the specified screen coordinates
| Parameter | Type | Description |
|---|---|---|
x * | integer | X coordinate |
y * | integer | Y coordinate |
serial | string | Device serial number |
swipe
Perform a swipe gesture from one point to another
| Parameter | Type | Description |
|---|---|---|
x1 * | integer | Start X coordinate |
x2 * | integer | End X coordinate |
y1 * | integer | Start Y coordinate |
y2 * | integer | End Y coordinate |
duration | integer | Duration in milliseconds |
serial | string | Device serial number |
long_press
Perform a long press at the specified coordinates
| Parameter | Type | Description |
|---|---|---|
x * | integer | X coordinate |
y * | integer | Y coordinate |
duration | integer | Duration in milliseconds |
serial | string | Device serial number |
drag_drop
Perform a drag and drop gesture from one point to another. Uses input draganddrop on Android 8.0+ (API 26), falls back to swipe on older versions.
| Parameter | Type | Description |
|---|---|---|
endX * | integer | End X coordinate |
endY * | integer | End Y coordinate |
startX * | integer | Start X coordinate |
startY * | integer | Start Y coordinate |
duration | integer | Duration in milliseconds |
serial | string | Device serial number |
input_text
Type text into the currently focused input field
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to type |
serial | string | Device serial number |
key_event
Send a key event to the device. Supports keycodes like HOME, BACK, ENTER, VOLUME_UP, etc.
| Parameter | Type | Description |
|---|---|---|
keycode * | string | number | Keycode name (e.g., 'HOME', 'BACK') or numeric value |
serial | string | Device serial number |
scroll
Scroll at the specified position. dx and dy are scroll amounts (-1 to 1 range approximated for ADB).
| Parameter | Type | Description |
|---|---|---|
dx * | number | Horizontal scroll amount (negative=left, positive=right) |
dy * | number | Vertical scroll amount (negative=up, positive=down) |
x * | integer | X coordinate to scroll at |
y * | integer | Y coordinate to scroll at |
serial | string | Device serial number |
app_start
Launch an app on the device. Uses scrcpy START_APP when a session is active for faster launch, falls back to ADB `am start`. Supports force-stop prefix (+) to stop the app before launching.
| Parameter | Type | Description |
|---|---|---|
packageName * | string | Package name to launch (e.g., 'com.example.app'). Prefix with '+' to force-stop the app first (e.g., '+com.example.app') |
serial | string | Device serial number |
app_stop
Force-stop an app on the device.
| Parameter | Type | Description |
|---|---|---|
packageName * | string | Package name to force-stop (e.g., 'com.example.app') |
serial | string | Device serial number |
app_install
Install an APK file on the device from the host machine.
| Parameter | Type | Description |
|---|---|---|
apkPath * | string | Absolute path to the APK file on the host machine |
serial | string | Device serial number |
app_uninstall
Uninstall an app from the device.
| Parameter | Type | Description |
|---|---|---|
packageName * | string | Package name to uninstall (e.g., 'com.example.app') |
serial | string | Device serial number |
app_list
List installed packages on the device. Optionally filter by name or restrict to system/third-party apps.
| Parameter | Type | Description |
|---|---|---|
filter | string | Filter packages by name (partial match, case-insensitive) |
serial | string | Device serial number |
system | boolean | true = system apps only, false = third-party only, omit = all |
app_current
Get the currently foregrounded app package name and activity.
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
clipboard_get
Get the current clipboard content from the device. Uses scrcpy GET_CLIPBOARD when a session is active (works on Android 10+), falls back to ADB clipboard commands.
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
clipboard_set
Set the clipboard content on the device. Uses scrcpy SET_CLIPBOARD when a session is active (with optional paste flag), falls back to ADB clipboard commands.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to set in the clipboard |
paste | boolean | Also simulate paste action (scrcpy only) |
serial | string | Device serial number |
ui_dump
Dump the full UI hierarchy of the current screen as XML. Useful for understanding screen structure before using ui_find_element.
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |
ui_find_element
Find UI elements on screen by text, resource ID, class name, or content description. Returns matching elements with their tap coordinates. At least one search criterion must be provided.
| Parameter | Type | Description |
|---|---|---|
className | string | Class name to match exactly (e.g., 'android.widget.Button') |
contentDesc | string | Content description to search for (partial match, case-insensitive) |
resourceId | string | Resource ID to match exactly (e.g., 'com.app:id/button') |
serial | string | Device serial number |
text | string | Text content to search for (partial match, case-insensitive) |
shell_exec
Execute an arbitrary ADB shell command on the device and return the output. Use this for any device operation not covered by other tools.
| Parameter | Type | Description |
|---|---|---|
command * | string | Shell command to execute on the device |
serial | string | Device serial number |
file_push
Push a file from the host machine to the device.
| Parameter | Type | Description |
|---|---|---|
localPath * | string | Absolute path to the file on the host machine |
remotePath * | string | Destination path on the device (e.g., /sdcard/myfile.txt) |
serial | string | Device serial number |
file_pull
Pull a file from the device to the host machine.
| Parameter | Type | Description |
|---|---|---|
localPath * | string | Destination absolute path on the host machine |
remotePath * | string | Path to the file on the device (e.g., /sdcard/myfile.txt) |
serial | string | Device serial number |
file_list
List directory contents on the device.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to the directory on the device (e.g., /sdcard/) |
serial | string | Device serial number |
start_video_stream
Start an HTTP MJPEG video stream of the device screen and open a viewer window (ffplay). Starts a scrcpy session automatically if needed.
| Parameter | Type | Description |
|---|---|---|
port | integer | HTTP port for the MJPEG stream (default 7183) |
serial | string | Device serial number |
stop_video_stream
Stop the HTTP MJPEG video stream and close the viewer window for a device.
| Parameter | Type | Description |
|---|---|---|
serial | string | Device serial number |