phone-mcp
Controls an Android phone over adb by exposing the phone's UI and input as tools: capturing screenshots, dumping the UI element tree with centers, tapping, double-tapping, long-pressing, swiping/dragging/CAPTCHA-slider gestures, pressing keys, typing and clearing text, launching/stopping apps by alias or package, waiting, and running multi-step sequences. It also reports the foreground app, screen size and state, and connected devices, and includes a built-in vision-model loop that screenshots, decides, acts, and verifies tasks such as opening Settings and changing the screen timeout.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@phone-mcpopen Settings and set screen timeout to 10 minutes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Auto Phone
English | 简体中文
Auto Phone is a command-line tool that controls an Android phone over adb and outputs JSON, along with an MCP server and an agent skill.
This project is developed with vibe coding.
Requirements
Python 3.10 or later.
adbinstalled and on your PATH;PHONE_ADBcan point at it instead.USB debugging enabled on the phone, authorized after connecting to the computer.
Installing ADBKeyboard on the phone is recommended.
Related MCP server: adb-mcp-server
Install
Install straight from GitHub (this needs git on your machine). The CLI and the MCP server come from the same Python package:
# pipx (recommended)
pipx install "auto-phone[mcp] @ git+https://github.com/Rynque/auto-phone"
# uv users
uv tool install "auto-phone[mcp] @ git+https://github.com/Rynque/auto-phone"
# or pip
pip install "auto-phone[mcp] @ git+https://github.com/Rynque/auto-phone"[mcp] is the recommended install: it includes the MCP server dependency and Pillow. Pillow handles screenshot downscaling.
If you only use the command line and don't need downscaling, drop [mcp].
After installing, run the self-check:
phone doctorIt checks, item by item: the adb executable, device connection, SDK version, screen state, foreground app, ADBKeyboard, Pillow and the model endpoint.
The model endpoint is tested only when PHONE_BASE_URL is set. Anything missing comes with a way to deal with it.
Quick start
phone screenshot shot.png
phone tap 540 1200The first command saves a screenshot to shot.png. Open the image, find the target, and pass its pixel coordinates to phone tap.
Screenshots are full resolution by default, so pixels in the image are screen coordinates and can be used as arguments directly.
If you pass --max-width when capturing, convert using orig_width and width from the returned JSON.
Take another screenshot after an action to confirm the result. If the page is still loading or an animation hasn't finished, wait first:
phone wait 1.5Output format
Except for phone run and phone resume, subcommands print one line of JSON. On success:
{"ok": true, "data": {"tapped": [540, 1200]}}On failure:
{"ok": false, "error": {"code": "DEVICE_NOT_FOUND", "message": "No online device", "hint": "Check the USB connection and developer options"}}Failures exit with code 1. hint says what to do next and is also written to stderr. phone run and phone resume print human-readable progress; with --json-events that becomes a JSONL event stream.
Agent integration
Agent skill
npx skills add Rynque/auto-phoneA skill only provides usage instructions — the package above has to be installed first.
MCP server
Register phone-mcp as a stdio server in your MCP host:
{
"mcpServers": {
"auto-phone": {
"command": "phone-mcp"
}
}
}If the command isn't on your PATH, the host can run python -m auto_phone.mcp_server instead.
MCP tool names match the CLI subcommands, plus a sequence tool for running several actions in a row. The model loop behind phone run is not exposed over MCP; the host's own model decides the actions.
Coordinates refer to the image returned by the latest screenshot, and the server converts them to screen coordinates automatically.
phone run
phone run starts the built-in vision-model loop: take a screenshot, decide the next action, execute it, verify with another screenshot. It needs an OpenAI-compatible vision endpoint:
export PHONE_BASE_URL=https://api.example.com/v1
export PHONE_API_KEY=sk-...
export PHONE_MODEL=your-vision-model
phone run "open Settings and set the screen timeout to 10 minutes"When a session is interrupted, its context is saved to .phone-session.json in the current directory; phone resume continues it.
Common options:
--json-eventsswitches the output to a JSONL event stream, easier for programs to consume.--point-confirmdraws the coordinates onto the screenshot for confirmation before executing; more accurate, at the cost of one extra model call per step.--max-stepscaps the number of steps, 50 by default.
Commands
phone screenshot [path] [--max-width N]
phone ui
phone current
phone size
phone devices
phone tap X Y
phone double-tap X Y
phone long-press X Y
phone swipe X1 Y1 X2 Y2 [--duration-ms 300]
phone drag X1 Y1 X2 Y2
phone slide X1 Y1 X2 Y2
phone key back [name ...]
phone type "text"
phone clear-text
phone launch alias-or-package
phone stop alias-or-package
phone clear-bg
phone wait 1.5
phone run "task"
phone resume [instruction]
phone doctorIn detail:
uiprints the list of interface elements with their center coordinates; use it as a fallback when screenshots fail.currentprints the foreground app and screen state.swipeis a straight-line swipe for scrolling and page turns;--duration-msdefaults to 300.dragis the same move at a lower speed, for reordering and sliders.slideis for CAPTCHA sliders only; its path includes overshoot and jitter.keyaccepts several key names at once and presses them in order. Names includehome,back,enter,del,tab,space,vol-up,vol-down,power,menu,esc, a single letter, a single digit, and numeric keycodes.launchandstopaccept package names as well as built-in aliases. Aliases work in either language, e.g.微信andwechat,淘宝andtaobao,抖音anddouyin,设置andsettings.
Environment variables
PHONE_DEVICEsets the device serial. It is required when more than one device is connected; otherwise commands fail withAMBIGUOUS_DEVICE.PHONE_ADBsets the path to the adb executable. PATH is searched first, and common SDK install locations are probed if that fails.PHONE_BASE_URL,PHONE_API_KEYandPHONE_MODELare the model endpoint, key and model name thatphone runneeds.PHONE_ADBKEYBOARD_APKpoints at the ADBKeyboard apk file; once set, it is installed automatically when needed.PHONE_MAX_STEPSoverrides the step cap forphone run, 50 by default.
License
Released under the MIT license.
This server cannot be deployed
Maintenance
Related MCP Connectors
A real Android phone in the cloud for MCP agents: observe the screen, act, reset to a saved state.
Control real Android and iOS devices with LLM agents — tap, swipe, type, automate flows.
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Remote MCP for Android CLI agent build gate, structured receipts, audit logs, and reviewer-ready evi
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables programmatic control of Android devices via ADB, supporting UI automation, app management, screen capture with OCR, and file transfers through the Model Context Protocol. It allows MCP-compatible clients like Claude Desktop and Cursor to interact directly with physical or emulated Android devices.3Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible agents to control an Android device over the network via ADB, providing tools for shell commands, screen capture, UI inspection, file operations, and input simulation.16 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents and test runners to control Android devices via local ADB, including listing devices, tapping, swiping, typing, sending system keys, launching apps, and dumping UI hierarchy. Communicates over MCP stdio without exposing network listeners.-
- AlicenseNot gradedqualityBmaintenanceEnables controlling an Android device from an MCP client via ADB, including wireless debugging discovery, UI-tree inspection, and performing taps, swipes, typing, app actions, and shell commands without relying on screen coordinates.2 npmMIT