Get the FREE Ultimate OpenClaw Setup Guide →

android

MCP server for Android device control via ADB - supports screenshot, touch, and swipe actions

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jduartedj-android-mcp-server node dist/index.js \
  --env ADB_PATH="path/to/adb (or leave empty to auto-detect/download)" \
  --env DEVICE_SERIAL="target device serial (or leave empty for first available)"

How to use

The Android MCP Server exposes a rich set of tools to control and automate an Android device from your environment. It includes 22 capabilities split across categories such as basic device actions, UIAutomator-based interactions, Scrcpy streaming for video, and general ADB integration. After starting the server, you can use the MCP interface (via prompts in your IDE or Copilot integration) to invoke specific tool names like android_screenshot, android_touch, android_swipe, android_launch_app, android_list_packages, and android_input_text, among others. The server can automatically download required binaries (ADB and Scrcpy) on first use, so you can begin without manually installing those dependencies. When configuring the server in environments like VS Code Copilot, you can point to the local dist/index.js file or publish the server package to npm and run via npx.

To use the tools, pass structured JSON payloads that specify the tool name and its arguments. For example, to capture a screenshot you would call android_screenshot with an optional outputPath. For UI interactions, you can simulate taps, swipes, and long presses, and for UI inspection you can dump the UI hierarchy or interact with elements by resource ID or text. Scrcpy streaming enables real-time screen video with low latency, and App Management and ADB Integration provide powerful device control. The tools are designed to work with a connected device (USB debugging enabled) or an emulator. If you configure ADB_PATH or DEVICE_SERIAL in your environment, the server will target the specified device accordingly.

How to install

Prerequisites:

  • Node.js 18 or higher
  • npm (comes with Node.js)
  • An Android device connected via USB with USB debugging enabled, or an Android emulator

Installation steps:

  1. Clone the repository or install the npm package if published:
    • If cloning: git clone <repository-url>
    • Navigate to the project folder
  2. Install dependencies:
    npm install
    
  3. Build the server (if a build step is provided):
    npm run build
    
  4. Run the server standalone:
    node dist/index.js
    

Notes:

  • On first run, the server will automatically download ADB and Scrcpy binaries if they are not present.
  • You can configure the server to target a specific device by setting the DEVICE_SERIAL environment variable and/or providing a custom ADB path via ADB_PATH.
  • If you publish to npm, you can start it with npx as described in the VS Code integration section.

Additional notes

Tips and common considerations:

  • Prerequisites mention Node.js 18+ and a connected Android device with USB debugging enabled.
  • ADB_PATH and DEVICE_SERIAL are optional but can help target a specific device or use a custom ADB installation.
  • Scrcpy streaming requires network/speed suitable for video; for best performance ensure the device and host are on a fast connection.
  • If you see permission errors on macOS/Linux, ensure you have execute permissions for the downloaded binaries and that your user can access USB devices.
  • The server auto-downloads ADB and Scrcpy from official sources on first use, so an active internet connection is required at least once.
  • When configuring in VS Code Copilot, you can switch between local dist/index.js usage and npx-based invocation depending on your publishing status.

Related MCP Servers

Sponsor this space

Reach thousands of developers