Phone Control (Android ADB)

by hao-cyber

167 stars
3.3k downloads
Not rated
GitHub

About

Enables remote control of Android phones through ADB commands for making calls, sending texts, taking screenshots, managing contacts, launching apps, and retrieving system information.

Details

Author
hao-cyber
Repository
hao-cyber/phone-mcp
GitHub stars
167
Downloads
3,267
License
Apache License 2.0
Categories
Developer Tools, Other, Infrastructure, Design, AI, Communication, Knowledge Base, API

- Call management (make, end, receive calls)
- SMS send/receive with pagination
- Contact access and creation via UI automation
- Screenshots, screen recording, media control
- App launch by name, package, or explicit activity
- Screen analysis and unified interaction (tap, swipe, key, text, find, wait, scroll)
- UI monitoring for element appearance/disappearance

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Phone Control (Android ADB)
    Command (node, npx, python, etc.) uvx
    Arguments
    • Argument 1 phone-mcp

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository


uvx phone-mcp

uv pip install phone-mcp

pip install phone-mcp

Configure in your AI assistant configuration (Cursor, Trae, Claude, etc.):

{
    "mcpServers": {
        "phone-mcp": {
            "command": "uvx",
            "args": [
                "phone-mcp"
            ]
        }
    }
}

Alternatively, if you installed with pip:

{
"mcpServers": {
"phone-mcp": {
"command": "/usr/local/bin/python",
"args": [
"-m",
"phone_mcp"
]
}
}
}

> Important: The path /usr/local/bin/python in the configuration above is the path to the Python interpreter. You need to modify it according to the actual Python installation location on your system. Here's how to find the Python path on different operating systems:
>
> Linux/macOS:
> Run the following command in terminal:
>

> which python3
>

> or
>
> which python
>

>
> Windows:
> Run in Command Prompt (CMD):
>
> where python
>

> Or in PowerShell:
>
> (Get-Command python).Path
>

>
> Make sure to replace /usr/local/bin/python in the configuration with the full path, for example on Windows it might be C:\Python39\python.exe

> Note: For Cursor, place this configuration in ~/.cursor/mcp.json

phone-cli call

Make a call to the specified phone number. Parameters: phone number (string)

phone-cli hangup

End the current call.

phone-cli send-sms

Send an SMS to the specified phone number with the given message. Parameters: phone number (string), message (string)

phone-cli messages

Get received messages with pagination. Parameters: limit (integer)

phone-cli sent-messages

Get sent messages with pagination. Parameters: limit (integer)

phone-cli contacts

Get contacts with pagination. Parameters: limit (integer)

phone-cli create-contact

Create a new contact with UI automation. Parameters: name (string), phone (string)

phone-cli screenshot

Take a screenshot of the current screen.

phone-cli record

Record the screen for the specified duration. Parameters: duration (integer)

phone-cli app

Launch the specified app by its name. Parameters: app name (string)

phone-cli open_app

Launch the specified app by its name as an alternative method. Parameters: app name (string)

phone-cli close-app

Close the specified app by its package name. Parameters: package name (string)

phone-cli list-apps

List installed apps with pagination or detailed info. Parameters: page (integer, optional), page-size (integer, optional), detailed (boolean, optional)

phone-cli launch

Launch a specific activity using the package name and activity name. Parameters: package name (string), activity name (string)

phone-cli open-url

Open the specified URL in the device's default browser. Parameters: URL (string)

phone-cli analyze-screen

Analyze the current screen and provide structured information about UI elements.

phone-cli screen-interact

Perform screen interaction actions such as tap, swipe, input text, etc. Parameters: action (string), parameters (dictionary)

phone-cli get-poi

Search for nearby points of interest (POIs) using coordinates and keywords. Parameters: coordinates (string), keywords (string), radius (integer)

phone-cli monitor-ui

