Android MCP Server
AI-powered Android device automation via MCP. Control an Android phone with natural language through Claude Desktop, Cherry Studio, Kai 9000, or the built-in Web GUI.
README
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.
<p align="center"> <img src="https://img.shields.io/badge/python-3.10+-blue" alt="Python"> <img src="https://img.shields.io/badge/license-MIT-green" alt="License"> <img src="https://img.shields.io/badge/MCP-1.8+-purple" alt="MCP"> <img src="https://img.shields.io/badge/version-2.0.2-orange" alt="v2.0.2"> </p>
Architecture
┌──────────┐ MCP/stdio ┌──────────────┐ HTTP/ADB ┌─────────────────┐
│ Claude │◄──────────────►│ Python MCP │◄────────────►│ Android Device │
│ Desktop │ │ Server │ tcp:18080 │ (Shizuku App) │
│ │ │ + Web GUI │ │ port 18080 │
│ Kai 9000 │ MCP/HTTP │ │ │ │
│ (phone) │◄──────────────►│ :9000 │ │ │
└──────────┘ └──────────────┘ └─────────────────┘
▲ ▲ ▲
│ SSE + Streamable HTTP │ Vision API │ UID 2000
│ :9000/sse (Claude) │ (Claude/GPT-4o) │ System-level
│ :9000/mcp (Kai 9000) │ Element recognition │ Shell/Input/
│ │ │ File access
▼ ▼ ▼
Any MCP Screenshot + AI Shizuku elevated
Client → click_element() permissions
Tip: The MCP server can run on the phone itself (Termux / Kai 9000 Linux sandbox). With
ANDROID_HOST=127.0.0.1, no ADB forward is needed — full phone-only automation.
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, URLhttp://<lan_ip>:9000/mcp. Or importcherry-studio-mcp.jsonfrom 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/user/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)
adb install android-app/app/build/outputs/apk/debug/app-debug.apk
# Or build from source
cd android-app && ./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk
3. On Your Phone
- Start Shizuku (grant root or wireless debugging permission)
- Open Android MCP app → grant Shizuku permission → tap Start
- 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-app/ # Android app (Kotlin, Shizuku)
├── 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。