Uiautomator2 Mcp Server
A MCP (Model Context Protocol) server that provides tools for controlling and interacting with Android devices using uiautomator2.
- Transport
- Not stated
- Package
- —
- Registry id
- —
No install snippet on purpose. A working MCP config is a command, its arguments and an environment block — the last two are where API keys live, so this catalogue never stores them and cannot publish them. Follow the link above for the authors' own instructions.
- 🇨🇳 中文说明
Code of Conduct: Please follow our Code of Conduct when participating in this project.
An MCP server that provides tools for controlling Android devices using uiautomator2.
Use AI to automate your Android device: take screenshots, tap/swipe, manage apps, send text, and more.
📺 Demo
Conversational Android Automation
User says: "Search cat videos on xxx App then play the video and swap to the next video"
AI automatically:

- ✅ Launch app → Tap search → Enter keywords → Execute search → Tap result -> Swap to next video
Control Android devices with natural language, no coding required
Detailed example: .skills/douyin-search
✨ Features
- 📱 Multi-Device - One server, many phones
- 🔍 XPath Filtering - Dump only the UI elements you need — save tokens and speed up responses
- 🎛️ Tool Filtering - Show the AI only the tools it needs — fewer hallucinations, better results
- ⚡ Zero Setup - Run with
uvximmediately, no installation needed - 📦 Standalone Executable - Bundle into a standalone app with PyInstaller or Nuitka — no Python runtime required
- 🧰 70+ Tools - Click, swipe, type, apps, screenshots — everything you need
- 🧪 Built-in Testing - Includes AI-driven UI test framework out of the box
- 🔄 Two Modes - STDIO for local, HTTP for remote
- ⚙️ Config Files - TOML/YAML/JSON config with auto-discovery
- 🔒 Clean Code - Type hints, linted, formatted — easy to extend
🎯 Use Cases
| Scenario | Description |
|---|---|
| 🧪 Automated Testing | Run natural language UI tests with AI-driven test framework |
| ⚡ Rapid Prototyping | Quickly test Android app interactions without writing code |
| ♿ Accessibility Testing | Verify app accessibility features automatically |
| 📊 Health Monitoring | Periodic device health and status checks |
| 🤖 Task Automation | Automate repetitive tasks like form filling, navigation |
| 🔬 Remote Debugging | Inspect UI hierarchy and capture screenshots remotely |
🏗️ Architecture
graph TD
AI[AI Assistant<br/>Claude/GPT/etc.] --> MCP[MCP Protocol]
MCP --> Server[u2mcp Server]
Server --> uiautomator2[uiautomator2]
uiautomator2 --> ADB[ADB]
ADB --> Device[Android Device<br/>Physical/Emulator]
style AI fill:#e1f5ff
style MCP fill:#fff4e6
style Server fill:#f3e5f5
style uiautomator2 fill:#e8f5e9
style ADB fill:#fff3e0
style Device fill:#fce4ec
Migration from v0.1.x
If you're upgrading from v0.1.3 or earlier: The CLI now requires an explicit subcommand. Change your command from:
# Old (v0.1.3 and earlier)
u2mcp
to:
# New (v0.2.0+)
u2mcp stdio
All other commands remain the same (just add the transport subcommand).
Prerequisites
- [Python][] 3.11+
adbin your PATH (install via Android SDK Platform Tools)- Android device with USB debugging enabled
From the project's README.