home / mcp / android adb mcp server

Android ADB MCP Server

Provides an MCP server to control Android devices via ADB, enabling shell, file transfer, app management, and screenshots.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "landicefu-android-adb-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@landicefu/android-adb-mcp-server"
      ]
    }
  }
}

You can control Android devices from your AI workflows through an MCP server that talks to ADB. This enables automated development and testing tasks like running shell commands, installing apps, transferring files, and taking screenshots directly from your AI environment.

How to use

You connect an MCP client to the Android ADB MCP Server to manage devices and run actions. When multiple devices are connected, you specify a device_id for commands that target a specific device. If only one device is connected, it is used automatically.

Common tasks you can perform include listing devices, running shell commands, installing or uninstalling apps, pushing or pulling files, launching apps, and taking screenshots. Use an MCP client to call the corresponding tools, passing any required device_id when more than one device is available.

How to install

Prerequisites you must have before running the server:

- ADB (Android Debug Bridge) must be installed and available in your system PATH. Verify with adb version.

- For clipboard functionality you need platform helpers: macOS uses osascript, Windows uses PowerShell, Linux uses xclip.

- Node.js 16.x or higher.

Step by step setup

{
  "mcpServers": {
    "android_adb": {
      "command": "npx",
      "args": ["-y", "@landicefu/android-adb-mcp-server"],
      "env": {},
      "disabled": false,
      "alwaysAllow": []
    }
  }
}

Alternative installation methods

Option 1: Install from npm. This is the easiest way to get started.

# Install globally
npm install -g @landicefu/android-adb-mcp-server

# Or install locally in your project
npm install @landicefu/android-adb-mcp-server

Manual installation from source

If you prefer building from source, follow these steps to clone, install dependencies, and build the server.

# Clone the repository
git clone https://github.com/landicefu/android-adb-mcp-server.git
cd android-adb-mcp-server

# Install dependencies and build
npm install
npm run build

# Configure with direct path to built index file

Configure for use

After building, you can configure the MCP client to load the server by pointing to the build output. For example, use a local stdio configuration that runs the built index.js via node.

Notes

The server supports connecting to multiple Android devices, executing shell commands, installing/uninstalling apps, transferring files, launching apps, and taking screenshots. When saving screenshots, relative paths are resolved relative to your home directory to ensure write permissions.

Troubleshooting

Common issues and fixes include verifying ADB availability, ensuring USB debugging is enabled on devices, and handling multiple connected devices by specifying device_id where required.

Available tools

adb_devices

List connected devices. Returns a list of device IDs for connected Android devices.

adb_shell

Execute shell commands on a specified Android device using adb shell. Requires the command and optional device_id.

adb_install

Install APK files on a specified device. Requires path to the APK and an optional device_id.

adb_uninstall

Uninstall applications from a device by package name. Optional device_id.

adb_list_packages

List installed packages on a device. Optional device_id and filter options.

adb_pull

Pull files from a device to the local machine. Requires remote_path and local_path; optional device_id.

adb_push

Push files from local to device. Requires local_path and remote_path; optional device_id.

launch_app

Launch an application by package name on a device. Optional device_id.

take_screenshot_and_save

Capture a screenshot and save to a local path. Requires output_path; optional device_id and format.

take_screenshot_and_copy_to_clipboard

Capture a screenshot and copy it to the clipboard. Optional device_id and format.