Skip to main content
Glama

antigravity-plugin-mobile-remote

中文 | English

面向 Google Antigravity 的零外部 npm 依赖手机远程访问插件。无需在手机上登录 Google 账号、不依赖 antigravity.google.com 账号级特性开关,支持通过 Wi-Fi 局域网 / Tailscale 零延迟直连 或 一键 Cloudflare Quick / Named 公网隧道,手机扫码或输入 6 位数字 PIN 码即可随时随地查看 AI 实时思考流、审阅计划文档并下发新指令。


核心能力

模块

MCP 工具 / 界面入口

功能说明

桌面原生控制面板

open_mobile_remote(左侧导航栏 / 右侧面板 + 菜单 手机远程)

基于 MCP Apps (ui://) 渲染内置可视化面板:展示高清矢量二维码、6 位动态 PIN 码、局域网/Tailscale 网卡切换、公网隧道控制、在线设备管理与权限开关

安全扫码与 PIN 配对

remote_pair_offer

单枚限时活动配对码(刷新立即作废旧码,有效期内支持手机相机跳系统浏览器重复兑换);PIN 接口内置每 IP 每分钟 8 次错误限流防爆破

多模公网穿透与自愈

remote_tunnel

支持免账号 Cloudflare Quick Tunnel(自动下载跨平台 cloudflared 并强制 HTTP/2 穿透防 UDP 阻断)、Cloudflare Named Tunnel(固定域名跨重启免重配)及自定义公网反代地址;内置 60s 公网健康看门狗与崩溃孤儿进程回收

设备管理与一键断流

remote_devices

磁盘仅保存 SHA-256(deviceToken) 哈希(绝无明文落盘);自动识别手机机型与浏览器,支持重命名、单设备踢出与一键全停(毫秒级断开活动 WebSocket)

交互权限与可见范围

remote_policy

支持 完整交互模式 与 只读观察模式 一键切换;支持将可见范围收窄至指定工作区项目或会话白名单

竖屏触控伴侣端 PWA

/m(支持添加到主屏幕全屏运行)

专为 iOS Safari / Android Chrome 打磨:边缘右滑呼出会话抽屉、锁屏唤醒秒重连、思考链折叠卡、update_steps 实时进度清单、工具输出查看、工作区源码安全预览、Artifact 阅读与 /plan 一键批准


Related MCP server: phone-mcp

架构概览

Antigravity Desktop (Windows / macOS / Linux)
 ├── server/mcp-server.mjs (MCP stdio + SEP-1865 MCP App UI `ui://mobile-remote/panel.html`)
 ├── hooks/sync-env.mjs (SessionStart / PreInvocation / Stop 实时同步 LS 凭据与回合完成事件)
 └── server/gateway.mjs (常驻双平面网关守护进程)
      ├── 回环管理面 (127.0.0.1:<ephemeral>, x-agy-admin-secret 鉴权)
      ├── 上游桥接层 (server/agy-upstream.mjs)
      │    ├── ConversationService (Connect HTTP+JSON: List / Get / Create / Update + 磁盘离线回退)
      │    ├── agentapi CLI (`send-message` / `new-conversation` 唤醒会话投递指令)
      │    └── TranscriptHub (`transcript.jsonl` 按字节偏移实时增量流 + `brain/<cid>` 产物监控)
      └── 移动数据面 (默认端口 6879, LAN / Tailscale / Cloudflare HTTPS 隧道)
           ├── GET  /pair & POST /api/pair/claim (扫码与 6 位 PIN 配对)
           ├── GET  /m/* (零构建竖屏触控 PWA 伴侣端)
           └── WS   /ws  (已鉴权 JSON-RPC 2.0 双向多路复用通道)

快速安装

环境要求

  • Google Antigravity(App / IDE / CLI)

  • Node.js >= 22.0.0(零第三方 npm 依赖,克隆即装)

一键安装

git clone https://github.com/pengxie137/antigravity-plugin-mobile-remote.git
cd antigravity-plugin-mobile-remote
node scripts/install.mjs

默认安装到 ~/.gemini/config/plugins/mobile-remote(Windows 下为 %USERPROFILE%\.gemini\config\plugins\mobile-remote)。

卸载插件:

node scripts/install.mjs --uninstall

使用指南

  1. 打开桌面配对面板:

    • 在 Antigravity 右侧辅助面板点击 + 选择 手机远程(或从左侧导航栏进入);

    • 也可直接在任意对话中输入:打开手机远程访问面板并生成配对二维码。

  2. 局域网 / Tailscale 直连(同 Wi-Fi 零延迟):

    • 确保面板监听模式为「局域网直连」,直接用手机相机扫描二维码,或用手机浏览器访问面板显示的局域网地址并输入 6 位数字配对码。

    • 若 Windows 防火墙首次拦截 6879 端口,可在管理员终端放行:

      netsh advfirewall firewall add rule name="Antigravity Mobile Remote" dir=in action=allow protocol=TCP localport=6879
  3. 4G / 5G 外网远程连接(公网穿透):

    • 在面板「网络与公网穿透」卡片点击 🚀 开启公网隧道(默认免账号快速隧道,首次使用会自动按平台下载官方 cloudflared 二进制);

    • 如需跨重启永久固定域名,切换到 Cloudflare 固定域名 标签页填入 Tunnel Token 与自定义域名即可,后续网关重启会自动恢复隧道。


开发与验证

# 运行跨平台单元、WebSocket 与 MCP 端到端测试
npm test

# 运行全工作区与 Git 历史隐私/密钥泄漏审计
npm run audit:privacy

致谢与灵感来源

本项目在配对状态机、双平面安全边界与隧道守护设计上汲取了 DeepSeek Harness 开源社区优秀远程插件的设计思想,特此致谢:

  • zhu1090093659/dsh-web (@linxin666/dsh-remote-web-ui & @linxin666/dsh-remote-bridge)

  • lninghaha/dsh-coding-remote-kit

  • xiaosenho/dsh-plugin-remote-access

开源协议

MIT License

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables any MCP-compatible AI agent to ask humans questions in real time via a mobile-friendly PWA with push notifications, operating local-first without third-party services.
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      B
      maintenance
      Publishes a single self-hosted MCP endpoint that lets AI apps reach all of your machines through outbound-only device agents, so they can read, write, and run commands within permitted folders on each device with per-key access levels and folder/device scoping. Every allowed or denied call is checked against the app's key and recorded in an audit log, with support for HTTPS/tunnels and OAuth for web-based clients.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Lets an agent ask the user a question that lands on their phone and returns the reply inside the same tool call, plus send one-way notifications, clipboard text, files, and channel broadcasts. Works with Claude Code, Cursor, Windsurf, Gemini CLI, and any MCP client.
      489 npm
      Apache 2.0