Skip to content

micartey/android-mcp

Repository files navigation

android mcp

Introduction

Note

Preview: Here we go to X.com and fetch the newest dumb shit musk posted:

preview

This repository is a proof-of-concept to drive an android phone via adb using the mcp protocol.

  • Analyze UI components
  • Take screenshot
  • Type text
  • Touch and Swipe input
  • Launch apps

Setup

The setup is fairly easy given you have already an connected device and created an adb session.

nix run github:micartey/android-mcp

# Or if you have cloned the repository, you can run:
nix develop .#mcp

Afterward, you have to configure the mcp server in your tool of choice. It needs to support SSE as the endpoint will be exposed to:

http://localhost:3134/sse

Virtualization

In case you want to use a VM instead of an actual android device, you need to start with creating one

  1. First we need to create a qcow2 image for our vm to boot later. This needs to be done with the following command
just create-qcow2-image
  1. For the next step we need the iso image from the android.

  2. Next, create a new VM and add the iso file. Select the qcow2 image as your drive.

  3. After starting, you need to install android. DO NOT choose the Live CD.

The following images are a step-by-step guide on how to install it
  1. Enable Debug Mode so that the device can communicate with adb

Now you can stop the VM.

Usage

First you want to start the VM

just vm-silent

Then you will need to run a slightly different command as this will also take care of connecting via adb

nix develop .#vm

About

An android mcp server to control android devices

Topics

Resources

Stars

Watchers

Forks

Contributors