MCP-ADB

by isseikz

2 231 downloads Not rated yet
GitHub

About

MCP (Model Context Protocol) Server to control Android TV

Explore

- Screenshot Capture: Take screenshots of connected Android devices with automatic resizing
- Base64 Image Data: Receive screenshot data directly as base64-encoded strings
- Key Event Control: Send key events to Android devices (navigation, back, home)
- Multiple Device Support: Target specific devices when multiple devices are connected
- Device Listing: List all connected Android devices as resources
- Resource Access: Access screenshots and device information via resource URIs

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP-ADB
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Node.js (v16 or higher recommended)
- Android Debug Bridge (ADB) installed and available in PATH or configured via ADB_PATH environment variable
- Connected Android device(s) with USB debugging enabled

npm install

deviceId

(optional): Target a specific device when multiple devices are connected

keycode

The Android key code to send (see list below)

KEYCODE_DPAD_CENTER

Center/OK button

KEYCODE_DPAD_DOWN

Down navigation

KEYCODE_DPAD_UP

Up navigation

KEYCODE_DPAD_LEFT

Left navigation

KEYCODE_DPAD_RIGHT

Right navigation

KEYCODE_DPAD_UP_LEFT

Diagonal up-left

KEYCODE_DPAD_UP_RIGHT

Diagonal up-right

KEYCODE_DPAD_DOWN_LEFT

Diagonal down-left

KEYCODE_DPAD_DOWN_RIGHT

Diagonal down-right

KEYCODE_BACK

Back button

KEYCODE_HOME

Home button

Captures a screenshot from a connected Android device and automatically resizes it to 640px width.

Parameters:

- deviceId (optional): Target a specific device when multiple devices are connected

Response:

- Base64-encoded image data (PNG format) directly in the response

Example:

{
  "name": "screenshot",
  "arguments": {
    "deviceId": "emulator-5554"
  }
}

Sends a key event to a connected Android device.

Parameters:

- keycode: The Android key code to send (see list below)
- deviceId (optional): Target a specific device when multiple devices are connected

Available keycodes:

- KEYCODE_DPAD_CENTER - Center/OK button
- KEYCODE_DPAD_DOWN - Down navigation
- KEYCODE_DPAD_UP - Up navigation
- KEYCODE_DPAD_LEFT - Left navigation
- KEYCODE_DPAD_RIGHT - Right navigation
- KEYCODE_DPAD_UP_LEFT - Diagonal up-left
- KEYCODE_DPAD_UP_RIGHT - Diagonal up-right
- KEYCODE_DPAD_DOWN_LEFT - Diagonal down-left
- KEYCODE_DPAD_DOWN_RIGHT - Diagonal down-right
- KEYCODE_BACK - Back button
- KEYCODE_HOME - Home button

Example:

{
  "name": "pressKey",
  "arguments": {
    "keycode": "KEYCODE_DPAD_DOWN",
    "deviceId": "emulator-5554"
  }
}

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp-adb": {
            "mcp-adb": {
                "command": "node",
                "args": [
                    "/path/to/mcp-adb/build/index.js"
                ],
                "env": {
                    "ADB_PATH": "/path/to/adb"
                }
            }
        }
    }
}

McpServers

{
    "mcp-adb": {
        "command": "node",
        "args": [
            "/path/to/mcp-adb/build/index.js"
        ],
        "env": {
            "ADB_PATH": "/path/to/adb"
        }
    }
}

A Model Context Protocol (MCP) server that provides integration with Android Debug Bridge (ADB) for AI assistants to interact with Android devices.

Features

- Screenshot Capture: Take screenshots of connected Android devices with automatic resizing
- Base64 Image Data: Receive screenshot data directly as base64-encoded strings
- Key Event Control: Send key events to Android devices (navigation, back, home)
- Multiple Device Support: Target specific devices when multiple devices are connected
- Device Listing: List all connected Android devices as resources
- Resource Access: Access screenshots and device information via resource URIs

Prerequisites

- Node.js (v16 or higher recommended)
- Android Debug Bridge (ADB) installed and available in PATH or configured via ADB_PATH environment variable
- Connected Android device(s) with USB debugging enabled

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.