cross-dev-mcp
cross-dev-mcp
React Native ローカル開発向けのクロスプラットフォーム実機デバッグ MCP。V1 は Android、iOS、HarmonyOS の実機をサポートし、リアルタイム接続状態、スクリーンショット/画面、ログ、Doctor、Evidence、Codex コンテキストの返信を優先的に提供します。
完全な設計とロードマップは docs/cross-dev-mcp-design-and-roadmap.md を参照してください。
V1 アーキテクチャ
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(仅真机)デバイス機能は Provider を通じて実装され、アプリケーション層は RuntimeTarget、RawFrame、NormalizedLogRecord などの統一プロトコルのみを使用します。DOM/要素検査は将来のインターフェース境界としてのみ保持され、現在の P0 には含まれません。
Related MCP server: React Native DevTools MCP
開発
pnpm install
pnpm devpnpm dev は http://127.0.0.1:4110 のデバイス Daemon と http://127.0.0.1:5173 の Vue/Vite 開発ページを同時に起動します。MCP フロントエンドは2つのモードに分かれています:
# 调试模式:从 Vite 加载实时源码并启用 HMR
pnpm mcp:dev
# 正式模式:读取 apps/dashboard/dist 构建产物
pnpm build
pnpm mcpよく使う検証:
pnpm typecheck
pnpm test
pnpm buildDaemon のデフォルトアドレスは http://127.0.0.1:4110 です。Dashboard は単独で開くことも、MCP Apps をサポートする Host で MCP tool mobile_open_dashboard を通じて開くこともできます。
実機がない状態で UI をデモする必要がある場合は、一時的に CROSS_DEV_FAKE=1 pnpm dev:daemon を使用できます。本番/MCP 起動時はデフォルトで Fake Provider を登録しません。
Codex に追加
現在のマシンで stdio MCP を直接登録できます:
codex mcp add cross-dev-mcp -- \
pnpm --silent --dir /Users/didi/VscodeProjects/phone-dev-mcp mcp:dev上記の登録はローカルデバッグ用で、Codex MCP App が Vite のリアルタイムソースを直接読み込むようにします。正式に使用する場合は末尾の mcp:dev を mcp に変更してください。Codex MCP リストを再起動または更新すると、mobile_open_dashboard を呼び出してワークベンチを開くことができます。プロジェクトを別のディレクトリに移動した場合は、コマンド内の絶対パスも合わせて置き換えてください。
各サブパッケージの責務、API、プラットフォームの原理、検証コマンドは対応する packages/*/README.md を参照してください。すべての公開および主要な実装メソッドは中国語の JSDoc を使用しています。
デフォルトでは 127.0.0.1 のみをリッスンします。デバイスへの書き込み操作、署名、インストール、トンネル、権限昇格は、確認なしでは実行されません。
Available Tools
7 toolsmobile_capture获取移动端截图ARead-onlyIdempotent
截取真机画面并返回节省 token 的压缩图片。
Inputs: targetId (required), format, quality, maxWidth.
mobile_doctor诊断移动端连接ARead-onlyIdempotent
运行 ADB、go-ios 和官方 HDC 的平台专项连接诊断,可指定单台设备。
Inputs: targetId.
mobile_get_logs读取筛选后的移动端日志CRead-onlyIdempotent
读取已连接真机的标准化原生日志,支持按级别和文本筛选。
Inputs: targetId (required), level, limit, preset, +2 more.
mobile_interact操作移动端设备A
通过所选平台适配器发送经过校验的点击、滑动、文本输入或按键操作。
Inputs: action (required), targetId (required).
mobile_list_targets列出移动端真机ARead-onlyIdempotent
列出 Android、iOS 与 HarmonyOS 真机及其实时连接状态和能力状态。
Inputs: no named parameters.
mobile_open_dashboard打开移动端调试工作台ARead-onlyIdempotent
打开 cross-dev-mcp 实时真机工作台。Codex Desktop 调用后应读取 dashboardUrl,并直接在右侧内嵌浏览器中打开;其他兼容宿主使用关联的 MCP App。
Inputs: no named parameters. Returns: title, dashboardUrl, presentation, dashboardMode
mobile_read_evidence读取已暂存的移动端证据ARead-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
Scored across 7 tools
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.
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.
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.
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.
Related MCP Connectors
remote debug iOS/Android/Unity/Godot/Flutter/RN/Web on real-device.ui-tree/screenshots/taps,tests.
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.
Drive and test your React Native and Expo apps end-to-end on iOS and Android. Supports real devices, simulators, and emulators. Snapshots, taps, typing, swipes, screenshots, deep links, reloads, builds and runtime errors.
Flutter in-app bug tracking, visual pin annotations, and device logs directly into your AI IDE.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to inspect, log, and control React Native apps on Android emulators or iOS simulators, including UI tree, tap, scroll, and hot reload.2230 npm5MIT
- AlicenseNot gradedqualityDmaintenanceBridges React Native DevTools, enabling AI assistants to debug, profile, and inspect React Native applications through a standardized protocol.4MIT
- AlicenseNot gradedqualityDmaintenanceBridges your IDE to a running React Native/Expo mobile app over local Wi-Fi, providing live device status, app logs, and a combined standup snapshot.ISC
- AlicenseBqualityCmaintenanceEnables coding assistants to drive iOS Simulators and Android emulators or USB devices for React Native and Expo work, including taking screenshots, reading app and device logs, opening deep links, installing builds, and launching or relaunching apps. It also supports Android-specific actions such as adb reverse for Metro, opening the dev menu, and tapping or typing on screen.20MIT