Skip to main content
Glama

Agent Chat Bridge (xchat)

通过直接复制对话 ID 或链接,让 Antigravity (AGY / Gemini)、Codex (Desktop / CLI) 与 Cursor (IDE / CLI) 互读本地会话上下文与完整工具调用轨迹,彻底省去跨工具协作、盲审挑错或换窗交接时的手动复制粘贴。

  • 零第三方依赖:纯 Python 标准库实现(Python >= 3.9),同时提供 CLI (xchat)、原生 Stdio MCP Server 与 三端共享 Skill。

  • 无需手打前缀标签:直接粘贴裸 UUID(如 f47ac10b-58cc-4372-a567-0e02b2c3d479)自动跨三端反查定位;连贴多个 ID 也能一次性拆解读取。

  • 默认保留工具执行轨迹 (trace):除问答正文外,默认保留中间态推进思考(Commentary)、每一次工具调用命令/读写行号/Diff 补丁,并自动高亮放大非零退出码与报错栈 (⚠️),专为「让 Agent B 审查 Agent A 哪一步犯傻/漏看文件/忽略报错」设计。

  • 纯只读零锁竞争:所有本地 SQLite 库均以 file:...?mode=ro 只读打开,不阻塞正在运行的客户端。


30 秒安装

git clone https://github.com/WeltPRICKETT/agent-chat-bridge.git
cd agent-chat-bridge
python3 scripts/install.py

install.py 会自动完成三件事(幂等,保留已有 MCP 配置,支持 --client agy|codex|cursor 单独安装或 --uninstall 干净卸载):

  1. 软链全局命令 ~/.local/bin/xchat(及别名 agent-chat);

  2. 将 agent-chat-bridge Stdio MCP Server 注册到 AGY(~/.gemini/config/mcp_config.json)、Codex(~/.codex/config.toml)与 Cursor(~/.cursor/mcp.json);

  3. 部署三端共享 Skill(~/.agents/skills/、~/.gemini/config/skills/、~/.codex/skills/、~/.cursor/skills/),即使当前旧窗口尚未重载 MCP 也能直接走 CLI 无缝生效。

可选建议:若希望粘贴**纯裸 UUID(不带任何文字说明或标签)**也能 100% 自动触发,可在全局规则(如 ~/.codex/AGENTS.md、~/.gemini/GEMINI.md)追加一句: 当用户粘贴裸 UUID 或 codex://threads/<id>、conversation://<id> 时,默认视为跨端会话 ID,直接调用 agent-chat-bridge MCP 或 ~/.local/bin/xchat 读取上下文。


Related MCP server: memgrep

日常怎么用

1. 在任意 Agent 对话框里直接贴 ID

不用记命令,复制出来的链接或裸 ID 是什么样就原样贴进去:

  • 纯裸 UUID(Cursor / AGY 直接复制出的格式): f47ac10b-58cc-4372-a567-0e02b2c3d479 帮我看看它哪一步改错了

  • 多条裸 ID 连贴对比: 对比 f47ac10b-58cc-4372-a567-0e02b2c3d479。a1b2c3d4-e5f6-4789-abcd-ef0123456789 两边的方案

  • 协议链接或显式前缀(中英文冒号均可): codex://threads/01960000-0000-7000-8000-000000000001、agy:a1b2c3d4-...、cursor: f47ac10b-...

  • 不复制 ID 直接读最新一条: 读一下 codex:latest / cursor:latest / agy:latest

2. 终端 CLI (xchat) 常用命令

# 默认 trace 模式:读取完整执行轨迹(用户指令 + 中间思考 + 工具命令/Diff + 精炼回显与完整报错栈)
xchat f47ac10b-58cc-4372-a567-0e02b2c3d479

# 查看紧凑轮次与工具步数大纲(含每轮中间工具调用次数与 ⚠️ 报错雷达)
xchat outline f47ac10b-58cc-4372-a567-0e02b2c3d479

