adb-mcp

v0.1.2
@samsadch/adb-mcp Checked 1 hour ago Published 23 days ago

Model Context Protocol (MCP) server for Android ADB: inspect databases, capture screenshots, manage apps, edit SharedPreferences, and control devices with AI…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_devices List connected devices

Lists every connected Android device and emulator with its id, model and connection state. Use this first when no target is set, or when a call reports NO_DEVICE or AMBIGUOUS_DEVICE.

set_target Set target device and package

Pins the device and/or Android package that every other tool will act on, so they do not have to be passed on each call. Set this once at the start of a session. With a single device connected the device is inferred automatically, and the package is detected from the workspace when the client exposes roots.

ParameterTypeDescription
devicestringDevice id exactly as list_devices reports it, e.g. "emulator-5554".
packageNamestringAndroid applicationId, e.g. "com.example.app".

get_device_info Get device information

Returns OS version, SDK level, manufacturer, model, ABI, screen size, density, battery level and dark-mode state for the target device. Call this before reasoning about layout, API availability or power behaviour.

ParameterTypeDescription
devicestringDevice id. Defaults to the target set by set_target.

take_screenshot Take device screenshot

Captures a live screenshot of the connected Android device screen as a PNG image. Returns multimodal image content suitable for visual analysis and verification.

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device if not specified.
savePathstringOptional local file path to save the captured PNG image to.

dump_view_hierarchy Dump UI view hierarchy

Captures the current on-screen Android view hierarchy via UIAutomator, returning structured JSON nodes with text, resourceId, contentDesc, clickable state, and bounding box coordinates.

ParameterTypeDescription
compressedbooleanWhen true (default), filters out non-interactive empty layout containers to reduce token consumption.
devicestringDevice id. Defaults to sticky target device if not specified.

tap_coordinates Tap screen coordinates

Performs a single tap touch event at specific (x, y) pixel coordinates on the screen.

ParameterTypeDescription
x *numberX coordinate on screen in pixels.
y *numberY coordinate on screen in pixels.
devicestringDevice id. Defaults to sticky target device if not specified.

tap_element Tap UI element by text or resource ID

Finds an on-screen UI element by its text, resource ID, or content description and taps its center. Automatically inspects the view hierarchy to locate the target.

ParameterTypeDescription
contentDescstringAccessibility content description to match.
devicestringDevice id. Defaults to sticky target device if not specified.
resourceIdstringAndroid resource-id (e.g. "btn_login" or "com.example.app:id/submit").
textstringVisible button or label text to find and tap (case-insensitive match).

input_text Type text into active input field

Types the specified string into the currently focused text field on the device. Automatically escapes spaces and shell characters.

ParameterTypeDescription
text *stringText string to type into the focused input field.
devicestringDevice id. Defaults to sticky target device if not specified.

press_key Press hardware or navigation key

Dispatches a key event to the device. Supports named keys (BACK, HOME, RECENTS/APP_SWITCH, ENTER, LOCK/POWER, VOLUP, VOLDOWN, TAB, DELETE/BACKSPACE, ESCAPE, CAMERA, MENU, SEARCH, UP, DOWN, LEFT, RIGHT, CENTER) or direct Android integer keycodes.

ParameterTypeDescription
key *string | numberKey name (e.g. "BACK", "HOME", "ENTER", "RECENTS", "LOCK") or integer keycode.
devicestringDevice id. Defaults to sticky target device if not specified.

swipe_screen Swipe or scroll screen

Performs a swipe gesture across the screen. Specify either a high-level direction ("up", "down", "left", "right") or explicit start and end (x, y) pixel coordinates.

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device if not specified.
directionstringHigh-level swipe direction: "up" scrolls down, "down" scrolls up, "left" scrolls right, "right" scrolls left.
durationMsnumberSwipe duration in milliseconds (default 300ms).
endXnumberEnd X pixel coordinate.
endYnumberEnd Y pixel coordinate.
startXnumberStart X pixel coordinate.
startYnumberStart Y pixel coordinate.

install_app Install APK on device

Installs an APK file from the host filesystem onto the target device with optional permission granting and reinstall flags.

ParameterTypeDescription
apkPath *stringAbsolute local filesystem path to the .apk file on the host machine.
allowDowngradebooleanAllow version downgrade (-d flag). Default false.
allowTestOnlybooleanAllow test-only packages (-t flag). Default true.
devicestringDevice id. Defaults to sticky target device if not specified.
grantPermissionsbooleanGrant all runtime permissions listed in the manifest (-g flag). Default true.
reinstallbooleanReinstall existing app, keeping its data (-r flag). Default true.

uninstall_app Uninstall application

Uninstalls an application package from the device.

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device if not specified.
keepDatabooleanKeep application data and cache directories (-k flag). Default false.
packageNamestringPackage applicationId to uninstall. Defaults to sticky target package.

