MCP Connector

Control Android Phone via ADB

Phone MCP Plugin controls an Android phone via ADB: calls, SMS, contacts, apps, screenshots, and UI automation.

Works with adb

91
Spark score
out of 100
Updated May 2025
Version 0.3.6
Models
universal

Add to Favorites

Why it matters

Empower AI agents to control Android devices through ADB commands, enabling complex automated tasks like making calls, sending messages, and managing applications.

Outcomes

What it gets done

01

Automate phone calls and SMS messaging.

02

Manage applications and launch specific activities.

03

Perform UI interactions and inspect screen elements.

04

Create contacts and manage media.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-phone-mcp | bash

Capabilities

Tools your agent gets

interact_with_screen

Perform screen interaction actions such as tapping, swiping, pressing keys, typing text, finding elements, waiting

analyze_screen

Analyze the current screen and provide structured information about UI elements

create_contact

Create a new contact with automated UI interaction

launch_app_activity

Launch an application by package name and optionally by activity name

launch_intent

Launch an activity through the Android intent system

Overview

Phone MCP Server

Phone MCP Plugin gives an AI assistant ADB-based control of an Android phone: calls, SMS, contacts, apps, screenshots, and structured UI tap/swipe/find automation. Use it when an AI assistant needs to control a real, connected Android device directly, provided ADB and USB debugging are already set up.

What it does

Phone MCP Plugin is an MCP server that lets an AI assistant control an Android phone through ADB commands. It covers phone calls and SMS, contacts, media and app control, screenshots and screen recording, and a structured UI-interaction and monitoring layer for tapping, swiping, typing, and finding elements on screen, letting an assistant complete multi-step phone tasks like selecting music based on the weather, or calling a contact and texting them if they don't answer.

When to use - and when NOT to

Use it when you want an AI assistant to place or answer calls, send and read SMS, manage contacts, launch or close apps, take screenshots or record the screen, search nearby points of interest, or drive the phone's UI directly by tapping, swiping, and reading screen elements. It requires ADB properly installed and configured, USB debugging enabled on the Android device, and the device connected to the computer over USB; without that connection none of the tools function. It is Android-specific and controls a real connected device, so it's a fit for on-device automation and testing, not a remote or simulated phone environment.

Capabilities

Call functions cover making calls, ending calls, and receiving incoming calls. Messaging covers sending and receiving SMS and retrieving raw messages. Contacts tools access phone contacts and create new ones through automated UI interaction. Media tools cover screenshots, screen recording, and media control. App tools launch applications, launch specific activities via intents, list installed apps, and terminate apps, with the most reliable launch method combining a package name and activity name. Maps tools search nearby points of interest with phone numbers. The screen interface API centers on interact_with_screen, which performs tap, swipe, key, text, find, wait, and scroll actions with action-specific parameters, and analyze_screen, which returns structured information about on-screen UI elements with an optional base64 screenshot. UI monitoring watches for elements appearing, disappearing, or any change over a configurable interval, useful for waiting out loading screens in automation scripts. create_contact and launch_app_activity implement contact creation and app launching respectively as async functions returning JSON results. A companion command-line tool, create_contact.py, creates a contact via ADB directly, accepting a JSON string for a custom account name and type and returning a success or error JSON object.

How to install

Run directly with uvx, no separate installation needed:

uvx phone-mcp

Or install with uv (uv pip install phone-mcp) or pip (pip install phone-mcp). Configure it in your AI assistant's MCP settings:

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

For Cursor, this goes in ~/.cursor/mcp.json. If installed via pip instead, point command at your Python interpreter's path and run it as the phone_mcp module. Before use, confirm ADB is installed, USB debugging is enabled on the Android device, and the device is connected via USB.

Who it's for

Developers and testers who want an AI assistant to control a real, connected Android device directly, calls, messaging, apps, and on-screen UI automation, provided ADB and USB debugging are set up first. It is released under the Apache License, Version 2.0.

Source README

πŸ“± Phone MCP Plugin

Downloads

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

Example

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

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

δΈ­ζ–‡ζ–‡ζ‘£

⚑ Quick Start

πŸ“₯ Installation

# 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

πŸ”§ Configuration

AI Assistant Configuration

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

Usage:

  • Use commands directly in Claude conversation, for example:
    Please call contact hao
    

⚠️ Before using, ensure:

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

🎯 Key Features

  • πŸ“ž 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

πŸ› οΈ Requirements

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

πŸ“‹ Basic Commands

Device & Connection

# Check device connection
phone-cli check

# Get screen size
phone-cli screen-interact find method=clickable

Communication

# 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"

Media & Apps

# 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

Screen Analysis & Interaction

# 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

Location & Maps

# Search nearby POIs with phone numbers
phone-cli get-poi 116.480053,39.987005 --keywords restaurant --radius 1000

πŸ“š Advanced Usage

App and Activity Launch

The plugin provides multiple ways to launch apps and activities:

  1. By App Name (Two Methods):

    # 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
    
  2. By Package Name (Two Methods):

    # 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
    
  3. 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 the app or open_app commands, always use the launch command with the full component name (package/activity) for the most reliable operation.

Create a new contact with UI automation

phone-cli create-contact "John Doe" "1234567890"


This command will:
1. Open the contacts app
2. Navigate to the contact creation interface
3. Fill in the name and phone number fields
4. Save the contact automatically

### Screen-Based Automation

The unified screen interaction interface allows intelligent agents to easily:

1. **Analyze screens**: Get structured analysis of UI elements and text
2. **Make decisions**: Based on detected UI patterns and available actions
3. **Execute interactions**: Through a consistent parameter system

### UI Monitoring and Automation

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

1. **Basic UI monitoring**:
   ```bash
   # Monitor any UI changes with custom interval (seconds)
   phone-cli monitor-ui --interval 0.5 --duration 30
  1. Wait for specific elements to appear:

    # 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"
    
  2. Monitor elements disappearing:

    # Wait for text to disappear
    phone-cli monitor-ui --watch-for text_disappears --text "Loading..."
    
  3. Get detailed UI change reports:

    # 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.

πŸ“š Detailed Documentation

For complete documentation and configuration details, visit our GitHub repository.

🧰 Tool Documentation

Screen Interface API

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

interact_with_screen

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
  • Returns: JSON string with operation results

Examples:

## 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})

analyze_screen

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
  • Returns: JSON string with detailed screen analysis

create_contact

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
  • Returns: JSON string with operation result
  • Location: This function is found in the 'contacts.py' module and implements UI automation to create contacts

launch_app_activity

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)
  • Returns: JSON string with operation result
  • Location: This function is found in the 'apps.py' module

launch_intent

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)
  • Returns: JSON string with operation result
  • Location: This function is found in the 'apps.py' module

πŸ“„ License

Apache License, Version 2.0

Get app shortcuts (with pagination)

phone-cli shortcuts --package "com.example.app"
```

FAQ

Common questions

Discussion

Questions & comments Β· 0

Sign In Sign in to leave a comment.