Skip to main content
Glama
zalazp
by zalazp

adb-sms MCP

Liest Android-SMS-Verifizierungscodes über ADB, damit der Cursor Agent in Verbindung mit chrome-devtools die Web-SMS-Anmeldung durchführen kann.

Designprinzip: Die Telefonnummer wird vom Benutzer in devices.json konfiguriert; adb ist nur für die Erkennung der Geräte-Serialnummer + das Lesen des SMS-OTP zuständig.

Funktionsweise

USB 连接手机(adb devices → serial)
        │
        ├─ devices.json[serial].phone_numbers  →  Web 填手机号
        │
        └─ adb 读短信 inbox                    →  adb_wait_for_otp 拿验证码

Related MCP server: Android MCP Server

Projektstruktur

mcp-adb-sms/
├── server.py              # MCP 服务入口
├── adb_client.py          # ADB 设备 / 短信读取
├── sms_parser.py          # 短信与 OTP 解析
├── test_local.py          # 本地自检(不启动 MCP)
├── requirements.txt
├── devices.json.example   # 手机号配置模板(提交到 git)
├── devices.json           # 本地配置(git 忽略,需自行创建)
└── README.md

Voraussetzungen

  1. Android-Handy mit aktiviertem USB-Debugging und autorisiertem Computer

  2. adb devices zeigt device (nicht unauthorized)

  3. Python 3.10+ (empfohlen 3.12)

  4. Android platform-tools (enthält adb)

Installation

git clone https://github.com/zalazp/mcp-adb-sms.git
cd mcp-adb-sms
py -3.12 -m pip install -r requirements.txt

Telefonnummer konfigurieren (erforderlich)

Die Telefonnummer wird nicht von adb gelesen. Bitte tragen Sie sie selbst in devices.json ein:

copy devices.json.example devices.json
  1. Führen Sie adb devices aus und notieren Sie die Serialnummer (z. B. 10AD410LNF000PX)

  2. Verwenden Sie die Serialnummer als Schlüssel und tragen Sie alle Telefonnummern dieses Geräts ein

{
  "10AD410LNF000PX": {
    "phone_numbers": [
      "18317840243",
      "19139582095"
    ]
  }
}

Cursor-Konfiguration

Bearbeiten Sie %USERPROFILE%\.cursor\mcp.json:

{
  "mcpServers": {
    "adb-sms": {
      "command": "py",
      "args": [
        "-3.12",
        "E:\\path\\to\\mcp-adb-sms\\server.py"
      ],
      "env": {
        "ADB_PATH": "D:\\RJAZ\\Sdk\\platform-tools\\adb.exe"
      }
    }
  }
}

Feld

Beschreibung

Pfad in args

Auf den absoluten Pfad von server.py im Clone-Verzeichnis ändern

ADB_PATH

Absoluter Pfad zu adb.exe auf diesem Rechner; wenn bereits im PATH, kann "adb" geschrieben werden

Nach dem Speichern Cursor neu starten; adb-sms im MCP-Bedienfeld sollte grün werden.

Lokaler Selbsttest

cd mcp-adb-sms
$env:ADB_PATH="D:\RJAZ\Sdk\platform-tools\adb.exe"
py -3.12 test_local.py

Beispiel für normale Ausgabe:

{
  "adb_exists": true,
  "devices": [{ "serial": "10AD410LNF000PX", "state": "device" }],
  "sms_readable": true,
  "sim_numbers": [
    { "number": "13800138000", "available": true },
    { "number": "13900139000", "available": true }
  ],
  "device_profile": { "source": "devices.json" }
}

Wenn recommendations auf fehlende Konfiguration hinweist, erstellen Sie devices.json wie oben beschrieben.

MCP-Tools

Tool

Beschreibung

adb_health_check

Diagnostiziert adb, SMS-Lesbarkeit und ob devices.json konfiguriert ist

adb_list_devices

Listet verbundene ADB-Geräte auf

adb_get_sim_numbers

Liest die Telefonnummern der aktuellen Serialnummer aus devices.json

adb_read_recent_sms

Liest die letzten N SMS-Nachrichten

adb_wait_for_otp

Pollt und wartet auf neues OTP, nachdem im Web auf „Code senden“ geklickt wurde

adb_grant_sms_permission

Versuch auf Android 11+, der Shell das Lesen von SMS zu erlauben

adb_shell

Eingeschränkte adb-Shell (Whitelist-Befehle)

Typischer Agent-Ablauf (SMS-Anmeldung)

1. adb_health_check()
2. adb_get_sim_numbers()              ← 从 devices.json 取手机号
3. chrome-devtools: 打开登录页、填号、勾选协议
4. chrome-devtools: 滑块验证码(失败则人工完成)
5. chrome-devtools: 点击「发送验证码」
6. adb_wait_for_otp(timeout=90, sender_filter="Midea|美的")
7. chrome-devtools: 填入验证码并登录

Wenn SMS nicht gelesen werden können

adb shell appops set com.android.shell READ_SMS allow

Oder rufen Sie im Agent adb_grant_sms_permission auf und führen Sie dann adb_health_check aus.

Bei weiterem Fehlschlag versucht MCP, über dumpsys notification als Fallback SMS aus der Benachrichtigungsleiste zu lesen (geringere Genauigkeit).

Sicherheitshinweise

  • Liest nur SMS von per USB verbundenen lokalen Geräten

  • SMS-Inhalte werden nicht dauerhaft auf der Festplatte gespeichert

  • devices.json enthält Telefonnummern und ist in .gitignore; nicht in öffentliche Repositories committen

  • adb_shell erlaubt nur Whitelist-Befehle wie content / dumpsys / getprop

  • Nur für eigene Geräte oder autorisierte Testszenarien

License

MIT

F
license - not found
Not graded
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

  • F
    license
    A
    quality
    C
    maintenance
    Enables AI agents to interact with Android devices through UI manipulation, screen capture, touch gestures, text input, and app management via ADB. Provides comprehensive mobile automation capabilities including element detection, navigation, and application control for Android device testing and interaction.
    9
    5
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables control of Android devices through ADB using natural language commands. Supports browser automation, SMS sending, device information retrieval, settings control, and common device actions like screenshots and button presses.
    3

View all related MCP servers

Related MCP Connectors

  • Remote MCP for Android CLI agent build gate, structured receipts, audit logs, and reviewer-ready evi

  • Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.

  • Control plane for agent auth walls. Connector 0 handles SMS OTP with US test numbers.

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/zalazp/mcp-adb-sms'

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