adb-sms
adb-sms MCP
通过 ADB 读取 Android 短信验证码,供 Cursor Agent 配合 chrome-devtools 完成 Web 短信登录。
设计原则:手机号由用户在
devices.json里配置;adb 只负责识别设备 serial + 读短信 OTP。
工作原理
USB 连接手机(adb devices → serial)
│
├─ devices.json[serial].phone_numbers → Web 填手机号
│
└─ adb 读短信 inbox → adb_wait_for_otp 拿验证码Related MCP server: Android MCP Server
项目结构
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前置条件
Android 手机开启 USB 调试 并授权电脑
adb devices显示device(非unauthorized)Python 3.10+(推荐 3.12)
Android platform-tools(含
adb)
安装
git clone https://github.com/zalazp/mcp-adb-sms.git
cd mcp-adb-sms
py -3.12 -m pip install -r requirements.txt配置手机号(必填)
手机号不由 adb 读取,请自行写入 devices.json:
copy devices.json.example devices.json运行
adb devices,记下 serial(例如10AD410LNF000PX)以 serial 为 key,填入该手机的全部手机号
{
"10AD410LNF000PX": {
"phone_numbers": [
"18317840243",
"19139582095"
]
}
}Cursor 配置
编辑 %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"
}
}
}
}字段 | 说明 |
| 改成 clone 目录下 |
| 本机 |
保存后 重启 Cursor,MCP 面板中 adb-sms 应变绿。
本地自检
cd mcp-adb-sms
$env:ADB_PATH="D:\RJAZ\Sdk\platform-tools\adb.exe"
py -3.12 test_local.py正常输出示例:
{
"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" }
}若 recommendations 提示缺少配置,按上文创建 devices.json。
MCP 工具
工具 | 说明 |
| 诊断 adb、短信可读性、 |
| 列出已连接 ADB 设备 |
| 从 |
| 读取最近 N 条短信 |
| Web 点击发送验证码后,轮询等待新 OTP |
| Android 11+ 尝试授权 shell 读 SMS |
| 受限 adb shell(白名单命令) |
Agent 典型流程(短信登录)
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: 填入验证码并登录短信读不到时
adb shell appops set com.android.shell READ_SMS allow或在 Agent 中调用 adb_grant_sms_permission,再执行 adb_health_check。
仍失败时,MCP 会尝试 dumpsys notification 降级读取通知栏短信(精度较低)。
安全说明
仅读取 USB 连接的本机设备 短信
不持久化短信内容到磁盘
devices.json含手机号,已在.gitignore中,请勿提交到公开仓库adb_shell仅允许 content / dumpsys / getprop 等白名单命令仅限本人设备或已授权测试场景
License
MIT
This server cannot be installed
Maintenance
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
- FlicenseAqualityCmaintenanceEnables 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.95
- AlicenseBqualityDmaintenanceEnables control of Android devices via ADB, allowing screenshot capture, touch simulation, and swipe gestures through natural language commands.221376MIT
- FlicenseNot gradedqualityDmaintenanceEnables 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
- FlicenseAqualityDmaintenanceEnables forensic investigators to acquire data from Android devices via ADB, including device backup, artifact collection, and secure command execution.105
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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