MC

MCP Server for Android TV with ADB

Run an MCP server on your Android TV with bundled on-device ADB to manage, debug, and control apps directly.

Quick Install
npx -y @MiddlePoint-Solutions/mcp-on-android-tv

Overview

MCP (Model Context Protocol) Server for Android TV provides a lightweight, on-device service that exposes device management and debugging capabilities over a network API. It bundles an ADB (Android Debug Bridge) binary inside the app so you can run common ADB-style commands directly from clients without needing a separate host machine. This makes it easier to manage apps, collect logs, take screenshots, and control an Android TV device remotely.

This server is useful for developers, QA engineers, and automation systems that need programmatic access to Android TV devices. Because the ADB binary runs on the device itself, you can perform package and process operations even in environments where an external ADB host is inconvenient or unavailable. The server exposes a simple HTTP/JSON API and optional authentication to integrate with CI pipelines, remote debugging tools, or custom control panels.

Features

  • Embedded on-device ADB binary for executing shell and package manager commands
  • HTTP/JSON API for remote control and automation
  • Common device utilities exposed: screencap, logcat, dumpsys, pm, am
  • Start/stop apps, install/uninstall APKs, list packages, and query app info
  • Capture screenshots and retrieve logs programmatically
  • Simple authentication (token or password) and configurable listen address/port
  • Compatible with Android TV devices (no dedicated host ADB required)

Installation / Configuration

You can install the MCP server APK on your Android TV device by sideloading. Build from source or download releases from the project repository.

Download and install (example):

# From a host with ADB (one-time, to sideload the APK)
adb connect <ANDROID_TV_IP>:5555
adb install -r mcp-server-release.apk

Alternatively, build and install from source:

git clone https://github.com/MiddlePoint-Solutions/mcp-on-android-tv.git
cd mcp-on-android-tv
# build instructions depend on project (Gradle/Android Studio)
./gradlew assembleRelease
adb install -r app/build/outputs/apk/release/app-release.apk

Configuration is available via in-app UI or a JSON file on external storage. Example config file (/sdcard/mcp-config.json):

{
  "listen": "0.0.0.0",
  "port": 8080,
  "auth": {
    "type": "token",
    "token": "replace-with-strong-token"
  },
  "adbPath": "/data/data/com.example.mcp/bin/adb",
  "allowAnonymous": false
}

After installation, open the MCP app to set the listening port, authentication credentials, and any allowed client IPs. Ensure Developer Options are enabled on the Android TV if required by your device and grant the app any runtime storage/network permissions it requests.

Security note: bind addresses and authentication are configurable. When exposing the device on an untrusted network, use a strong token and firewall rules to limit access.

Available Tools / API Resources

The MCP server exposes a small set of endpoints to perform common actions. Example HTTP endpoints:

EndpointMethodDescription
/v1/adb/shellPOSTExecute a shell command via bundled ADB
/v1/adb/installPOSTInstall an APK (accepts multipart/form-data or URL)
/v1/adb/uninstallPOSTUninstall a package by name
/v1/screenshotGETCapture and download a screenshot (PNG)
/v1/logcatGETStream or fetch recent logcat output
/v1/app/startPOSTStart an activity (package + activity)
/v1/app/stopPOSTStop a running app (package name)

Example: run a shell command through the API:

curl -X POST "http://<TV_IP>:8080/v1/adb/shell" \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"cmd":"pm list packages -f"}'

Install an APK by uploading:

curl -X POST "http://<TV_IP>:8080/v1/adb/install" \
  -H "Authorization: Bearer <TOKEN>" \
  -F "apk=@/path/to/app.apk"

The server returns JSON responses with exit codes and stdout/stderr for commands executed via ADB.

Use Cases

  • Remote debugging: collect logcat, dumpsys, and stack traces without physically connecting a USB cable.
  • CI / Automation: install and run tests on Android TV devices from build agents — use the HTTP API to deploy builds and trigger test runs.
  • App lifecycle management: programmatically start/stop apps, uninstall old builds, and list installed packages during rollout or QA workflows.
  • Remote control and integration: home automation or monitoring systems can launch apps or capture screenshots for visual verification.
  • Debugging headless devices: when a host ADB setup isn’t available (e.g., remote labs), the on-device ADB binary enables many host-equivalent operations.

Getting the Project

Source code, releases, and issue tracking are available on GitHub:

https://github.com/MiddlePoint-Solutions/mcp-on-android-tv

Refer to the repository for build instructions, release artifacts, API documentation, and contribution guidelines.