# 仅看纯问答结论(隐藏中间工具过程)
xchat f47ac10b-58cc-4372-a567-0e02b2c3d479 --dialogue

# 按步骤区间切片 + 查看未经摘要的原始全量工具输出
xchat f47ac10b-58cc-4372-a567-0e02b2c3d479 --turns 5-15 --full --max-chars 0

# 跨三端列出最近会话 / 关键词全文搜索 / 读取 AGY 附加产物 / 健康自检
xchat recent -s all -n 15
xchat search "auth token" -s codex
xchat artifact <agy-uuid> implementation_plan.md
xchat doctor

本地存储覆盖矩阵

平台

自动覆盖的本地存储源

关键清洗与增强处理

Antigravity (AGY)

~/.gemini/antigravity、antigravity-cli、antigravity-ide

自动读取 transcript_full.jsonl 解决 transcript.jsonl 长回复截断;解码 annotations/*.pbtxt 八进制中文标题;1:1 配对工具调用与回显;支持读取 brain/<id>/ 下的 Artifacts 及 SQLite 兜底

Codex

~/.codex/state_5.sqlite、sessions/**/*.jsonl、archived_sessions/*.jsonl(.zst)、thread_history_1.sqlite

O(1) 索引定位;自动解压 .jsonl.zst 历史归档;剥离 # AGENTS.md 等万字系统注入;完整提取 CommandExecution、FileChange Diff、McpToolCall、SubAgentActivity 与 ContextCompaction 失忆点

Cursor

~/.cursor/projects/*/agent-transcripts/、IDE globalStorage/state.vscdb、~/.cursor/chats/ CLI

支持 macOS / Linux / Windows 路径;主键/GLOB 毫秒级查询 state.vscdb 实时气泡(解决新开窗口或 Ask 模式未落盘 .jsonl 时读不到的问题)


MCP 工具清单 (xchat mcp)

工具名

作用

read_conversation

按裸 UUID、多 UUID 串、URI 或 latest 读取会话(mode: trace 默认 / dialogue / outline / full,支持 turns、tail、max_chars、include_artifacts)

list_recent_conversations

跨 all / agy / codex / cursor 列出最近更新的本地会话(支持 workspace 过滤)

search_conversations

跨三端标题与正文关键词检索

read_conversation_artifact

列出或读取 AGY 会话关联的 Artifact 文档


English Quickstart

Agent Chat Bridge (xchat) lets Antigravity (AGY), Codex, and Cursor read each other's local conversation history and full tool-execution traces simply by pasting a conversation UUID or link — zero manual copy-paste, zero third-party dependencies (Python >= 3.9 stdlib only).

git clone https://github.com/WeltPRICKETT/agent-chat-bridge.git
cd agent-chat-bridge
python3 scripts/install.py          # Installs ~/.local/bin/xchat + Stdio MCP + Skills for AGY, Codex & Cursor
python3 -W error -m unittest discover -s tests -v

Once installed, paste any bare UUID (f47ac10b-58cc-4372-a567-0e02b2c3d479), codex://threads/<id>, conversation://<id>, or codex:latest into AGY, Codex, or Cursor. By default (mode="trace"), it returns user prompts, intermediate commentary, exact tool calls/diffs, and error-highlighted tool results (⚠️) with prompt-injection reference guards.

License

MIT

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 AI coding agents to read each other's conversation history read-only and sanitized, so you can continue work across different tools without re-explaining context.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to search and retrieve past chat transcripts from Cursor, Claude Code, and Kiro, providing a global, local memory for context-aware assistance.
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding agents to collaborate on the same project by sharing session briefs and reading each other's native transcripts, memories, and instructions in place, with zero-copy, across different agent tools.
      13 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Lets coding agents like Codex, Cursor, and Claude Code share and resume each other's chats, and attach to a common task with saved notes that can be searched later. This keeps task state and decisions in sync no matter which agent you switch to.
      70 npm
      3
      MIT