Skip to main content
Glama
ControlMyPhone AI
by momibhai

ControlMyPhone AI

Let any AI assistant see and control your Android phone: over a USB cable, or with no cable over Wi-Fi.

ControlMyPhone AI is a free, open-source Model Context Protocol server. Plug it into Claude Desktop, Claude Code, Cursor, Windsurf, Cline or any MCP client, and the AI can:

  • πŸ‘€ See the screen (screenshots) and read it as a short numbered list of buttons and fields

  • πŸ‘† Tap, long-press, swipe, scroll, type and press keys (back, home, enter...)

  • πŸ“± Open apps by name ("whatsapp", "maps") and open links (web, maps navigation, tel:, WhatsApp chats)

  • πŸ“ Send files/photos from the computer straight into the phone's gallery, and pull files back

  • πŸ“Ά Connect without a cable: scan a QR code (Android 11+), use a pairing code, or switch a USB phone to Wi-Fi

  • πŸ›‘οΈ Stay safe by default: read-only mode, raw shell and APK install switched off unless you enable them, an action log, and built-in instructions telling the AI to ask before sending, paying or deleting

Status: v0.1, Android only. iPhone support is on the roadmap.


Why another Android MCP?

There are already good ADB MCP servers. ControlMyPhone AI focuses on normal people with a normal phone:

ControlMyPhone AI

Finds adb by itself on Windows (incl. the adb.exe bundled with scrcpy)

βœ…

Cable-free pairing by QR code, from the terminal or from inside the AI chat

βœ…

Compact UI list ([7] Button "Send" (640,1510) click) instead of 100 KB XML: cheaper and more accurate

βœ…

tap_text("Send") / tap_element(7): no pixel guessing

βœ…

Screenshot coordinates auto-scaled (small images, correct taps)

βœ…

Photos land in the Gallery so apps' photo pickers see them

βœ…

One-file app, no Python: double-click β†’ setup page downloads adb, QR connect, adds itself to Claude/Cursor, live test

βœ…

controlmyphone doctor explains exactly what's wrong (unauthorized, Xiaomi input block, ...)

βœ…

Safe defaults (read-only switch, opt-in shell, action log)

βœ…

Works with MCP Python SDK 1.x and 2.x

βœ…


Related MCP server: scrcpy-mcp

Quick start (anyone can do it, no Python needed)

