# uiautomator2-mcp-server [Health: Active]

**Category:** 🖥️ OS Automation  
**Repository:** https://github.com/tanbro/uiautomator2-mcp-server  
**GitHub Stars:** 53  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/uiautomator2-mcp-server

## Description
A MCP (Model Context Protocol) server that provides tools for controlling and interacting with Android devices using uiautomator2.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "uiautomator2-mcp-server": {
    "command": "uvx",
    "args": ["uiautomator2-mcp-server"]
  }
}
```

## Documentation

## What uiautomator2-mcp-server does

uiautomator2-mcp-server gives MCP-compatible AI clients tools for interacting with Android devices. Its scope covers both direct device control and UI inspection: an agent can capture screenshots, examine the interface hierarchy, locate relevant elements with XPath filtering, tap or swipe, enter text, and manage applications.

The package is aimed at conversational automation as well as repeatable engineering workflows. Example scenarios include navigating an app, searching for content, playing or switching videos, filling forms, and carrying out other sequences that would otherwise require handwritten UI automation. It also includes an AI-driven UI testing framework for automated test scenarios.

One server can work with multiple phones. That makes it suitable for device fleets, repeated health checks, or workflows that need to inspect more than one Android target.

## How it works

An MCP client communicates with the server using the Model Context Protocol. The server passes device operations to uiautomator2, which uses ADB to reach a physical Android device or emulator. The device must have USB debugging enabled, and the host must be able to run `adb` from its PATH.

Two transport modes are available. `stdio` is intended for local MCP client integrations, while HTTP supports remote use. Tool filtering can limit the set of tools exposed to an AI client, reducing the available surface for a particular workflow. XPath filtering can also restrict UI dumps to the elements an agent needs, which helps reduce returned UI data.

## Setup and configuration

Python 3.11 or newer and Android SDK Platform Tools are prerequisites when using the Python package. Install and run the package directly with `uvx uiautomator2-mcp-server stdio`, or use `pipx run uiautomator2-mcp-server stdio`. A regular pip installation is also available:

```bash
python -m pip install uiautomator2-mcp-server
```

The installed command is `u2mcp`; the explicit transport subcommand is required, for example `u2mcp stdio`. Precompiled executables are available for Linux x86_64, Apple Silicon macOS, and Windows x64. Systems outside those binary targets can install from PyPI. The project also supports packaging a standalone executable with PyInstaller or Nuitka.

Configuration can be supplied through TOML, YAML, or JSON files, with automatic configuration-file discovery. The server can therefore be configured without putting every option directly into an MCP client command, although the specific configuration fields depend on the chosen setup.

## Tools and capabilities

The tool set contains more than 70 operations across common Android automation tasks, including:

- Capturing screenshots and inspecting the UI hierarchy
- Clicking, tapping, swiping, and entering text
- Managing installed or running applications
- Filtering UI results with XPath
- Selecting which tools an AI client can see
- Running AI-driven UI tests
- Operating across multiple Android devices

These capabilities support accessibility checks, app interaction prototypes, repetitive task automation, remote UI inspection, and periodic device status or health checks.

## Limitations and notes

The host needs ADB in its PATH, and each Android target must have USB debugging enabled. Precompiled binaries are not published for Linux aarch64, Intel Macs, or musl-based systems such as Alpine; those environments use a package-based installation instead. The Linux binaries target the glibc profile associated with their manylinux build image, so older distributions may also need a PyPI installation.

The short executable name and the PyPI package name differ: use `u2mcp` after installation, but install `uiautomator2-mcp-server`. Local integrations normally use STDIO, whereas remote deployments should use the HTTP mode.

_Full upstream README: https://allmcps.com/mcp/uiautomator2-mcp-server/readme_

