2A

2005selene2005-a11y/susu-phone-agent

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

38 stars 1 forks 质量 75 趋势 20MIT

通过MCP + Shizuku为Claude Code提供安卓设备桥接。没有root权限,也没有模型轮询。

概览

通过 Claude Code 通过 MCP + Shizuku 控制一部真正的安卓手机——没有 root,手机上没有 Claude 凭证,也没有模型轮询。 待办事项:添加演示GIF——Claude输入“打开小红书”→应用在真实手机上打开 (mcp/phone_mcp.py) — FastMCP 标准服务器。Claude Code 将其命名为其他 MCP 工具。它将请求转发到 Phone Bridge。 (bridge/bridge.py)——你服务器上的FastAPI作业队列。MCP会推送作业;Android的APK会把它们拉出来。没有任何内容被推送到手机上。 (android/) —— 前台服务。用 Shizuku 以无线 ADB 模式构建。无需 root 权限。手机通过普通 HTTPS 轮询你的桥接。设备上不进行 AI 推断。 ADB在互联网上很脆弱,需要开放端口,网络切换时容易中断。反向连接——电话轮询你的服务器——通过移动数据、NAT后方、任何地方都能使用。 Android 13+ 对无障碍服务受到严格限制。

概述(AI 翻译)

给Claude Code一个真正的安卓设备。

通过 Claude Code 通过 MCP + Shizuku 控制一部真正的安卓手机——没有 root,手机上没有 Claude 凭证,也没有模型轮询。


它的作用

你说 会发生什么?
“我用的是什么应用?” → com.xingin.xhs
“回家去。” 手机返回发射器
“开小红书。” 应用在真实设备上打开

演示

待办事项:添加演示GIF——Claude输入“打开小红书”→应用在真实手机上打开


它是如何运作的

三个组成部分,全部由你来主持:

1.电话MCP(mcp/phone_mcp.py)——FastMCP的标准服务器。Claude Code将其命名为其他MCP工具。它将请求转发到电话桥。

2.Phone Bridge(bridge/bridge.py)——你服务器上的FastAPI作业队列。MCP会推送作业;Android APK会把它们拉出来。没有任何东西会被推送到手机上。

3.Android Agent APK([android/)——前台服务。用 Shizuku 在无线 ADB 模式下构建。无需 root 权限。手机通过普通 HTTPS 轮询你的桥接。设备上不进行 AI 推断。

为什么不直接从服务器上ADB呢?

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Susu Phone Agent

Give Claude Code a real Android device.

Control a real Android phone from Claude Code through MCP + Shizuku — no root, no Claude credentials on the phone, no model polling.


What it does

You
 ↓
Claude Code
 ↓  MCP tool call
Susu Phone MCP
 ↓  HTTPS job queue
Susu Phone Bridge
 ↓  polling (phone-initiated)
Android Agent APK
 ↓  Shizuku UserService (uid=2000)
📱 Real Android phone
You say What happens
“What app am I using?” → com.xingin.xhs
“Go home.” Phone returns to launcher
“Open Xiaohongshu.” App opens on the real device

Demo

TODO: add demo GIF — Claude types “Open Xiaohongshu” → app opens on real phone


How it works

Three components, all yours to host:

1. Phone MCP (mcp/phone_mcp.py) — a FastMCP stdio server. Claude Code calls it like any other MCP tool. It forwards requests to the Phone Bridge.

2. Phone Bridge (bridge/bridge.py) — a FastAPI job queue on your server. The MCP pushes jobs in; the Android APK pulls them out. Nothing is pushed to the phone.

3. Android Agent APK (android/) — a foreground service. Built with Shizuku in wireless ADB mode. No root required. The phone polls your Bridge over ordinary HTTPS. No AI inference happens on the device.

Why not ADB from the server?

ADB over the internet is fragile, requires open ports, and breaks on network change. Inverting the connection — phone polls your server — works over mobile data, behind NAT, anywhere.

Why Shizuku instead of accessibility services?

Accessibility services are heavily restricted on Android 13+. Shizuku provides direct shell-level access (uid=2000) via the wireless debugging channel already built into Android. Commands like input keyevent, dumpsys window, and monkey work reliably without root.

Why MCP?

The Android device never receives Claude or Anthropic credentials. Claude Code invokes the MCP server locally on the host machine. Phone polling is ordinary HTTPS traffic — it does not invoke a model.


Quick Start

Prerequisites

  • Android phone with Shizuku installed (wireless ADB mode)
  • A server with Python 3.11+, nginx (or another reverse proxy)
  • Claude Code with a Claude subscription
  • JDK 17+ and Android SDK API 34 (for building the APK)
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "phone": { "type": "stdio", "command": "python3", "args": ["/path/to/mcp/phone_mcp.py"] } } }