list_packages List installed packages

Queries installed applications on the device with filtering by third-party, system, or enabled/disabled state.

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device if not specified.
filterstringFilter packages: "third_party" (default), "system", "all", "enabled", or "disabled".
includeApkPathbooleanWhen true, returns the filesystem path to the installed base APK.
querystringOptional search query to filter package names by substring.

start_app Start application or activity

Launches an application main launcher activity or starts a specific Activity class component.

ParameterTypeDescription
activitystringOptional specific Activity component to launch (e.g. ".MainActivity" or "com.example.app/.ui.HomeActivity").
devicestringDevice id. Defaults to sticky target device if not specified.
packageNamestringPackage applicationId to start. Defaults to sticky target package.
stopFirstbooleanWhen true, force-stops the app before starting to guarantee a cold launch.

stop_app Force-stop application

Terminates all running processes of the target application package (`am force-stop`).

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device if not specified.
packageNamestringPackage applicationId to stop. Defaults to sticky target package.

restart_app Restart application

Force-stops and re-launches the application for a clean restart.

ParameterTypeDescription
activitystringOptional specific Activity class to start after stopping.
devicestringDevice id. Defaults to sticky target device if not specified.
packageNamestringPackage applicationId to restart. Defaults to sticky target package.

clear_app_data Clear application data and cache

Clears all user data, database records, and cache for the application (`pm clear`).

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device if not specified.
packageNamestringPackage applicationId whose data to reset. Defaults to sticky target package.
restartbooleanAutomatically relaunch the application after clearing data. Default false.

grant_permission Grant runtime permission

Grants an Android runtime permission to the target application (e.g. "CAMERA", "POST_NOTIFICATIONS", "ACCESS_FINE_LOCATION").

ParameterTypeDescription
permission *stringPermission name (e.g. "CAMERA", "POST_NOTIFICATIONS", or full "android.permission.CAMERA").
devicestringDevice id. Defaults to sticky target device if not specified.
packageNamestringPackage applicationId. Defaults to sticky target package.

revoke_permission Revoke runtime permission

Revokes a granted runtime permission from the application.

ParameterTypeDescription
permission *stringPermission name to revoke (e.g. "CAMERA", "POST_NOTIFICATIONS").
devicestringDevice id. Defaults to sticky target device if not specified.
packageNamestringPackage applicationId. Defaults to sticky target package.

get_app_info Get application info and permissions

Inspects installed package details: version name, version code, target SDK, min SDK, install times, and requested/granted permissions.

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device if not specified.
packageNamestringPackage applicationId to inspect. Defaults to sticky target package.

list_databases List application SQLite databases

Lists all SQLite database files located inside the application sandbox (`/data/data/<pkg>/databases/`).

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

inspect_database_overview Inspect database overview table

Generates an inventory table summarizing all tables in the database with their row counts and column counts.

ParameterTypeDescription
database *stringSQLite database file name (e.g. "app.db" or "users_database").
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

list_database_tables List tables in a database

Lists all user tables defined inside the specified SQLite database.

ParameterTypeDescription
database *stringSQLite database file name.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

get_table_schema Get table column definitions & schema

Inspects column names, data types, nullability, default values, and primary key flags for a specific table.

ParameterTypeDescription
database *stringSQLite database file name.
table *stringTable name to inspect.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

get_table_data Browse table rows with pagination

Fetches rows, columns, and total row count from a table with pagination (`limit` and `offset`) and sorting support.

ParameterTypeDescription
database *stringSQLite database file name.
table *stringTable name to browse.
devicestringDevice id. Defaults to sticky target device.
limitnumberMaximum number of rows to return (default 50).
offsetnumberRow offset for pagination (default 0).
orderBystringOptional ORDER BY clause (e.g. "id DESC" or "created_at ASC").
packageNamestringPackage applicationId. Defaults to sticky target package.

create_database_table Create a new table in database

Creates a new SQLite table with structured column definitions or raw SQL DDL.

ParameterTypeDescription
database *stringSQLite database file name.
tableName *stringTable name to create.
columnsarrayList of column definitions.
devicestringDevice id. Defaults to sticky target device.
ifNotExistsbooleanAdd IF NOT EXISTS clause (default true).
packageNamestringPackage applicationId. Defaults to sticky target package.
rawSqlstringRaw CREATE TABLE SQL statement (overrides columns if provided).

query_database Execute SQL query on database

Runs an arbitrary SQL query (SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, etc.) against an app database. SELECT queries return structured JSON columns and rows.

ParameterTypeDescription
database *stringSQLite database file name.
sql *stringSQL statement to execute.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

delete_database_row Delete specific row(s) from a table

Deletes matching row(s) from a table using a WHERE filter condition.

