Android Puppeteer
Android Puppeteer is a visual-first MCP server that enables AI agents to automate interactions with Android devices through intelligent UI detection and comprehensive control tools.
Device Management: List connected Android devices/emulators with their status and dimensions
Visual Element Detection: Capture annotated screenshots with numbered UI element overlays and extract detailed element information and live UI hierarchy
Touch Interactions: Perform taps, long presses, and precise coordinate-based interactions
Navigation & Input: Press hardware back button, execute directional or custom coordinate swipes, and type text into input fields with optional clearing
Element Control: Scroll specific UI elements in any direction with customizable distance and duration
Screen Recording: Start and stop video recordings with customizable quality settings using scrcpy
Multi-Device Support: Target specific devices/emulators simultaneously for parallel automation using device IDs
Enables AI agents to interact with Android devices through visual UI element detection, touch interactions, text input, navigation gestures, and screen recording capabilities using uiautomator2 automation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Android Puppeteer take a screenshot of the home screen and show me the interactive elements"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-name: io.github.pedro-rivas/android-puppeteer-mcp
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.
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)
Related MCP server: MCP Android Agent
Installation
Prerequisites
Python 3.10+
uiautomator2
Android 10+ (Emulator or Physical Device)
ADB (Android Debug Bridge)
scrcpy (for video recording features)
Getting Started
Clone the repository
git clone https://github.com/pedro-rivas/android-puppeteer-mcp.git
cd android-puppeteerInstall dependencies
uv python install 3.10
uv syncSetup Android device
# Enable USB debugging on your Android device
# For emulator, ensure it's running
adb devices # Verify device connectionConnect to the MCP server
Locate your Claude Desktop configuration file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
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/uvwith the actual path to your uv executablepath/to/android-puppeteerwith the absolute path to where you have cloned this repo
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 dimensionsget_device_dimensions: Get the screen dimensions of a specific Android deviceget_ui_elements_info: Get detailed information about all interactive UI elements on screen
Visual Interaction
take_screenshot: Capture annotated screenshots with numbered UI element overlayspress: Tap on specific coordinates with optional long press durationlong_press: Perform long press gestures on specific coordinates
Navigation & Input
press_back: Press the hardware back buttonswipe: Perform directional or custom coordinate swipestype_text: Type text into focused input fields with optional text clearingscroll_element: Scroll specific UI elements in any direction
Recording & Documentation
record_video: Start screen recording with customizable quality settingsstop_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 fileImportant 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/andvideos/directoriesPerformance: Response times depend on device performance and network latency
Troubleshooting
Common Issues
Device not found: Verify ADB connection with
adb devicesPermission denied: Check USB debugging and device authorization
Screenshot failures: Ensure device screen is unlocked and accessible
Video recording issues: Verify scrcpy installation and device compatibility
Debug Mode
Run the server directly for debugging:
uv run puppeteer.pyLicense
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
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes
Run tests and ensure code quality
Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Related Projects
Android MCP - Alternative Android automation MCP server
uiautomator2 - Core Android automation library
MCP Protocol - Model Context Protocol specification
Star this repo if you find it useful!
Available Tools
12 toolsget_device_dimensionsC
Get the dimensions of the Android device/emulator screen.
Inputs: device_id.
get_ui_elements_infoC
Get detailed information about all interactive UI elements on the screen including their coordinates and properties.
Inputs: device_id.
list_emulatorsA
List all available Android emulators and devices with their name, ID, status, and dimensions
Inputs: no named parameters.
long_pressC
Long press on specific coordinates on the Android screen.
Inputs: x (required), y (required), device_id.
pressB
Tap on specific coordinates on the Android screen. Use duration for long press (in milliseconds).
Inputs: x (required), y (required), device_id, duration.
press_backA
Press the hardware back button on the Android device/emulator.
Inputs: device_id.
record_videoC
Start recording a video using scrcpy. The video will be saved to the videos directory.
Inputs: bitrate, device_id, filename, resolution.
scroll_elementA
Scroll a specific UI element in the given direction for a specified distance.
Args:
element: Either an integer (element index from annotated screenshot) or string (element name)
direction: Direction to scroll - 'up', 'down', 'left', 'right'
distance: Distance to scroll in pixels (default: 200)
duration: Duration of scroll gesture in milliseconds (default: 300)
device_id: Optional device ID to target specific device/emulator
Inputs: direction (required), element (required), device_id, distance, +1 more.
stop_videoC
Stop the active video recording for the specified device.
Inputs: device_id.
swipeB
Swipe horizontally or vertically on the Android screen.
Args:
direction: 'left', 'right', 'up', 'down' for directional swipes
x1, y1, x2, y2: Exact coordinates for custom swipes
device_id: Optional device ID to target specific device/emulator
distance: Distance of swipe in pixels (default: 50% of screen dimension)
duration: Duration of swipe in milliseconds (default: 300ms)
Inputs: device_id, direction, distance, duration, +4 more.
take_screenshotB
Take a screenshot for the specified device/emulator. If no device_id is provided, uses the default device. Set annotate_elements=False to take a plain screenshot without UI element annotations.
Inputs: annotate_elements, device_id, name.
type_textA
Type text into the currently focused input field on the Android device/emulator.
Args:
text: The text to type into the input field
device_id: Optional device ID to target specific device/emulator
clear_first: If True, clears existing text before typing new text
Inputs: text (required), clear_first, device_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have distinct purposes for Android device interaction, but 'press' and 'long_press' overlap in functionality as both handle screen touches with duration parameters, which could cause confusion. Other tools like 'get_device_dimensions' and 'get_ui_elements_info' are clearly differentiated.
All tool names follow a consistent snake_case pattern with clear verb_noun structure (e.g., 'take_screenshot', 'type_text', 'scroll_element'). The naming is predictable and readable throughout the set.
With 12 tools, this server is well-scoped for Android automation, covering essential actions like input, navigation, and media capture. Each tool serves a specific role without bloat, fitting typical automation needs.
The toolset covers core Android interaction workflows including input, navigation, and media, but lacks tools for advanced tasks like app management (e.g., install/uninstall) or system settings. Minor gaps exist, but agents can perform basic automation effectively.
Maintenance
Related MCP Connectors
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Let AI agents control Android and iOS devices on Mobilerun Cloud: screen, input, apps, workflows.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to interact with Android devices through UI manipulation, screen capture, touch gestures, text input, and app management via ADB. Provides comprehensive mobile automation capabilities including element detection, navigation, and application control for Android device testing and interaction.933 PyPI2-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control Android devices through natural language, supporting app management, UI interaction, gestures, and system operations via uiautomator2.MIT
- AlicenseNot gradedqualityDmaintenanceEnables coding agents to observe and operate Android devices through ADB and uiautomator2, supporting screenshot capture, UI hierarchy access, and actions like tap, swipe, and text input.2Apache 2.0
- AlicenseAqualityCmaintenanceEnables AI agents to control, inspect, and automate Android devices, Waydroid containers, and AVD emulators over ADB. Provides tools for screenshots, UI-hierarchy text-based tapping, gestures, key presses, text input, app management, and raw shell commands.12MIT