Skip to main content
Glama
shuao-pro

Android MCP Server

by shuao-pro

Android MCP Server

AI-powered Android device automation via MCP (Model Context Protocol).

Control an Android phone with natural language β€” through Claude Desktop, Cherry Studio, Kai 9000, or the built-in Web GUI with AI chat.


πŸ—οΈ Architecture

flowchart LR
    A["πŸ€– MCP Client<br/>Claude / Kai 9000 / Cherry"]
    B["🐍 Python Server<br/>FastMCP + Web GUI :8080"]
    C["πŸ“± Android Device<br/>Shizuku App :18080"]

    A <-->|"SSE / stdio / HTTP<br/>:9000"| B
    B <-->|"JSON-RPC<br/>ADB tunnel"| C

    B -.->|"Vision API"| D["🧠 AI Vision<br/>Claude / GPT-4o"]
    C -.->|"UID 2000"| E["⚑ System APIs<br/>Shell / Input / Files"]

Layer

Role

Key Tech

πŸ€– MCP Client

AI assistant connects via MCP

Claude Desktop, Kai 9000, Cherry Studio

🐍 Python Server

Tool registry, Web GUI, AI chat agent

FastMCP + FastAPI + WebSocket

πŸ“± Android App

System-level execution on device

Shizuku (UID 2000), HTTP JSON-RPC

πŸ’‘ The server can run on the phone itself (Termux / Kai 9000). Set ANDROID_HOST=127.0.0.1 β€” no ADB needed.

Related MCP server: scrcpy-mcp

✨ Features

Device Control (29 MCP Tools)

Category

Tools

Device

health_check, get_device_info, get_battery_info

Shell

shell β€” any ADB-level command

Input

click, long_click, swipe, drag, type_text, press_key

Apps

open_app, close_app, clear_app_data, install_app, uninstall_app, get_current_app, list_installed_apps

Screen

take_screenshot, get_ui_hierarchy

Files

read_file, write_file (including /data/data)

System

get_system_setting, put_system_setting, set_clipboard, get_clipboard, get_notifications, start_activity

Vision

find_element β€” AI locates UI elements, click_element β€” find + click in one step

AI Vision

  • AI-powered screen element recognition via Claude Vision / GPT-4o / custom API

  • Natural language β†’ pixel coordinates β†’ automated click

  • Example: find_element("the login button") β†’ {center_x: 540, center_y: 960, confidence: 0.95}

Web Dashboard

  • AI Chat β€” control the phone by typing "open settings" or "click the search icon"

  • Live Screen β€” 10fps WebSocket stream with click-to-touch

  • scrcpy β€” native low-latency mirroring (one-click launch)

  • Setup Wizard β€” guided 5-step setup with auto-detection + MCP SSE endpoint display

  • Settings Panel β€” configure API providers + ADB device manager with .env sync

  • δΈ­/English β€” full i18n support

  • Shell Terminal β€” live ADB shell in the browser

MCP Clients

Connect any MCP-compatible client to the server:

Client

Transport

Endpoint

Platform

Kai 9000

Streamable HTTP

:9000/mcp

Android (F-Droid)

Cherry Studio

Streamable HTTP

:9000/mcp

Windows / macOS / Linux

Claude Desktop

SSE / stdio

:9000/sse or stdio

Windows / macOS / Linux

Termux + curl

SSE

:9000/sse

Android (Termux)

Cherry Studio config: Set MCP type to streamableHttp, URL http://<lan_ip>:9000/mcp. Or import cherry-studio-mcp.json from the project root.

MCP Transport

Mode

Endpoint

Use Case

stdio

(local pipe)

Claude Desktop local integration

SSE

:9000/sse

Claude Desktop remote, web frontends

Streamable HTTP

:9000/mcp

Kai 9000, modern MCP clients

Combined (default)

both on :9000

SSE + Streamable HTTP simultaneously

πŸš€ Quick Start

Prerequisites

  • Python 3.10+

  • Android device with Shizuku installed

  • ADB (Android SDK Platform Tools)

  • scrcpy (optional, for native mirroring)

1. Install

git clone https://github.com/shuao-pro/android-mcp.git
cd android-mcp
pip install -e .

2. Setup

# First-time setup (configures .env)
bash scripts/setup.sh

Or manually:

cp .env.example .env

Install the Android APK to your phone:

# Pre-built APK (recommended) ιˆ₯?from the android/ project
adb install "android/app/build/outputs/apk/debug/app-debug.apk"

# Or build from source
cd android && .\gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk

3. On Your Phone

  1. Start Shizuku (grant root or wireless debugging permission)

  2. Open Android MCP app β†’ grant Shizuku permission β†’ tap Start

  3. Notification shows "MCP service running" on port 18080

4. Start Server

# One-click (SSE + Web GUI + ADB forward)
./start.sh

# Windows
start.bat

Opens browser at http://127.0.0.1:8080.

5. Connect MCP Client

In the Web GUI, open Menu β†’ Setup to see your MCP addresses:

Client

Endpoint

Kai 9000 (phone)

http://192.168.x.x:9000/mcp

Claude Desktop (remote)

http://192.168.x.x:9000/sse

Same device (Termux)

http://127.0.0.1:9000/sse or /mcp

Add the address in Kai 9000 (Settings β†’ MCP Servers β†’ Add) or Claude Desktop:

{
  "mcpServers": {
    "android": {
      "command": "python",
      "args": ["-m", "android_mcp.main", "--mode", "mcp"]
    }
  }
}

Now chat with the AI to control your phone β€” "open settings", "take a screenshot", "click the search button".