ParameterTypeDescription
database *stringSQLite database file name.
table *stringTable name to delete from.
where *stringWHERE filter condition clause (e.g. "id = 42" or "status = 'archived'").
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

clear_database_table Clear all data from a table (truncate)

Wipes all records from a table (`DELETE FROM <table>;`) and optionally resets its SQLite auto-increment sequence.

ParameterTypeDescription
database *stringSQLite database file name.
table *stringTable name to clear.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.
resetAutoIncrementbooleanReset auto-increment ID counter (default true).

export_database Export database file to host

Downloads/exports a copy of the SQLite database (merging WAL journals) to a local host destination file path.

ParameterTypeDescription
database *stringSQLite database file name on device.
destinationPath *stringLocal absolute filesystem destination file path on the host machine.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

list_shared_preferences List SharedPreferences XML files

Discovers all SharedPreferences `.xml` files in `/data/data/<pkg>/shared_prefs/`.

ParameterTypeDescription
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

read_shared_preferences Read all SharedPreferences key-values

Reads all key-value pairs stored in a preferences XML file with exact data types.

ParameterTypeDescription
fileName *stringSharedPreferences file name (e.g. "user_prefs.xml" or "app_config").
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

get_shared_preference Get a specific preference key value & type

Fetches a single key value and its explicit data type from a SharedPreferences file.

ParameterTypeDescription
fileName *stringSharedPreferences file name.
key *stringKey name to look up.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

set_shared_preference Set or update a preference key-value

Inserts or modifies a preference key-value pair with automatic or explicit data type.

ParameterTypeDescription
fileName *stringSharedPreferences file name.
key *stringKey name to set.
value *Value to store.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.
typestringExplicit data type. Auto-detected if omitted.

delete_shared_preference Delete a specific preference key

Removes a key-value entry from a SharedPreferences XML file.

ParameterTypeDescription
fileName *stringSharedPreferences file name.
key *stringKey name to delete.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

clear_shared_preferences Clear all preferences in a file

Wipes all key-value pairs in a SharedPreferences file, resetting it to `<map></map>`.

ParameterTypeDescription
fileName *stringSharedPreferences file name to clear.
devicestringDevice id. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

get_logcat Get Logcat logs

Retrieves filtered Android system and application logs non-blockingly. Supports filtering by application package (PID-scoped), minimum log level, tag, and search query.

ParameterTypeDescription
clearFirstbooleanIf true, clears the logcat buffer before capturing logs.
devicestringDevice serial/identifier. Defaults to sticky target device.
filterByPackagebooleanFilter logs to only this package/PID when packageName is present. Set to false to see system-wide logs.
lineLimitintegerMaximum number of recent log lines to return (1-2000, default 200).
logLevelstringMinimum log level: V (Verbose), D (Debug), I (Info), W (Warn), E (Error), F (Fatal).
packageNamestringPackage applicationId to filter logs for. Defaults to sticky target package if set.
searchstringCase-insensitive substring search filter across log messages.
tagstringFilter logs by a specific Logcat tag (e.g. "ActivityManager", "AndroidRuntime").

clear_logcat Clear Logcat buffer

Clears the Android logcat circular buffer on the device.

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.

get_app_memory Inspect app memory consumption

Analyzes process memory allocation for a given package using dumpsys meminfo. Provides structured totals in MB and detailed breakdowns of Java Heap, Native Heap, Graphics, Code, and Stack.

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.
packageNamestringPackage applicationId. Defaults to sticky target package.

set_battery_level Set simulated battery level

Simulates a specific battery level percentage (0-100) and automatically unplugs device from power.

ParameterTypeDescription
level *numberBattery percentage level from 0 to 100.
devicestringDevice serial/identifier. Defaults to sticky target device.

unplug_battery Simulate battery unplugged (discharging)

Simulates disconnecting the Android device from charger / AC power supply (sets state to discharging).

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.

reset_battery Reset battery to hardware state

Restores battery reporting and charging status to the physical / real hardware state.

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.

force_doze_mode Force device into Doze mode

Forces device into deep Doze mode (idle state) for testing background jobs, alarms, and battery optimizations.

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.

exit_doze_mode Exit Doze mode

Unforces Doze mode and restores normal active operation on the device.

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.

toggle_dark_mode Toggle or set system Dark Mode

Switches system UI theme between Dark Mode and Light Mode, or sets an explicit mode.

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.
modestringExplicit theme mode ("light" or "dark"), or "toggle" (default).

toggle_animations Toggle or set system animations

Enables or disables system UI animations (window, transition, and animator scales) or toggles between 1.0x and 0.0x.

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.
enabledbooleanExplicitly set animations ON (true: 1.0x), OFF (false: 0.0x), or omit to toggle current state.

send_broadcast Send Android broadcast intent

