android-phone-mcp
Health Gecti
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 48 GitHub stars
Code Basarisiz
- fs.rmSync — Destructive file system operation in server/index.cjs
- process.env — Environment variable access in server/index.cjs
- fs module — File system access in server/index.cjs
- process.env — Environment variable access in server/test.cjs
- network request — Outbound network request in server/test.cjs
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Self-hosted Android MCP server and companion app for AI agents. Control your own phone over Wi-Fi without ADB at runtime.
Android Phone MCP
Android Phone MCP is an open-source, self-hosted Android MCP server and companion app. It lets Claude Desktop, Claude Code, Cursor, Codex, and other Model Context Protocol (MCP) clients automate a physical Android phone over Wi-Fi. Read the screen, take screenshots, tap, swipe, type, and open apps. Device control runs without ADB, USB debugging, or root.
Built by DroidDesk. To automate a rented Android device remotely, see DroidDesk AI phone automation.
Quick start · MCP tools · Compatibility · Security · MIT license · Server tests
Early prototype. Use a dedicated test phone on a trusted network. This project has had no security audit. Keep banking apps, passwords, personal messages, and other sensitive data out of test sessions.
What you can do
- Inspect screen text and controls through the Android accessibility tree and capture screenshots on supported devices.
- Test simple Android UI flows on real hardware, such as opening an app, navigating its screens, and entering text.
- Run the app and MCP server on your own devices without a DroidDesk account or a cloud relay. Your AI client may still need internet access to reach its model provider.
Quick start
1. Build and install DroidDesk Connect Prototype
You need Git, a JDK, Android SDK Platform android-36.1, Android Build Tools 36.1.0, Node.js 20+, npm, and OpenSSL. The commands below use the supplied shell script, which was tested on macOS with Android Studio. The same Android SDK tools were also used to build the APK in PowerShell on Windows.
git clone https://github.com/droiddesk-cloudphone/android-phone-mcp.git
cd android-phone-mcp
./app/build.sh
(cd server && npm ci)
The build produces app/build/connect-debug.apk. The APK uses a locally generated debug signing key for local testing.
Install the test APK over USB
This setup was verified on a Pixel 8 Pro running Android 17 with its bootloader locked. Play Protect blocked installation from the file manager on that Pixel because the app uses Android's accessibility service. Keep Play Protect enabled. For the verified setup, install the test build from your computer with ADB. Play Protect developer guidance
- Install Android SDK Platform-Tools and make
adbavailable on your terminal'sPATH. - On the phone, turn on USB debugging in Developer options. Connect it with a USB data cable, unlock the screen, and approve the Allow USB debugging? prompt from your computer. Android device setup guide
- From the repository root, run the commands below. The phone should appear with the status
devicebefore you install the APK.
adb devices
adb install app/build/connect-debug.apk
Open DroidDesk Connect Prototype to pair it with your MCP server.
2. Connect your MCP client
The client launches server/index.cjs as a local stdio MCP server. Replace the example paths with absolute paths to Node.js, the server script, and a new session file in a private, writable directory. Start one MCP client at a time with the default server settings.
Claude Desktop
Merge this entry into claude_desktop_config.json.
{
"mcpServers": {
"android-phone": {
"command": "/absolute/path/to/node",
"args": ["/absolute/path/to/android-phone-mcp/server/index.cjs"],
"env": { "DD_SESSION_FILE": "/absolute/path/to/private/phone-mcp-session.json" }
}
}
}
Cursor
Merge this entry into ~/.cursor/mcp.json.
{
"mcpServers": {
"android-phone": {
"type": "stdio",
"command": "/absolute/path/to/node",
"args": ["/absolute/path/to/android-phone-mcp/server/index.cjs"],
"env": { "DD_SESSION_FILE": "/absolute/path/to/private/phone-mcp-session.json" }
}
}
}
Claude Code
claude mcp add --env "DD_SESSION_FILE=/absolute/path/to/private/phone-mcp-session.json" \
--transport stdio android-phone -- \
"/absolute/path/to/node" "/absolute/path/to/android-phone-mcp/server/index.cjs"
Codex
Add this entry to ~/.codex/config.toml.
[mcp_servers.android_phone]
command = "/absolute/path/to/node"
args = ["/absolute/path/to/android-phone-mcp/server/index.cjs"]
env = { DD_SESSION_FILE = "/absolute/path/to/private/phone-mcp-session.json" }
Other MCP clients
For other MCP clients, use the same command, arguments, and environment variable in their local stdio settings.
Restart the MCP connection or start a new client session. DD_SESSION_FILE must point to a file that does not exist when the server starts. The server writes the session token and certificate fingerprint to that file and logs them to standard error. Keep both the file and client logs private. If a crash leaves the file behind, confirm the old server process has stopped before removing it.
3. Pair the Android phone
- Connect the phone and computer to the same trusted Wi-Fi network and find the computer's LAN IP address.
- In DroidDesk Connect Prototype, choose Enable accessibility service and enable the app's service in Android settings. Android may require manual approval for a sideloaded app.
- Enter
https://<computer-LAN-IP>:8765in the Android app. Entertokenandcertificate_sha256from the session file on your computer. - Tap Start session and allow notifications when prompted. After granting permission for the first time, you may need to tap Start session again.
- Call
phone_statusand thenget_screenin your MCP client. Try asking it to describe the current screen or open Settings and take a screenshot. - Unplug USB after pairing and call
get_screenagain. The active session uses Wi-Fi.
The phone endpoint listens on all network interfaces on port 8765 by default. DD_BIND restricts the listening address and DD_PORT changes the port. Keep that endpoint off the public internet. When finished, tap Stop session on the phone and stop the MCP server. A server restart generates a new token and certificate fingerprint, so you will need to enter them again.
Available tools
| Tool | What it does |
|---|---|
phone_status |
Reports recent phone polling. A disconnect may take up to 10 seconds to show. |
get_screen |
Reads accessibility elements and their screen bounds. |
screenshot |
Captures a JPEG on supported Android 11+ devices. |
tap, swipe |
Interact using screen pixel coordinates. |
type_text |
Replaces text in the focused non-password field. |
press_home, press_back |
Perform Android navigation actions. |
open_app |
Opens an installed, visible app by package name. |
open_url |
Opens an HTTP or HTTPS URL. |
How it works
The MCP client talks to the server over stdio. The Android app polls the server's HTTPS endpoint over Wi-Fi, authenticates with a temporary session token, and verifies the server's certificate fingerprint. The phone opens no listening port. See architecture and limitations.
Hosted Android MCP for remote phones
Use this repository to automate a phone you own on a local network. If you need a remote device, you can rent a physical Android cloud phone through DroidDesk. To test across multiple real devices, explore phone farm rental.
DroidDesk offers a separate hosted MCP service for rented devices with its own endpoint and credentials. Start with DroidDesk AI phone automation or see the hosted MCP setup guide.
If you have a compatible spare Android device, see how to rent out your phone as a DroidDesk host.
Compatibility and limitations
- On 23 November 2026, screen inspection, JPEG screenshots, tapping, typing, swiping, Home and Back, and opening an app and a web page worked over Wi-Fi on a physical Android phone. The USB cable remained connected during that test.
- On 30 November 2026, we built the APK on Windows and installed it over USB on a Pixel 8 Pro running Android 17 with a locked bootloader. The computer joined the Pixel's Wi-Fi hotspot. After pairing,
phone_statusreported the phone connected andget_screenread the screen with the USB cable unplugged. - In a separate session on the same Pixel, MCP commands over Wi-Fi opened Telegram, searched for a chat, and sent a test message with the device owner's permission.
- Android 8 (API 26) is the declared minimum and still needs testing. Screenshots require Android 11 (API 30) or later. Some apps restrict screen capture or expose limited accessibility information. Device-specific restrictions, power management, and long sessions need further testing.
- The prototype currently lacks iOS support, file transfer, recording, a remote relay, multi-device isolation, operation history, granular access controls, and a way to check whether a screen snapshot is still current. If a disconnect leaves an action's outcome unclear, inspect the phone before retrying.
Test and contribute
cd server
npm ci
npm test
The integration test uses a local TLS client. Android device behavior must be tested on a phone.
Device compatibility reports, bug reports, and pull requests are welcome. Include your phone model and Android version when you report a problem or share a test result. See the contributing guide and security policy.
License
This independent project is available under the MIT License.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi