Skip to main content
Glama

cross-dev-mcp

Cross-platform real-device debugging MCP for React Native local development. V1 supports Android, iOS, and HarmonyOS real devices, prioritizing real-time connection status, screenshots/frames, logs, Doctor, Evidence, and Codex context callbacks.

See the full design and roadmap in docs/cross-dev-mcp-design-and-roadmap.md.

V1 Architecture

Codex / MCP Host
  ├─ stdio MCP tools
  └─ Vue 3 MCP App
          │ REST + WebSocket
       Hono Daemon
          │ unified TypeScript API
     CrossDevService
       ├─ Android: Tango + Google ADB Server(无 scrcpy)
       ├─ iOS: go-ios(仅真机)
       └─ HarmonyOS: 官方 HDC / UITest / HiLog(仅真机)

Device capabilities are implemented through Provider, and the application layer only uses unified protocols such as RuntimeTarget, RawFrame, and NormalizedLogRecord. DOM/element inspection only retains the future interface boundary and is not part of the current P0.

Related MCP server: React Native Debug MCP

Development

pnpm install
pnpm dev

pnpm dev starts both the device Daemon at http://127.0.0.1:4110 and the Vue/Vite development page at http://127.0.0.1:5173. The MCP frontend has two modes:

# 调试模式:从 Vite 加载实时源码并启用 HMR
pnpm mcp:dev

# 正式模式:读取 apps/dashboard/dist 构建产物
pnpm build
pnpm mcp

Common verification:

pnpm typecheck
pnpm test
pnpm build

The Daemon default address is http://127.0.0.1:4110. The Dashboard can be opened independently, and can also be opened in Hosts that support MCP Apps via the MCP tool mobile_open_dashboard.

To demo the UI without a real device, you can temporarily use CROSS_DEV_FAKE=1 pnpm dev:daemon; production/MCP startup does not register the Fake Provider by default.

Adding to Codex

You can register the stdio MCP directly on the current machine:

codex mcp add cross-dev-mcp -- \
  pnpm --silent --dir /Users/didi/VscodeProjects/phone-dev-mcp mcp:dev

The registration above is for local debugging and lets the Codex MCP App load the Vite live source directly. For production use, change mcp:dev at the end to mcp. After restarting or refreshing the Codex MCP list, you can call mobile_open_dashboard to open the workbench. If the project moves to another directory, update the absolute path in the command accordingly.

See the corresponding packages/*/README.md for each subpackage's responsibilities, APIs, platform principles, and verification commands; all public and key implementation methods use Chinese JSDoc.

Only 127.0.0.1 is listened on by default. Device write operations, signing, installation, tunneling, and privilege escalation are not executed without confirmation.

Available Tools

7 tools
mobile_capture获取移动端截图A
Read-onlyIdempotent

截取真机画面并返回节省 token 的压缩图片。

Inputs: targetId (required), format, quality, maxWidth.

mobile_doctor诊断移动端连接A
Read-onlyIdempotent

运行 ADB、go-ios 和官方 HDC 的平台专项连接诊断,可指定单台设备。

Inputs: targetId.

mobile_get_logs读取筛选后的移动端日志C
Read-onlyIdempotent

读取已连接真机的标准化原生日志,支持按级别和文本筛选。

Inputs: targetId (required), level, limit, preset, +2 more.

mobile_interact操作移动端设备A

通过所选平台适配器发送经过校验的点击、滑动、文本输入或按键操作。

Inputs: action (required), targetId (required).

mobile_list_targets列出移动端真机A
Read-onlyIdempotent

列出 Android、iOS 与 HarmonyOS 真机及其实时连接状态和能力状态。

Inputs: no named parameters.

mobile_open_dashboard打开移动端调试工作台A
Read-onlyIdempotent

打开 cross-dev-mcp 实时真机工作台。Codex Desktop 调用后应读取 dashboardUrl,并直接在右侧内嵌浏览器中打开;其他兼容宿主使用关联的 MCP App。

Inputs: no named parameters. Returns: title, dashboardUrl, presentation, dashboardMode

mobile_read_evidence读取已暂存的移动端证据A
Read-onlyIdempotent

读取 Dashboard 暂存的证据包,其中包含压缩并标注的画面及所选日志。

Inputs: evidenceId (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a clearly distinct action: listing devices, capturing screens, reading logs, running diagnostics, sending interactions, reading evidence, and opening the dashboard. There is no meaningful overlap or ambiguity between tool purposes.

    Naming Consistency4/5

    Tool names mostly follow a consistent mobile_<verb>_<noun> pattern, e.g. mobile_list_targets, mobile_get_logs, mobile_read_evidence. Minor deviations like mobile_capture and mobile_doctor lack a clear noun or use a noun-like verb, but the overall pattern is predictable.

    Tool Count5/5

    Seven tools is well-scoped for a real-device testing and debugging server. Each tool serves a distinct workflow step without unnecessary bloat or duplication.

    Completeness4/5

    The tool surface covers the core lifecycle of device discovery, interaction, capture, logs, diagnostics, and evidence retrieval. Minor gaps exist, such as no explicit app installation/launch or file transfer operations, but the provided set supports a coherent testing workflow.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers