Skip to main content
Glama
codex-wechat-bridge

codex-wechat-bridge

by dd814

Codex ↔ WorkBuddy 微信桥接

通过 WorkBuddy 已连接的「微信助理」,在个人微信里列出、选择并继续本机现有的 Codex 聊天。桥接器是一个本地 MCP stdio 服务;它不直接登录微信,也不读取微信凭证。

能做什么

  • 列出最近 20 条 Codex 聊天,按编号选择其中一条。

  • 查看所选聊天的状态,向同一个聊天 ID提交消息并读取文字回复。

  • 当另一进程占用该聊天的写入权时,明确返回 writer_busy;不会改发其他聊天或创建副本。

目前不能主动向个人微信推送后台事件。Codex 的权限请求也可能需要在桌面端处理。WorkBuddy 的助理模型可能改写用户消息,因此发送重要指令后应核对实际提交内容。

Related MCP server: claude-channel-weixin

环境

  • Windows 上的 WorkBuddy「微信助理」已由用户自行连接,并支持自定义 MCP 服务。

  • 本机可运行、已登录的 Codex CLI(支持 codex app-server)。

  • Python 3.10 或更新版本;桥接器仅使用标准库。

  • 电脑和 WorkBuddy 保持运行及联网。

安装

克隆或下载此仓库,在 WorkBuddy 的自定义 MCP 配置中添加一个 stdio 服务。Windows 示例(将路径换成你自己的安装位置):

{
  "mcpServers": {
    "codex-wechat-bridge": {
      "type": "stdio",
      "command": "py",
      "args": ["C:/path/to/codex-workbuddy-wechat-bridge/src/codex_wechat_bridge.py"],
      "description": "在微信助理中列出、选择和继续本机 Codex 聊天",
      "disabled": false
    }
  }
}

如果 codex 不在 PATH,设置环境变量 CODEX_BRIDGE_CODEX_EXE 为 codex.exe 的绝对路径。若 Codex 使用非默认数据目录,设置 CODEX_HOME。配置后在 WorkBuddy 中启用这四个工具:codex_list_tasks、codex_select_task、codex_task_status、codex_send_task。

在微信助理中发送「Codex任务」,收到编号列表后回复编号,再明确说明「发给 Codex:……」。桥接器只接收 WorkBuddy 调用工具时传入的消息。

本地数据与发布安全

选中的聊天 ID 保存在用户级状态目录中:Windows 的 %LOCALAPPDATA%/codex-workbuddy-wechat-bridge/state.json,其他系统的 $XDG_STATE_HOME/codex-workbuddy-wechat-bridge/state.json(未设置时为 ~/.local/state/...)。可用 CODEX_WECHAT_BRIDGE_STATE_DIR 改变位置。不要把此状态文件、WorkBuddy 配置、Codex 会话文件、日志或微信凭证提交到公开仓库。

本仓库采用文件白名单式 .gitignore,只允许公开的源码和文档进入 Git。发布前还应检查待提交文件和提交作者元数据。GitHub 的 secret scanning 主要识别凭证,不能代替姓名、邮箱、聊天标题和本机路径的人工审查。

验证

py -m unittest discover -s tests -v 验证 MCP 握手与工具清单,不向任何 Codex 聊天发送消息。完整微信链路需在自己的设备上使用无敏感内容的测试消息验证。

许可

MIT。见 LICENSE。

Available Tools

4 tools
codex_list_tasksA

列出本机 Codex 聊天任务,给微信用户展示编号和标题。用户说‘Codex任务’或‘列出Codex聊天’时调用。

Inputs: no named parameters.

codex_select_taskA

按刚列出的编号选择一个 Codex 聊天任务,后续消息进入该任务。仅按用户明确指定的编号调用。

Inputs: number (required).

codex_send_taskA

将微信用户明确写给当前选中 Codex 任务的原文发送到 Codex,等待最多90秒返回结果。不要自行改写、添加指令或自动批准权限。

Inputs: message (required).

codex_task_statusA

读取当前选中 Codex 任务的最新运行状态。用户说‘查状态’时调用。

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct action in the workflow: list tasks, select a task, check status, send a message. There is no overlap in purpose, and the descriptions clearly indicate when to use each.

    Naming Consistency4/5

    All tools share the codex_ prefix and snake_case, with mostly verb_noun patterns (list_tasks, select_task, send_task). Only codex_task_status deviates slightly by leading with the noun rather than a verb.

    Tool Count5/5

    Four tools is well-scoped for a lightweight WeChat-to-Codex bridge; each tool corresponds to a discrete step and none feels redundant or missing.

    Completeness4/5

    The surface covers the core lifecycle: discover tasks, bind to one, monitor status, and send input. Minor gaps exist (e.g. no way to cancel, close, or create a new task), but the essential bridge workflow is intact.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude Code to read encrypted WeChat chat history from local database, search messages, view sessions and contacts.
      4
      45 PyPI
      19
      Do What The F*ck You Want To Public
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude Code to receive and reply to WeChat messages via the WeChat iLink Bot API, using long-polling without requiring a public webhook.
      24 npm
      568
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Enables listing and continuing conversations from Claude Code, Codex, Cursor, and GLM, allowing context handoff between tools by providing historical transcripts as context.
      5
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables compatible AI assistants to operate Linux WeChat through local stdio, including contact and group search, bounded message history retrieval, private and group text sending, shared service lifecycle management, capability discovery, and persistent idempotent deduplication.
      2
      16 npm
      1
      MIT