Skip to main content

mcp-name: io.github.pedro-rivas/android-puppeteer-mcp

Android Puppeteer

License Python Platform MCP Server

Android Puppeteer is a lightweight, visual-first MCP (Model Context Protocol) server that enables AI agents to interact with Android devices through intelligent UI element detection and automated interactions. Built on uiautomator2, it provides comprehensive Android automation capabilities including visual element detection, touch interactions, text input, and video recording.

🎥 Watch the demo in action

Features

  • Visual Element Detection Automatically detects and annotates interactive UI elements with numbered overlays for precise targeting.

  • Comprehensive Touch Interactions Support for tap, long press, swipe, scroll, and drag gestures with coordinate-based precision.

  • Multi-Device Support Connect to multiple Android devices or emulators simultaneously with device-specific targeting.

  • Video Recording Integration Built-in screen recording capabilities using scrcpy for documentation and testing workflows.

  • Real-Time UI Analysis Live UI hierarchy parsing and element information extraction for dynamic interaction strategies.

  • MCP Protocol Integration Seamless integration with Claude Desktop and other MCP-compatible AI platforms.

Supported Operating Systems

  • Android 10+
  • Windows, macOS, Linux (host systems)

Installation

Prerequisites

  • Python 3.10+
  • uiautomator2
  • Android 10+ (Emulator or Physical Device)
  • ADB (Android Debug Bridge)
  • scrcpy (for video recording features)

Getting Started

  1. Clone the repository
git clone https://github.com/pedro-rivas/android-puppeteer-mcp.git
cd android-puppeteer
  1. Install dependencies
uv python install 3.10
uv sync
  1. Setup Android device
# Enable USB debugging on your Android device
# For emulator, ensure it's running
adb devices  # Verify device connection
  1. Connect to the MCP server

  2. Locate your Claude Desktop configuration file:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  3. Add the following JSON to your Claude Desktop config:

    {
      "mcpServers": {
        "android-puppeteer": {
          "command": "path/to/uv",
          "args": [
            "--directory",
            "path/to/android-puppeteer",
            "run",
            "puppeteer.py"
          ]
        }
      }
    }
    

    Replace:

    • path/to/uv with the actual path to your uv executable
    • path/to/android-puppeteer with the absolute path to where you have cloned this repo
  4. Restart Claude Desktop

Restart your Claude Desktop. You should see "android-puppeteer" listed as an available integration.


Available Tools

Android Puppeteer provides the following tools for comprehensive Android device interaction:

Device Management

  • list_emulators: List all available Android emulators and devices with their status and dimensions
  • get_device_dimensions: Get the screen dimensions of a specific Android device
  • get_ui_elements_info: Get detailed information about all interactive UI elements on screen

Visual Interaction

  • take_screenshot: Capture annotated screenshots with numbered UI element overlays
  • press: Tap on specific coordinates with optional long press duration
  • long_press: Perform long press gestures on specific coordinates

Navigation & Input

  • press_back: Press the hardware back button
  • swipe: Perform directional or custom coordinate swipes
  • type_text: Type text into focused input fields with optional text clearing
  • scroll_element: Scroll specific UI elements in any direction

Recording & Documentation

  • record_video: Start screen recording with customizable quality settings
  • stop_video: Stop active screen recordings and save to local storage

Usage Examples

Basic Device Interaction

# Take an annotated screenshot
screenshot = await take_screenshot()

# Tap on a specific element (element 5 from screenshot)
await press(x=500, y=300)

# Type text into an input field
await type_text("Hello, Android!")

# Swipe to scroll down
await swipe(direction="down")

Multi-Device Automation

# List available devices
devices = await list_emulators()

# Target specific device
await take_screenshot(device_id="emulator-5554")
await press(x=200, y=400, device_id="emulator-5554")

Video Recording Workflow

# Start recording
await record_video(filename="test_session.mp4")

# Perform automation steps
await press(x=300, y=500)
await type_text("Automated test input")

# Stop recording
await stop_video()

Project Structure

android-puppeteer/
    puppeteer.py          # Main MCP server implementation
    main.py              # Entry point
    pyproject.toml       # Project configuration
    ss/                  # Screenshots directory
    videos/              # Video recordings directory
    README.md           # This file

Important Notes

  • Device Permissions: Ensure USB debugging is enabled on target Android devices
  • Network Access: Some features require network connectivity for device communication
  • Storage: Screenshot and video files are saved locally in ss/ and videos/ directories
  • Performance: Response times depend on device performance and network latency

Troubleshooting

Common Issues

  1. Device not found: Verify ADB connection with adb devices
  2. Permission denied: Check USB debugging and device authorization
  3. Screenshot failures: Ensure device screen is unlocked and accessible
  4. Video recording issues: Verify scrcpy installation and device compatibility

Debug Mode

Run the server directly for debugging:

uv run puppeteer.py

License

This project is licensed under the MIT License. See LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and ensure code quality
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Star this repo if you find it useful!

Metadata

Release files for android-puppeteer-mcp 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for android-puppeteer-mcp 1.0.1
File Size Uploaded Provenance
android_puppeteer_mcp-1.0.1.tar.gz 70.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for android-puppeteer-mcp 1.0.1
File Interpreter ABI Platform
android_puppeteer_mcp-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 150.0 kB

Release files / android_puppeteer_mcp-1.0.1.tar.gz

Download URL android_puppeteer_mcp-1.0.1.tar.gz
Size 70.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2f4813d843c2f6bad66e4a40c14f842f2f2e3783b9be6930d4fc030688503fb3
BLAKE2b-256 checksum
How to use checksums
b4e56fb9d8480dbf085c28b1828cac7c1ba749d9f19b48f794d35c489f690c5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.14

Release files / android_puppeteer_mcp-1.0.1-py3-none-any.whl

Download URL android_puppeteer_mcp-1.0.1-py3-none-any.whl
Size 79.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ce60b51e688571dad9d9a69687d19c9c0c34730312f6bd99f384d3f75db03b5
BLAKE2b-256 checksum
How to use checksums
9b06819c5937966382a7d24d551c55c960c805cbc4fc1d3b67091dbc78d19db8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.14

Security for android-puppeteer-mcp 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page