βš™οΈ Configuration

Edit .env:

# Device connection
ANDROID_HOST=127.0.0.1
ANDROID_PORT=18080

# Web GUI
WEB_HOST=127.0.0.1
WEB_PORT=8080

# MCP Server (SSE + Streamable HTTP) β€” for Kai 9000 & other clients
# Use 0.0.0.0 to accept WiFi/phone connections; 127.0.0.1 for local-only
MCP_HOST=0.0.0.0
MCP_PORT=9000

# AI Vision (optional β€” enables AI chat + element recognition)
VISION_PROVIDER=anthropic       # anthropic | openai | custom
VISION_API_KEY=sk-ant-api03-xxxxx
VISION_MODEL=                   # leave empty for default
VISION_API_BASE=                # only for custom provider

πŸ–₯️ CLI Commands

# Start modes
python -m android_mcp.main --mode all-sse   # SSE + Streamable HTTP + Web GUI (default)
python -m android_mcp.main --mode mcp       # stdio only (Claude Desktop)
python -m android_mcp.main --mode mcp-sse   # SSE + Streamable HTTP (headless)
python -m android_mcp.main --mode mcp-http  # Streamable HTTP only
python -m android_mcp.main --mode web       # Web GUI only

# Process management
python -m android_mcp.gateway start         # Start as daemon
python -m android_mcp.gateway status        # Check status
python -m android_mcp.gateway stop          # Stop daemon
python -m android_mcp.gateway forward       # Set up ADB port forward

πŸ“ Project Structure

android-mcp/
β”œβ”€β”€ android_mcp/
β”‚   β”œβ”€β”€ server.py          # FastMCP server definition
β”‚   β”œβ”€β”€ main.py            # Entry point
β”‚   β”œβ”€β”€ config.py          # Environment config
β”‚   β”œβ”€β”€ bridge.py          # HTTP bridge to Android
β”‚   β”œβ”€β”€ gateway.py         # CLI process manager
β”‚   β”œβ”€β”€ tools/             # MCP tool implementations (by domain)
β”‚   β”‚   β”œβ”€β”€ device.py      # Health, info, screenshot
β”‚   β”‚   β”œβ”€β”€ input.py       # Touch, swipe, keys
β”‚   β”‚   β”œβ”€β”€ apps.py        # Package management
β”‚   β”‚   β”œβ”€β”€ system.py      # Shell, settings, clipboard
β”‚   β”‚   β”œβ”€β”€ files.py       # File read/write
β”‚   β”‚   └── vision.py      # AI element recognition
β”‚   β”œβ”€β”€ vision/            # Vision model clients
β”‚   β”‚   β”œβ”€β”€ models.py      # Data classes + Protocol
β”‚   β”‚   β”œβ”€β”€ clients.py     # Anthropic + OpenAI clients
β”‚   β”‚   └── prompts.py     # Prompt builder + parser
β”‚   └── web/               # Web GUI
β”‚       β”œβ”€β”€ server.py      # FastAPI + WebSocket
β”‚       β”œβ”€β”€ chat_agent.py  # AI chat β†’ tool execution
β”‚       β”œβ”€β”€ scrcpy_bridge.py # scrcpy + frame streaming
β”‚       └── static/        # HTML/CSS/JS frontend
β”œβ”€β”€ android/               # Android APK project
β”‚   β”œβ”€β”€ app/src/main/
β”‚   β”‚   β”œβ”€β”€ java/com/example/androidmcp/
β”‚   β”‚   β”‚   β”œβ”€β”€ App.kt             # Application class
β”‚   β”‚   β”‚   β”œβ”€β”€ MainActivity.kt    # Main UI + Shizuku auth
β”‚   β”‚   β”‚   β”œβ”€β”€ McpService.kt      # Foreground service
β”‚   β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FileApi.kt     # File read/write/delete
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ InputApi.kt    # Touch, swipe, key events
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PackageApi.kt  # App install/uninstall
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ShellApi.kt    # Shell command execution
β”‚   β”‚   β”‚   β”‚   └── SystemApi.kt   # Screenshot, clipboard, settings
β”‚   β”‚   β”‚   β”œβ”€β”€ server/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ HttpServer.kt  # Embedded HTTP server (:18080)
β”‚   β”‚   β”‚   β”‚   └── Router.kt      # JSON-RPC method dispatch
β”‚   β”‚   β”‚   └── util/
β”‚   β”‚   β”‚       └── ShizukuHelper.kt # Shizuku binder wrapper
β”‚   β”‚   └── res/                   # Layout, drawable, strings
β”‚   β”œβ”€β”€ gradle/                    # Gradle wrapper
β”‚   β”œβ”€β”€ build.gradle.kts
β”‚   └── settings.gradle.kts
β”œβ”€β”€ scripts/setup.sh       # First-time setup
β”œβ”€β”€ start.sh               # One-click start
β”œβ”€β”€ start.bat              # Windows launcher
β”œβ”€β”€ pyproject.toml
└── .env.example

πŸ“‹ Requirements

Component

Requirement

Python

3.10+

Android

11+ (API 30+)

Android App

Shizuku installed and running

ADB

Platform Tools (for port forward)

scrcpy

Optional (native mirroring)

AI Vision

Anthropic/OpenAI API key (optional)

MCP Client

Kai 9000 (F-Droid), Claude Desktop, or any SSE/stdio MCP client


πŸ“„ License

MIT

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Control Android TV from any AI. 38 MCP tools: playback, recap, recommend, smart-home, schedules.

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shuao-pro/android-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server