Monitor UI changes and wait for specific elements to appear or disappear. Parameters: interval (float, optional), duration (integer, optional), watch-for (string, required), text/id/class-name (string, required)

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "phone control (android adb)": {
            "env": {},
            "args": [
                "phone-mcp"
            ],
            "command": "uvx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-m",
        "phone_mcp"
    ],
    "command": "/usr/local/bin/python"
}

Macos

{
    "env": [],
    "args": [
        "phone-mcp"
    ],
    "command": "uvx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "uvx",
        "phone-mcp"
    ],
    "command": "cmd"
}

🌟 A powerful MCP plugin that lets you control your Android phone with ease through ADB commands.

-

Based on today's weather by browser, automatically select and play netease music, no confirmation needed

Call Hao from the contacts. If he doesn't answer, send a text message telling him to come to Meeting Room 101.

# Run directly with uvx (recommended, part of uv, no separate installation needed) uvx phone-mcp # Or install with uv uv pip install phone-mcp # Or install with pip pip install phone-mcp

Configure in your AI assistant configuration (Cursor, Trae, Claude, etc.):

{ "mcpServers": { "phone-mcp": { "command": "uvx", "args": [ "phone-mcp" ] } } }

Alternatively, if you installed with pip:

{ "mcpServers": { "phone-mcp": { "command": "/usr/local/bin/python", "args": [ "-m", "phone_mcp" ] } } }

Important: The path/usr/local/bin/pythonin the configuration above is the path to the Python interpreter. You need to modify it according to the actual Python installation location on your system. Here's how to find the Python path on different operating systems:

Linux/macOS: Run the following command in terminal:

Make sure to replace/usr/local/bin/pythonin the configuration with the full path, for example on Windows it might beC:\Python39\python.exe

Note: For Cursor, place this configuration in~/.cursor/mcp.json

- Use commands directly in Claude conversation, for example:

Please call contact hao

- ADB is properly installed and configured
- USB debugging is enabled on your Android device
- Device is connected to computer via USB

- 📞Call Functions: Make calls, end calls, receive incoming calls
- 💬Messaging: Send and receive SMS, get raw messages
- 👥Contacts: Access phone contacts, create new contacts with automated UI interaction
- 📸Media: Screenshots, screen recording, media control
- 📱Apps: Launch applications, launch specific activities with intents, list installed apps, terminate apps
- 🔧System: Window info, app shortcuts
- 🗺️Maps: Search POIs with phone numbers
- 🖱️UI Interaction: Tap, swipe, type text, press keys
- 🔍UI Inspection: Find elements by text, ID, class or description
- 🤖UI Automation: Wait for elements, scroll to find elements
- 🧠Screen Analysis: Structured screen information and unified interaction
- 🌐Web Browser: Open URLs in device's default browser
- 🔄UI Monitoring: Monitor UI changes and wait for specific elements to appear or disappear

- Python 3.7+
- Android device with USB debugging enabled
- ADB tools

