Potencia tu agente
Instalación del publicador. No es un endpoint de PlugMCP.
Host a copy with our keys and logs.
Aún no hay una versión empaquetada en el registro. Sigue el README del repositorio.
¿URL remota o un comando en tu máquina? En qué se diferencian las dos instalaciones
Ejecutar en PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
Abrir
- 🇨🇳 中文说明
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.
User says: "Search cat videos on xxx App then play the video and swap to the next video"
AI automatically:

Control Android devices with natural language, no coding required
Detailed example: skills/douyin-search
uvx immediately, no installation neededgraph 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
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).
adb in your PATH (install via Android SDK Platform Tools)💡 Tool Selection Recommendation:
- MCP Client Usage (Claude Desktop, Cursor, etc.): uv is recommended for direct package execution with
uvx- Standalone/Debugging: You can use uv, pip, or pipx
For most use cases, installing uv is sufficient.
The following are two optional enhanced package managers. You can choose to install one of them, or skip this step if you prefer.
Installing uv (Recommended | Optional)
Most MCP clients (like Claude Desktop) use uvx to run Python MCP servers. uvx is part of the uv toolkit.
Why choose
uvx?uvxcan run Python packages directly from PyPI without manual installation - just useuvx package-nameand it handles the rest. This makes it perfect for MCP client configurations.
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows (PowerShell):
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
Or use winget:
winget install --id=astral-sh.uv -e
Verify installation:
uv --version
uvx --version
Installing pipx (Optional)
pipx is another tool for installing and running Python CLI applications in isolated environments.
pipxvsuvx: Likeuvx,pipxcan also run packages directly withpipx run package-name. However,uvxis generally faster and is more commonly used in the MCP ecosystem.
macOS / Linux:
python3 -m pip install --user pipx
python3 -m pipx ensurepath
Windows:
python -m pip install --user pipx
python -m pipx ensurepath
Install pre‑compiled binary (recommended):
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/tanbro/uiautomator2-mcp-server/main/scripts/install.sh | bash
Windows
irm https://raw.githubusercontent.com/tanbro/uiautomator2-mcp-server/main/scripts/install.ps1 | iex
After installation, the short alias u2mcp is available:
u2mcp --version
Supported platforms for the pre-compiled binaries:
Release assets are named with a Rust-style target triple, so a new ABI is a new triple rather than a new naming scheme. The Linux floor is the build image's, not a number we maintain here: the image above is a manylinux profile whose name states the glibc it targets. musl systems (Alpine and friends), distributions older than that profile (CentOS 7, Debian 9) and Intel Macs have no pre-compiled binary and must install from PyPI below.
Run directly without installation
Using uvx (recommended) or pipx run from PyPI:
# Run directly with uvx (recommended)
uvx uiautomator2-mcp-server stdio
# Or run directly with pipx
pipx run uiautomator2-mcp-server stdio
If you need global installation for long-term use, you can also choose to install:
# Install using uv (tool method)
uv tool install uiautomator2-mcp-server
# Or install with pipx
pipx install uiautomator2-mcp-server
# Or install with pip
python -m pip install uiautomator2-mcp-server
After installation, the short alias u2mcp is available:
u2mcp --version
If you don't want to use uv, pipx or other third-party package managers, you can directly use Python's default package manager pip to install this software:
python -m pip install uiautomator2-mcp-server
Note on Package Name:
While the CLI command isu2mcp, the PyPI package name isuiautomator2-mcp-server. We plan to simplify this tou2mcpin v1.0.0. For now, please install using the full package name above.
ℹ️ Note:
pip does not support running without installation
You can bundle the server into a standalone application — no Python installation required on the target machine.
Fast build, no C compiler required.
# 1. Install PyInstaller
uv sync --group pyinstaller
# 2. Build
pyinstaller u2mcp.spec
This produces a dist/u2mcp/ directory containing the executable and all runtime files. Distribute the entire folder as a portable application.
Compiles Python to C, producing native .so/.pyd/.dll binaries — provides a basic level of source code protection. Requires a C/C++ compiler (MSVC on Windows, GCC/Clang on Linux/macOS).
Build options are pre-configured in main.py via Nuitka project directives:
# 1. Install Nuitka
uv sync --group nuitka
# 2. Build
nuitka main.py
Regardless of which tool you used:
# STDIO mode (for local MCP clients)
u2mcp stdio
# HTTP mode (for remote access)
u2mcp http -H 0.0.0.0 -p 8000
Note: The output bundles the Python runtime and all Python dependencies, so the target machine does not need Python, pip, or uv installed. However,
adbmust still be available on the system PATH (or set via theADBUTILS_ADB_PATHenvironment variable).
Note: The commands below use
u2mcp, which requires the package to be installed. If you haven't installed it yet, you can run directly usinguvx uiautomator2-mcp-server ...instead.
The MCP server can run in two modes:
# If installed
u2mcp stdio
# Or run directly without installation
uvx uiautomator2-mcp-server stdio
This mode communicates via standard input/output and is typically used by MCP clients that spawn the server process directly.
# If installed
u2mcp http -H 0.0.0.0 -p 8000 --no-auth
# Or run directly without installation
uvx uiautomator2-mcp-server http -H 0.0.0.0 -p 8000 --no-auth
# With authentication token (if installed)
u2mcp http -H 0.0.0.0 -p 8000 -t YOUR_SECRET_TOKEN
# Or run directly without installation
uvx uiautomator2-mcp-server http -H 0.0.0.0 -p 8000 -t YOUR_SECRET_TOKEN
The server will listen on http://localhost:8000/mcp (or your specified host/port).
You can configure u2mcp using config files instead of (or in addition to) CLI flags. Supported formats: TOML, YAML, and JSON.
The server automatically discovers config files in platform-specific directories:
In each directory, the server looks for the first matching file: u2mcp.toml, u2mcp.yaml, u2mcp.yml, u2mcp.json (at most one file per directory).
Priority order: CLI args > Environment variables > Config file (cwd > user > system) > Defaults.
# Via CLI option
u2mcp stdio --config-file my-config.toml
# Via environment variable
U2MCP_CONFIG_FILE=my-config.toml u2mcp stdio
Config files use command names as top-level keys:
# u2mcp.toml
[stdio]
log-level = "debug"
check-adb = false
include-tags = ["device:info", "action:touch"]
exclude-tools = ["shell_command"]
[http]
host = "0.0.0.0"
port = 8000
auth = true
json-response = true
# u2mcp.yaml
stdio:
log-level: debug
check-adb: false
http:
host: "0.0.0.0"
port: 8000
auth: false
{
"stdio": {
"log-level": "warning",
"print-tags": false
}
}
CLI parameters can be set via environment variables with the U2MCP_{COMMAND}_{PARAM} format:
U2MCP_STDIO_LOG_LEVEL=debug u2mcp stdio
U2MCP_HTTP_HOST=0.0.0.0 U2MCP_HTTP_PORT=9000 u2mcp http
U2MCP_HTTP_AUTH=false u2mcp http
See the examples/ directory for ready-to-use config files:
Note: The commands below use
u2mcp, which requires the package to be installed. If you haven't installed it yet, you can run directly usinguvx uiautomator2-mcp-server ...instead.
The u2mcp CLI provides several utility commands for exploring available tools and tags:
# List all available tools
u2mcp tools
# Or run directly
uvx uiautomator2-mcp-server tools
# Show detailed information about a specific tool
u2mcp info screenshot
# Show tools matching a pattern (supports wildcards)
u2mcp info "device:*" # All device tools
u2mcp info "*screenshot*" # Tools with 'screenshot' in name
# List all available tool tags
u2mcp tags
# Show version information
u2mcp --version
Note: The commands below use
u2mcp, which requires the package to be installed. Replace withuvx uiautomator2-mcp-server ...if running directly.
You can selectively expose tools using tag-based filtering. This reduces the number of tools available to the LLM, which can improve performance and reduce confusion.
# Only expose device management tools
u2mcp stdio -i device:manage
# Or run directly
uvx uiautomator2-mcp-server stdio -i device:manage
# Only expose touch and gesture operations
u2mcp stdio -i action:touch -i action:gesture
# Exclude screen mirroring tools
u2mcp stdio -e screen:mirror
# Only expose app lifecycle and element interaction tools
u2mcp stdio -i app:lifecycle -i xpath:interact
# Exclude shell command tools (for security)
u2mcp stdio -e device:shell
# Only expose input-related tools
u2mcp stdio -i input:text
# Combine include and exclude
u2mcp stdio -i device:info -i action:touch -e screen:capture
# Bare category tags expose a whole category
u2mcp stdio -i device
# Filter by tool name instead of tags
u2mcp stdio --include-tools click --include-tools screenshot
# List all available tags
u2mcp tags
Before you start: Make sure you have configured an MCP client (like Claude Desktop) to use this server. See MCP Client Configuration below for details.
Connect your Android device via USB with USB debugging enabled
Configure your MCP client to use this server (see MCP Client Configuration)
Initialize the device (required first time):
"Initialize my Android device"
Start automating:
"Take a screenshot" "Tap at coordinates 500, 1000" "Swipe up" "Open YouTube app"
Short Options:
All common options support short flags for convenience:
-l / --log-level - Set log level-i / --include-tags - Include tools by tags-e / --exclude-tags - Exclude tools by tags-H / --host - Set host address (HTTP mode)-p / --port - Set port number (HTTP mode)-t / --token - Set authentication token (HTTP mode)-n / --no-auth - Disable authentication (HTTP mode)Filtering Options:
--include-tags/--exclude-tags and --include-tools/--exclude-tools take values as repeatable flags or lists in the config file:
# Allowlist: only expose touch actions and the screenshot tool
u2mcp stdio --include-tags action:touch --include-tools screenshot
# Denylist: expose everything except shell and mirroring
u2mcp stdio --exclude-tags device:shell --exclude-tags screen:mirror
Include filters act as an allowlist (only matching tools are exposed); exclude filters remove from that set afterwards and take precedence. Within a direction, tag and tool filters combine as a union.
Each tool carries two tags: a bare category (e.g. device) and a subcategory (e.g. device:capture). Selecting a bare tag exposes the whole category.
Available Tags:
MCP Inspector is a command-line tool for testing and debugging MCP servers without requiring an AI client.
# Install MCP Inspector
npm install -g @modelcontextprotocol/inspector
# Inspect the server in STDIO mode
npx @modelcontextprotocol/inspector u2mcp stdio
# Or inspect the server in HTTP mode
# First start the server: u2mcp http --host 0.0.0.0 --port 8000
# Then run inspector with the URL
npx @modelcontextprotocol/inspector http://localhost:8000/mcp
The inspector will display:
Postman has native MCP support for testing and debugging MCP servers.
STDIO Mode:
Command: u2mcp
Arguments: stdio
HTTP Mode:
URL: http://localhost:8000/mcp
(First start the server: u2mcp http --host 0.0.0.0 --port 8000)
For more information, see the Postman MCP documentation.
You can also test the HTTP endpoint using cURL with JSON-RPC 2.0 requests:
# 1. Start the server first
u2mcp http --host 0.0.0.0 --port 8000
# 2. In another terminal, send MCP requests
curl -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
# Call a tool (e.g., list devices)
curl -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "device_list",
"arguments": {}
}
}'
This MCP server can be used with any MCP-compatible client. Below are configuration instructions for popular clients.
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"android": {
"command": "uvx",
"args": ["uiautomator2-mcp-server", "stdio"]
}
}
}
If you installed the package globally, you can also use:
{
"mcpServers": {
"android": {
"command": "u2mcp",
"args": ["stdio"]
}
}
}
Cursor is an AI-powered code editor with native MCP support.
{
"mcpServers": {
"android": {
"command": "u2mcp",
"args": ["stdio"]
}
}
}
Cherry Studio is a cross-platform AI desktop client with full MCP support. Ideal for Android device automation tasks.
Option A: Using uvx (recommended)
Command: uvx
Arguments: uiautomator2-mcp-server stdio
Option B: Using installed u2mcp command
Command: u2mcp
Arguments: stdio
Option C: HTTP Mode First start the server:
u2mcp http --host 0.0.0.0 --port 8000 --no-auth
Then in Cherry Studio, select HTTP mode and enter:
URL: http://localhost:8000/mcp
For detailed MCP configuration in Cherry Studio, see the official documentation.
ChatMCP is an open-source AI chat client implementing the MCP protocol. Supports multiple LLM providers (OpenAI, Claude, Ollama).
Using uvx (recommended)
Command: uvx
Arguments: uiautomator2-mcp-server stdio
Using installed u2mcp command
Command: u2mcp
Arguments: stdio
HTTP Mode First start the server:
u2mcp http --host 0.0.0.0 --port 8000 --no-auth
Then in ChatMCP, select HTTP mode and enter:
URL: http://localhost:8000/mcp
Cline is an AI coding assistant extension that supports MCP.
{
"android": {
"command": "u2mcp",
"args": ["stdio"]
}
}
Continue is an AI pair programmer extension for VS Code and JetBrains.
{
"mcpServers": {
"android": {
"command": "u2mcp",
"args": ["stdio"]
}
}
}
For clients that support HTTP connections (or for remote access), start the server first:
u2mcp http --host 0.0.0.0 --port 8000 --no-auth
Then configure your client to connect to http://localhost:8000/mcp.
Note: Check your client's documentation for HTTP MCP server configuration, as the setup varies by client.
The server follows the Model Context Protocol specification and can be used with any MCP-compatible client, including:
Refer to your client's documentation for specific configuration details.
Prerequisite: To use AI-driven UI testing, you must first configure an MCP client (such as Claude Desktop, Cursor, or Cherry Studio) to connect to this server. See the MCP Client Configuration section above for setup instructions.
This project includes an AI-driven UI testing framework using the skills/ system. The android-ui-test skill serves a dual purpose:
skills/android-ui-test/
├── SKILL.md # Core skill definition (YAML metadata + lightweight description)
├── README.md # Architecture overview and quick start
├── examples/ # Learning materials
│ └── usage-examples.md # Detailed usage patterns and examples
└── references/ # Technical specifications
└── test-specification.md # Complete test specification (TC001-TC010)
Simply ask the AI to execute the UI test:
Run the Android UI test suite on my connected device
The AI will:
Android UI Test Summary
=======================
Device: UGAILFCIU88TT469 (PDKM00, Android 11, SDK 31)
Test Cases:
[PASS] TC001: Device Connection & Initialization
[PASS] TC002: Device Info & Capture
[PASS] TC003: Touch Actions
[PASS] TC004: Gesture Actions
[PASS] TC005: Application Management
[PASS] TC006: Element Operations
[PASS] TC007: Input & Keyboard
[SKIP] TC008: Clipboard Operations (Android security restriction)
Total: 7 passed, 1 skipped, 0 failed
See skills/android-ui-test/ for a complete reference implementation.
Each skill directory contains:
SKILL.md - YAML frontmatter with metadata and lightweight descriptionexamples/ - Detailed usage patterns for learningreferences/ - Technical specifications and test casesThe server provides 70+ tools organized into the following categories:
Run these commands to explore available tools:
# List all tools
u2mcp tools
# Show detailed info for a specific tool
u2mcp info screenshot
# Show tools matching a pattern (supports wildcards)
u2mcp info "device:*" # All device tools
u2mcp info "*screenshot*" # Tools with 'screenshot' in name
u2mcp info "xpath:*" # All XPath tools (v0.3.0+)
# List all tool tags
u2mcp tags
You: Take a screenshot
Claude: [Uses screenshot tool, displays image]
You: What apps are installed?
Claude: [Lists installed apps using app_list]
You: Open the YouTube app
Claude: [Uses app_start with package name]
You: Search for "cats"
Claude: [Uses click to tap search bar, then send_text to type "cats"]
You: Scroll down
Claude: [Uses swipe to scroll down]
Apache-2.0
A MCP (Model Context Protocol) server that provides tools for controlling and interacting with Android devices using uiautomator2.
Herramientas
Aún no hay lista de herramientas. Los servidores remotos la reciben tras la primera comprobación de estado.
Preguntas frecuentes
Copia en esta página la configuración stdio para Cursor, Claude Desktop, Claude Code o VS Code. Usa la instalación del publicador, no un proxy de PlugMCP.
Este registro no indica ninguna variable de entorno obligatoria.
Uiautomator2 se ejecuta localmente por stdio.
Última comprobación: 2026-10-27. A MCP (Model Context Protocol) server that provides tools for controlling and interacting with Android devices using uiautomator2.