Sends a custom broadcast intent to registered receivers with optional target package, component, and typed extras.

ParameterTypeDescription
action *stringBroadcast intent action string (e.g. "android.intent.action.BOOT_COMPLETED" or "com.example.ACTION_SYNC").
componentstringExplicit receiver component class (e.g. "com.example.app/.receiver.MyReceiver").
devicestringDevice serial/identifier. Defaults to sticky target device.
extrasobjectKey-value dictionary of intent extra values (strings, numbers, booleans).
packageNamestringPackage applicationId to restrict the broadcast to.

list_directory List device directory contents

Lists all files and directories at a remote path on the Android device with detailed metadata (type, permissions, size, date).

ParameterTypeDescription
devicestringDevice serial/identifier. Defaults to sticky target device.
pathstringRemote path on the Android device (default: "/sdcard").

read_device_file Read device file content

Reads text content of a remote file directly on the Android device without downloading it to the host.

ParameterTypeDescription
path *stringRemote file path on the Android device (e.g. "/sdcard/Download/config.json", "/data/local/tmp/app.log").
devicestringDevice serial/identifier. Defaults to sticky target device.
maxLinesintegerMaximum number of lines to read (default: 500).

create_directory Create directory on device

Creates a directory path recursively on the Android device filesystem ("mkdir -p").

ParameterTypeDescription
path *stringRemote directory path to create on device (e.g. "/sdcard/MyFolder").
devicestringDevice serial/identifier. Defaults to sticky target device.

delete_file Delete file or directory on device

Deletes a file or directory recursively on the Android device ("rm -rf").

ParameterTypeDescription
path *stringRemote file or directory path to delete.
devicestringDevice serial/identifier. Defaults to sticky target device.

move_file Move or rename file on device

Moves or renames a file or directory on the Android device ("mv").

ParameterTypeDescription
destPath *stringDestination path on device.
sourcePath *stringSource path on device.
devicestringDevice serial/identifier. Defaults to sticky target device.

push_file Push file or directory to device

Transfers a local file or directory from the host machine to a path on the Android device.

ParameterTypeDescription
localPath *stringAbsolute or relative path to the source file/directory on the host machine.
remotePath *stringDestination path on the Android device (e.g. "/sdcard/Download/file.txt" or "/data/local/tmp/").
devicestringDevice serial/identifier. Defaults to sticky target device.

pull_file Pull file or directory from device

Transfers a file or directory from the Android device to the host machine filesystem.

ParameterTypeDescription
localPath *stringDestination file or directory path on the host machine.
remotePath *stringSource path on the Android device (e.g. "/sdcard/Download/test.txt" or "/data/local/tmp/app.log").
devicestringDevice serial/identifier. Defaults to sticky target device.

execute_shell_command Execute shell command on device

Executes an arbitrary ADB shell command on the target Android device and returns its standard output.

ParameterTypeDescription
command *stringShell command string to execute (e.g. "ls -la /sdcard", "getprop ro.build.version.release", "df -h").
devicestringDevice serial/identifier. Defaults to sticky target device.
timeoutMsintegerExecution timeout in milliseconds (default 15000).

tap_by_text Tap UI element by visible text

Locates a UI element matching visible text, calculates its center bounds, and dispatches a touch tap. Eliminates manual coordinate extraction.

ParameterTypeDescription
text *stringVisible text on the button, label, or view to tap.
devicestringDevice serial/identifier. Defaults to sticky target device.

tap_by_id Tap UI element by resource-id

Locates a UI element matching an Android resource-id (e.g. "btn_submit", "com.example:id/save"), calculates center bounds, and taps it.

ParameterTypeDescription
resourceId *stringResource ID of the target element to tap.
devicestringDevice serial/identifier. Defaults to sticky target device.

assert_ui_element Assert UI element visibility

Verifies whether an element with matching text, resource-id, or content-desc currently appears on the device screen.

ParameterTypeDescription
contentDescstringAccessibility content description to match.
devicestringDevice serial/identifier. Defaults to sticky target device.
resourceIdstringResource-id to match.
textstringText to match.

list_cloud_devices List Android Device Streaming cloud devices

Lists remote physical devices (Pixel, Galaxy, foldables) available for cloud streaming via the Android CLI.

start_cloud_device_stream Start Android Device Streaming session

Reserves and connects to a remote physical device in Google Cloud over an ADB-over-SSL tunnel.

ParameterTypeDescription
deviceModel *stringCloud device model or ID (e.g. "Pixel 10 Pro", "Pixel 9", "Galaxy S24").
projectstringGoogle Cloud / Firebase project ID if not configured globally.

stop_cloud_device_stream Stop Android Device Streaming session

Releases a cloud device reservation session started via Android CLI.

ParameterTypeDescription
sessionIdOrDevice *stringActive session ID or device identifier to stop.