MCP server for Android 11+ devices. C# .NET 8.
PowerShell:
iwr https://raw.githubusercontent.com/TheDeathDragon/AndroidMCP/main/scripts/install.ps1 | iexOr auto-merge into ~/.claude.json:
& ([scriptblock]::Create((iwr https://raw.githubusercontent.com/TheDeathDragon/AndroidMCP/main/scripts/install.ps1))) -AutoConfigThe installer fetches the latest release, extracts to
%LOCALAPPDATA%\Programs\android-mcp\, and prints the Claude Code config
(or merges it with -AutoConfig).
After install, /reload-plugins in Claude Code to load the tools.
Requires adb on PATH.
-AutoConfig writes this for you. Manual:
{
"mcpServers": {
"android-mcp": {
"type": "stdio",
"command": "C:/Users/<you>/AppData/Local/Programs/android-mcp/android-mcp.exe"
}
}
}| Name | Purpose |
|---|---|
list_devices |
enumerate devices visible to adb |
screenshot |
PNG via on-device agent |
dump_hierarchy |
XML / lean JSON view tree |
device_info |
device info |
click |
tap (x, y) |
long_press |
hold (x, y) for duration_ms |
swipe |
swipe with duration |
input_text |
type ASCII into focused field |
key_event |
KEYCODE by name or number |
shell |
arbitrary adb shell (60 s timeout) |
push_file |
host -> device file copy |
pull_file |
device -> host file copy |
install_apk |
push + pm install |
list_packages |
installed packages with metadata |
get_package_info |
single-app summary |
launch_app |
monkey -p <pkg> launcher intent |
stop_app |
am force-stop |
clear_app_data |
pm clear |
set_package_enabled |
pm enable / pm disable-user |
get_top_activity |
foreground component from dumpsys activity |
screen_size |
display W×H from wm size |
swipe_direction |
directional swipe sized to the screen |
scroll_to_edge |
fling to edge |
find_element |
selector → matching nodes |
tap_element |
tap element center |
wait_for_element |
poll hierarchy until match or timeout |
scroll_until_visible |
scroll loop with stability + edge detection |
press_home |
KEYCODE_HOME |
press_back |
KEYCODE_BACK |
press_recents |
KEYCODE_APP_SWITCH |
wake_unlock |
wake screen + wm dismiss-keyguard (no PIN) |
clear_recents |
remove non-home tasks via am stack remove |
Every tool except list_devices needs serial. Call list_devices first.
If the device may be asleep or on the lockscreen, call wake_unlock once.
- Prefer
find_element/tap_elementoverdump_hierarchy+click. dump_hierarchyreturns lean JSON by default; passformat=xmlfor raw.- XPath siblings read labeled values:
//node[@text='X']/following-sibling::node[1]. screenshotis for visual checks, not text extraction.
initialize.result.instructions ships a condensed version of these tips
so MCP-aware clients inject them into the model's system prompt.
%LOCALAPPDATA%\Programs\android-mcp\android-mcp.exe # stdio
%LOCALAPPDATA%\Programs\android-mcp\android-mcp.exe --http 9460 # HTTP + SSE
Flags: --debug, --quiet.
git clone --recursive https://github.com/TheDeathDragon/AndroidMCP.git
cd AndroidMCP
agent\build.bat
publish.bat