Uiautomator2 MCP Server

1. 克隆项目 ```bash git clone https://github.com/yourusername/uiautomator2-mcp.git cd uiautomator2-mcp ```

Local serverstdioPython

What is the Uiautomator2 MCP MCP server?

Uiautomator2 mcp mcp server connects Uiautomator2 MCP to AI assistants that speak the Model Context Protocol. 1. 克隆项目 bash git clone https://github.com/yourusername/uiautomator2-mcp.git cd uiautomator2-mcp .

What Uiautomator2 MCP does

  1. 克隆项目 bash git clone https://github.com/yourusername/uiautomator2-mcp.git cd uiautomator2-mcp

Tools it exposes

Once connected, the assistant can call these 4 tools directly:

  • android — MCP服务器的唯一标识符
  • command — 用于运行Python的命令(这里使用uv,也可以使用python)
  • args — 命令行参数
  • run — uv的运行命令

Installing the uiautomator2 mcp mcp server

Setup follows the standard MCP pattern: clone or install the server, then register it in your client's configuration file and restart the client. The configuration snippets on this page cover Claude Desktop, Claude Code and Cursor.

Configuration

The server reads 2 environment variables: PYTHONPATH, ANDROID_HOME. Keep credentials in your client's env block or a secrets manager rather than committing them.

Where it fits

Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. Uiautomator2 MCP sits in that group, and the shape of its toolset — android, command, args among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • Maintained by GitDzreal93, written in Python.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the uiautomator2 mcp mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Available tools

ToolWhat it does
androidMCP服务器的唯一标识符
command用于运行Python的命令(这里使用uv,也可以使用python)
args命令行参数
runuv的运行命令

How to install the Uiautomator2 MCP MCP server

2. 使用虚拟环境:
```json
{
  "mcpServers": {
    "android": {
      "command": "/path/to/venv/bin/python",
      "args": [
        "/path/to/uiautomator2-mcp/src/server.py"
      ]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
PYTHONPATHFilesystem location the server is allowed to use.Optional
ANDROID_HOMEConfiguration value read at startup.Optional

Example prompts to try

  • Use Uiautomator2 MCP to android.
  • Use Uiautomator2 MCP to command.
  • Use Uiautomator2 MCP to args.

Frequently asked questions

It connects Uiautomator2 MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 4 tools (android, command, args, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Uiautomator2 MCP directly.