GU

gitdzreal93/uiautomator2-mcp

Developer tools

This page was translated automatically. Technical details may differ from the original. View the original

20 stars 5 forks Quality 56 Trend 0

Android automator mcp

Overview

UIAutomator2 MCP server, based on the FastMCP framework, provides automated control capabilities for Android devices. - UI automation - element click - text input - screen swipe - element wait - page scrolling - Application Management - App Start/Stop - Current Application Information - UIAutomator2 Service Management Create or edit mcp.json files in the Claude Desktop configuration directory (usually in ~/.cursor/mcp.json or %APPDATA%\Cursor\mcp.json): Configuration Instructions: - android: Unique identifier for MCP server - command: Command for running Python (uv is used here, or python can also be used) - args: Command line parameters - --directory: Project directory path - run: Run command for uv - src/server.py: Server entry file path

Overview (machine translated)

UIAutomator2 MCP server, based on the FastMCP framework, provides automated control capabilities for Android devices.

Functional Features

  • Android device management

  • ADB command execution

  • Application package management

  • Screenshot

  • UI automation operations

  • Element click

  • Text input

  • Screen swipe

  • Element waiting

  • Page scrolling

  • Application management

  • App start/stop

  • Current application information

  • UIAutomator2 Service Management

Environmental Requirements

  • Python 3.10+
  • ADB tools
  • Android device or emulator

Installation

  1. Clone Project

  2. Install dependencies

MCP Configuration

1. Configuration mcp.json

Create or edit the mcp.json file in the Claude Desktop configuration directory (usually in ~/.cursor/mcp.json or %APPDATA%\Cursor\mcp.json):

Configuration Description:

  • android: The unique identifier of the MCP server
  • command: Command for running Python (uv is used here, or python is also available)
  • args: Command-line argument
  • --directory: Project directory path
  • run: Run command for uv
  • src/server.py: Server entry file path

2. Configuration options

You can adjust the following configurations as needed:

  1. Run directly using Python:

  2. Use a virtual environment:

  3. Add environment variables:

3. Multi-server configuration

You can define multiple MCP servers within the same configuration file:

Use tools

After configuration, you can directly use all available tools in Claude:

Development

  1. Install development dependencies

  2. Run the test

Contribution

Issue and Pull Requests are welcome.

License

MIT License

This page was translated automatically. Technical details may differ from the original.

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "android": { "command": "uv", "args": [ "--directory", "/path/to/uiautomator2-mcp", // 替换为你的项目路径 "run", "src/server.py" ] } } }