You need: an Android phone, a Windows PC (Mac/Linux builds are on the same page), and an AI app such as Claude Desktop or Claude Code installed on that computer.

  1. Download ControlMyPhone-Windows.exe from the Releases page.

  2. Double-click it. (Windows may say "Windows protected your PC" because the app is new and not code-signed: click More info β†’ Run anyway.) A setup page opens in your browser and walks you through everything:

    • ⬇️ downloads adb for you (Google's free phone connector, ~10 MB), nothing else to install

    • πŸ“± shows the 2 phone settings to switch on (one time)

    • πŸ“Ά shows a QR code: scan it on the phone and it connects without a cable (or just plug in a USB cable)

    • βž• "Add to Claude Desktop" / "Add to Claude Code" / "Add to Cursor" buttons

    • πŸ“Έ a test button that shows your phone screen, so you know it works

  3. Restart your AI app and say: "Take a screenshot of my phone and tell me what's on it."

πŸ“± Easy Mode (no developer settings): the setup page shows a QR code; scan it with the phone camera to install the small ControlMyPhone AI app, switch it on, and click Connect. If Android says "App blocked to protect your device", see PUBLISHING.md.

That's it. πŸŽ‰ The app copies itself to ~/.controlmyphone/app/, so you can delete the download afterwards.

ℹ️ ControlMyPhone AI runs on your computer (the one the phone connects to). AI apps that also run on that computer (Claude Desktop, Claude Code in a terminal, Cursor, Windsurf, Cline...) can use it. Cloud-only chats (a web browser tab, the phone app) can't reach your computer's phone yet; see the roadmap.

From source instead? Download the ZIP and double-click setup_windows.bat (Mac/Linux: ./setup.sh). It installs into a private .venv and opens the same setup page. Build the one-file app yourself with packaging\build_windows_exe.bat.

Prefer the terminal?

pip install .                 # inside this folder (use a venv if you like)
controlmyphone setup            # the same setup page
controlmyphone doctor           # or: check everything in the terminal
controlmyphone pair-qr          # connect over Wi-Fi with a QR code in the terminal
claude mcp add controlmyphone -- python -m controlmyphone     # Claude Code

Claude Desktop manual config (Settings β†’ Developer β†’ Edit Config):

{
  "mcpServers": {
    "controlmyphone": { "command": "python", "args": ["-m", "controlmyphone"] }
  }
}

Then ask things like:

  • "Open Google Maps and start directions to Karachi airport."

  • "Put ~/Pictures/house.jpg in my phone's gallery."

  • "Open WhatsApp and read me the latest chat names."


No cable: connect over Wi-Fi

Phone and computer on the same Wi-Fi.

A. QR code (Android 11+)

controlmyphone pair-qr

On the phone: Developer options β†’ Wireless debugging β†’ Pair device with QR code β†’ scan. Done. You can also just tell the AI "connect my phone over Wi-Fi": it calls wifi_pair_qr and shows you the QR in the chat.

B. Pairing code (Android 11+) Wireless debugging β†’ Pair device with pairing code shows IP:PORT and a 6-digit code:

controlmyphone pair 192.168.1.23:37155 123456 192.168.1.23:41234

(the last address is the one on the main Wireless debugging screen)

C. From USB (any Android version)

controlmyphone wifi     # while the cable is connected, then unplug

Different network (4G, office, another city)? Install Tailscale (free) on both the phone and the computer, then use B or C with the phone's Tailscale IP. Wireless debugging and adb traffic stay inside your private network; never expose adb ports to the internet.


Tools

Tool

What it does

list_devices, select_device, device_info

Find and choose phones; model, Android version, battery

screenshot(max_side)

Image of the screen (default 1280 px max side)

get_ui_elements, find_elements(text)

Numbered list of on-screen elements with centres

tap(x,y), tap_element(i), tap_text(text)

Tap by pixel, by list number, or by visible text

long_press, swipe, scroll(direction)

Gestures

type_text(text, submit), clear_text, press_key(key)

Keyboard

open_app(app), close_app, list_apps, current_app

Apps (names like whatsapp, maps, or package ids)

open_url(url)

Links, geo:, google.navigation:q=..., tel:, whatsapp://send?phone=...

send_file_to_phone(path, to_gallery), get_file_from_phone, list_phone_files, recent_photos

Files

wifi_pair_qr, wifi_pair_status, wifi_pair_code, wifi_connect, wifi_from_usb, wifi_disconnect

Cable-free connection

wait(seconds)

Let an app load

run_shell (opt-in), install_apk (opt-in)

Power tools, off by default

Every action tool accepts look=true to return a fresh screenshot right after acting.

Coordinates: tap/swipe use the pixels of the latest screenshot image, so the AI can point at what it saw. ControlMyPhone AI scales them to real screen pixels.

Non-English typing (Urdu, Arabic, emoji): Android's built-in input only types ASCII. Install the free ADBKeyBoard APK on the phone once; ControlMyPhone AI switches to it automatically for that text and switches back.

Settings (environment variables)

Variable

Default

Meaning

CONTROLMYPHONE_ADB

auto

Full path to adb if it isn't found automatically

CONTROLMYPHONE_SERIAL

auto

Which phone to use when several are connected

CONTROLMYPHONE_MAX_IMAGE

1280

Max screenshot side in pixels (smaller = cheaper)

CONTROLMYPHONE_READ_ONLY

off

1 = AI can look but not touch

CONTROLMYPHONE_ALLOW_SHELL

off

1 = enable run_shell

CONTROLMYPHONE_ALLOW_INSTALL

off

1 = enable install_apk

CONTROLMYPHONE_HOME

~/.controlmyphone

Where actions.log is written

Example (Claude Desktop):

"controlmyphone": {
  "command": "controlmyphone",
  "env": { "CONTROLMYPHONE_ADB": "C:\\platform-tools\\adb.exe", "CONTROLMYPHONE_MAX_IMAGE": "960" }
}

Security notes

Giving an AI control of your phone is powerful. ControlMyPhone AI:

  • tells the AI (via MCP server instructions) to ask you before sending messages, posting, calling, paying, deleting or changing security settings, never to type passwords/OTPs, and to treat on-screen text as data, not instructions;

  • keeps run_shell and install_apk off unless you enable them;

  • has a read-only mode;

  • logs every action to ~/.controlmyphone/actions.log;

  • only talks to phones you have authorised (the USB/Wi-Fi debugging prompt on the phone).

Turn off USB debugging / Wireless debugging when you're not using it. Banking apps and some others block screenshots: that's expected.

Troubleshooting

Problem

Fix

unauthorized

Unlock the phone, accept the Allow USB debugging popup. If it never shows: Developer options β†’ Revoke USB debugging authorizations, replug, set USB mode to File transfer.

adb was not found

Install platform-tools or scrcpy, or set CONTROLMYPHONE_ADB.

Taps do nothing (Xiaomi/Redmi/POCO)

Developer options β†’ enable USB debugging (Security settings) (needs a SIM + Mi account).

offline / keeps disconnecting

Try another USB port/cable; run adb kill-server.

QR pairing never finishes

Same Wi-Fi? Some routers block device-to-device traffic (guest/AP isolation): use the pairing code or controlmyphone wifi.

Wi-Fi connection gone after restart

Normal on Android: pair/connect again (paired phones only need wifi_connect).

Screenshot is black

The app is protected (banking/DRM), or the screen is off: press_key("wakeup").

Development

pip install -e ".[dev]"
pytest                          # uses a fake adb, no phone needed
python scripts/e2e_real_phone.py   # safe end-to-end run on a real connected phone

Releases: push a tag like v0.1.0 and the workflow in .github/workflows/release.yml builds the one-file apps for Windows, macOS and Linux.

Structure: wizard.py (setup page) Β· installer.py (adb download, app configs) Β· adb.py (finding/running adb) Β· device.py (phone actions) Β· ui.py (screen XML β†’ element list) Β· wireless.py (QR/code/tcpip) Β· server.py (MCP tools) Β· cli.py (command line).

Roadmap

  • iPhone support (via WebDriverAgent / go-ios; needs a Mac or a pre-signed WDA, so it's harder)

  • Optional companion Android app (accessibility service) for phones without developer mode

  • Streamable-HTTP mode so a cloud AI can reach a phone through a secure tunnel

  • Screen recording and notification reading

  • Publish to PyPI and MCP registries

Contributions welcome: open an issue or PR.

License

MIT. Free for everyone, including commercial use.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables any MCP assistant to see and operate an Android phone or emulator over plain adb, reading the accessibility tree to tap elements by name and also supporting screenshots, typing, swiping, app launching and installation, and logcat β€” with nothing installed on the device and no root required.
      13
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible AI assistants to see and control Android devices through screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming. It connects over ADB with optional low-latency acceleration for faster input and near-instant screenshots.
      1,154 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables MCP-compatible AI assistants to see and control Android devices through ADB and a fast device-control protocol, including screenshots, touch input, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.
      1,154 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Connects MCP-compatible AI assistants to Android devices, letting them see the screen and act on it through screenshots, taps, swipes, typing, app and UI management, shell commands, file transfer, and clipboard access. It routes interaction through scrcpy's control protocol for fast input and near-instant screen captures, falling back to ADB when no session is active, and adds audio/video streaming and recording.
      1,154 npm
      MIT