dsh-phone-mcp-gateway
Controls an Android phone through dsh-Go, providing tools to read the screen, collect UI state, tap, type, scroll, send key events, launch apps, open intents, send notifications, access the clipboard and calendar, and optionally run Android shell/diagnostics commands.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
dsh-phone-mcp-gateway
DSH 插件。把 Android 版 dsh-Go 的手机控制能力(读屏、点击、输入、打开应用等)作为标准 MCP Streamable HTTP 服务开放给外部 agent(opencode、Hermes、Claude Code 等)。
工作方式
外部 agent ──HTTP(S) / MCP──▶ 本插件(DSH 进程内,默认 0.0.0.0:3847/mcp)
│ 按行分隔的 JSON-RPC + hello 鉴权
▼
Android PhoneBridge(抽象 Unix 套接字,失败时退回 127.0.0.1 TCP)插件读取
bridge.json(默认/var/lib/dsh-app/phone/bridge.json)获取 PhoneBridge 的套接字名、TCP 端口和 token。文件轮换后自动重连。每个外部 MCP 会话映射为一个手机侧调用者
<clientName>@<来源IP>,调用时注入dsh-go/phone-caller元数据。手机上的确认弹窗和“正在被控制”提示显示这个名字。会话空闲超时、客户端断开或发送
notifications/cancelled时,插件向手机发送dsh-go/phone-run-end,释放手机控制权,并为下一次调用换新的 runId。工具调用耗时较长时(如
handoff、等待手机确认),插件改用 SSE 响应并定期发送心跳,避免客户端超时。
Related MCP server: phone-mcp
安全模型
请求按以下顺序检查,任一项不通过即拒绝:
检查 | 不通过时 |
路径等于 | 404 |
| 403 |
来源 IP 在 | 403 |
凭据库中已配置 | 503(未配置密钥时拒绝全部请求) |
| 401 |
工具在 | 工具不出现在 |
密钥只存放在 DSH 凭据库。配置文件里的
auth.token字段只接受空值,填入明文会被拒绝。修改凭据后立即生效,无需重载插件。
手机端原有的逐条确认机制不受影响。
安装与配置
在 DSH 中安装本插件。
在 DSH 凭据服务中写入
DSH_PHONE_MCP_TOKEN(建议使用 32 字节以上的随机字符串)。在 DSH 会话中执行
/phone-mcp查看运行状态和可用地址;执行/phone-mcp config获取客户端配置片段。
配置项
字段 | 默认值 | 生效方式 | 说明 |
|
| 立即 | 开关 HTTP 监听 |
|
| 重载 | 只通过 |
|
| 重载 | 监听端口 |
|
| 重载 | MCP 路径 |
|
| — | 固定值 |
| 回环、Tailscale( | 立即 | 留空则拒绝全部 |
| 见下表 | 立即 | 改动后向已连接客户端发送 |
|
| 立即 | 空闲多久释放手机控制权(30–3600) |
|
| 立即 | 最大并发会话数(1–16);满了时踢掉最久未活动且没有进行中调用的会话;全部都在调用中则返回 503 |
|
| 立即 | SSE 心跳间隔(5–120) |
|
| 重载 | PRoot 与 Direct 模式都能用默认值 |
工具策略
开关 | 默认 | 包含的工具 |
| 开 |
|
| 开 |
|
| 开 |
|
| 开 |
|
| 开 |
|
| 关 |
|
| 关 |
|
| 关 | 手机端将来新增、本插件尚未收录的工具 |
|
| 按名字单独禁用,优先级高于以上开关 |
客户端配置
通用格式(/phone-mcp config 输出的就是这一段,地址按当前网络填好):
{
"mcpServers": {
"dsh-phone": {
"type": "streamable-http",
"url": "http://<手机IP>:3847/mcp",
"headers": { "Authorization": "Bearer <YOUR_DSH_PHONE_MCP_TOKEN>" }
}
}
}opencode(opencode.json):
{
"mcp": {
"dsh-phone": {
"type": "remote",
"url": "http://<手机IP>:3847/mcp",
"headers": { "Authorization": "Bearer {env:DSH_PHONE_MCP_TOKEN}" }
}
}
}通过 USB 连接时,可以先执行 adb forward tcp:3847 tcp:3847,再使用 http://127.0.0.1:3847/mcp。
开发
npm test测试使用 Node 内置测试框架,
test/helpers/mock-phone-bridge.mjs模拟 Android PhoneBridge。test/loader.mjs优先从本机安装的dsh中解析@deepseek-ai/schemastery与@deepseek-ai/dsh-credentials;找不到时使用test/stubs/下的简化实现。可用环境变量DSH_NODE_MODULES指定路径。
许可
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Let AI agents control Android and iOS devices on Mobilerun Cloud: screen, input, apps, workflows.
Give your Grok Bot a phone: an MCP server to see and use your phone. Also works with Claude.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control Android phones via MCP and HTTP. Supports screen capture, taps, swipes, text input, and app management.7AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables desktop agents such as Claude Code and Codex to control an Android phone as a long-lived action endpoint, pairing over outbound WebSocket and exposing phone capabilities as MCP tools with local pause and revocation.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to operate a real Android phone through its accessibility service, exposing screen trees with stable refs, taps, typing, gestures, notifications, apps, and other device controls.5MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible AI assistants to see and control Android devices through ADB and a fast device-control protocol, including screenshots, touch input, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.801 npmMIT