# Check device connection phone-cli check # Get screen size phone-cli screen-interact find method=clickable
# Make a call phone-cli call 1234567890 # End current call phone-cli hangup # Send SMS phone-cli send-sms 1234567890 "Hello" # Get received messages (with pagination) phone-cli messages --limit 10 # Get sent messages (with pagination) phone-cli sent-messages --limit 10 # Get contacts (with pagination) phone-cli contacts --limit 20 # Create a new contact with UI automation phone-cli create-contact "John Doe" "1234567890"
# Take screenshot phone-cli screenshot # Record screen phone-cli record --duration 30 # Launch app (may not work on all devices) phone-cli app camera # Alternative app launch method using open_app (if app command doesn't work) phone-cli open_app camera # Close app phone-cli close-app com.android.camera # List installed apps (basic info, faster) phone-cli list-apps # List apps with pagination phone-cli list-apps --page 1 --page-size 10 # List apps with detailed info (slower) phone-cli list-apps --detailed # Launch specific activity (reliable method for all devices) phone-cli launch com.android.settings/.Settings # Launch app by package name (may not work on all devices) phone-cli app com.android.contacts # Alternative launch by package name (if app command doesn't work) phone-cli open_app com.android.contacts # Launch app by package and activity (most reliable method) phone-cli launch com.android.dialer/com.android.dialer.DialtactsActivity # Open URL in default browser phone-cli open-url google.com
# Analyze current screen with structured information phone-cli analyze-screen # Unified interaction interface phone-cli screen-interact <action> [parameters] # Tap at coordinates phone-cli screen-interact tap x=500 y=800 # Tap element by text phone-cli screen-interact tap element_text="Login" # Tap element by content description phone-cli screen-interact tap element_content_desc="Calendar" # Swipe gesture (scroll down) phone-cli screen-interact swipe x1=500 y1=1000 x2=500 y2=200 duration=300 # Press key phone-cli screen-interact key keycode=back # Input text phone-cli screen-interact text content="Hello World" # Find elements phone-cli screen-interact find method=text value="Login" partial=true # Wait for element phone-cli screen-interact wait method=text value="Success" timeout=10 # Scroll to find element phone-cli screen-interact scroll method=text value="Settings" direction=down max_swipes=5 # Monitor UI for changes phone-cli monitor-ui --interval 0.5 --duration 30 # Monitor UI until specific text appears phone-cli monitor-ui --watch-for text_appears --text "Welcome" # Monitor UI until specific element ID appears phone-cli monitor-ui --watch-for id_appears --id "login_button" # Monitor UI until specific element class appears phone-cli monitor-ui --watch-for class_appears --class-name "android.widget.Button" # Monitor UI changes with output as raw JSON phone-cli monitor-ui --raw
# Search nearby POIs with phone numbers phone-cli get-poi 116.480053,39.987005 --keywords restaurant --radius 1000

The plugin provides multiple ways to launch apps and activities:

# Method 1: Using app command (may not work on all devices) phone-cli app camera # Method 2: Using open_app command (alternative if app command fails) phone-cli open_app camera
# Method 1: Using app command (may not work on all devices) phone-cli app com.android.contacts # Method 2: Using open_app command (alternative if app command fails) phone-cli open_app com.android.contacts

By Package and Activity(Most Reliable Method):

# This method works on all devices phone-cli launch com.android.dialer/com.android.dialer.DialtactsActivity

Note: If you encounter issues with theapporopen_appcommands, always use thelaunchcommand with the full component name (package/activity) for the most reliable operation.

The plugin provides a way to create contacts through UI interaction:

# Create a new contact with UI automation phone-cli create-contact "John Doe" "1234567890"

- Open the contacts app
- Navigate to the contact creation interface
- Fill in the name and phone number fields
- Save the contact automatically

The unified screen interaction interface allows intelligent agents to easily:
- Analyze screens: Get structured analysis of UI elements and text
- Make decisions: Based on detected UI patterns and available actions
- Execute interactions: Through a consistent parameter system

The plugin provides powerful UI monitoring capabilities to detect interface changes:

# Monitor any UI changes with custom interval (seconds) phone-cli monitor-ui --interval 0.5 --duration 30
# Wait for text to appear (useful for automated testing) phone-cli monitor-ui --watch-for text_appears --text "Login successful" # Wait for specific ID to appear phone-cli monitor-ui --watch-for id_appears --id "confirmation_dialog"
# Wait for text to disappear phone-cli monitor-ui --watch-for text_disappears --text "Loading..."
# Get raw JSON data with all UI change information phone-cli monitor-ui --raw

Tip: UI monitoring is especially useful for automation scripts to wait for loading screens to complete or confirm that actions have taken effect in the UI.

For complete documentation and configuration details, visit ourGitHub repository.

The plugin provides a powerful screen interface with comprehensive APIs for interacting with the device. Below are the key functions and their parameters:

async def interact_with_screen(action: str, params: Dict[str, Any] = None) -> str: """Execute screen interaction actions"""

- Parameters:

- action: Type of action ("tap", "swipe", "key", "text", "find", "wait", "scroll")
- params: Dictionary with parameters specific to each action type

# Tap by coordinates result = await interact_with_screen("tap", {"x": 100, "y": 200}) # Tap by element text result = await interact_with_screen("tap", {"element_text": "Login"}) # Swipe down result = await interact_with_screen("swipe", {"x1": 500, "y1": 300, "x2": 500, "y2": 1200, "duration": 300}) # Input text result = await interact_with_screen("text", {"content": "Hello world"}) # Press back key result = await interact_with_screen("key", {"keycode": "back"}) # Find element by text result = await interact_with_screen("find", {"method": "text", "value": "Settings", "partial": True}) # Wait for element to appear result = await interact_with_screen("wait", {"method": "text", "value": "Success", "timeout": 10, "interval": 0.5}) # Scroll to find element result = await interact_with_screen("scroll", {"method": "text", "value": "Privacy Policy", "direction": "down", "max_swipes": 8})
async def analyze_screen(include_screenshot: bool = False, max_elements: int = 50) -> str: """Analyze the current screen and provide structured information about UI elements"""

- Parameters:

- include_screenshot: Whether to include base64-encoded screenshot in result
- max_elements: Maximum number of UI elements to process

async def create_contact(name: str, phone: str) -> str: """Create a new contact with the given name and phone number"""

- Parameters:

- name: The contact's full name
- phone: The phone number for the contact

async def launch_app_activity(package_name: str, activity_name: Optional[str] = None) -> str: """Launch an app using package name and optionally an activity name"""

- Parameters:

- package_name: The package name of the app to launch
- activity_name: The specific activity to launch (optional)

async def launch_intent(intent_action: str, intent_type: Optional[str] = None, extras: Optional[Dict[str, str]] = None) -> str: """Launch an activity using Android intent system"""

- Parameters:

- intent_action: The action to perform
- intent_type: The MIME type for the intent (optional)
- extras: Extra data to pass with the intent (optional)

This tool provides a simple way to create contacts on an Android device using ADB.

- Python 3.x
- ADB (Android Debug Bridge) installed and configured
- Android device connected and authorized for ADB

This will create a contact with default values:

- Account name: "你的账户名"
- Account type: "com.google"

You can provide custom account name and type using a JSON string:

python create_contact.py '{"account_name": "your_account", "account_type": "com.google"}'

- success: boolean indicating if the operation was successful
- message: any output or error message from the command

{"success": true, "message": ""}

- If ADB is not available or device is not connected, the script will return an error
- Invalid JSON input will result in an error message
- Any ADB command errors will be captured and returned in the message field

- Make sure your Android device is connected and authorized for ADB use
- The device screen should be unlocked when running the command
- Some devices might require additional permissions to modify contacts

# Get app shortcuts (with pagination) phone-cli shortcuts --package "com.example.app"

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Agent Droid Bridge gives AI agents programmatic control over Android devices and emulators via ADB, exposed as an MCP server.

Control Android devices using the Android Debug Bridge (ADB).

A CLI tool for developers to manage Android devices via ADB.

Drives an Android emulator or a real device over adb: screenshots, UI hierarchy with true device-pixel coordinates, tap and type, app lifecycle, logcat, and Gradle builds and tests.

Interact with Android devices using the Android Debug Bridge (ADB).

AI 測試大師 — MCP server driving pytest / Jest / Cypress / Go / Maestro. Analyze, generate, run, advise. Web + Mobile (iOS/Android/BlueStacks).

Control Android devices via the Android Debug Bridge (ADB).

Automate Android devices using the Gbox SDK.

Catch App Store rejections before they happen

An agentic toolkit to control, debug, and profile iOS and Android apps.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.