让 Codex 秒级、低 token、安全地读写 macOS 微信 | Fast, token-efficient WeChat bridge for Codex
WeChat FastBridge for Codex
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
中文说明
Send and read macOS WeChat messages from Codex in seconds, without feeding screenshots or full accessibility trees into the model.
WeChat FastBridge combines:
- a local STDIO MCP server with six semantic tools: status, read, text send, media send, chat wait, and allowlisted inbox wait;
- a bundled Intel + Apple Silicon native bridge that uses macOS Accessibility APIs;
- a thin Codex skill that selects the fast path and falls back to Computer Use only when necessary.
No cloud relay, OpenAI API key, WeChat protocol reverse engineering, process injection, App Store account, Xcode install, or paid service is required.
Version 1.7.1 makes the existing context system more selective without shrinking its memory or removing any tool. When semantic retrieval finds useful evidence, it returns that evidence plus recent continuity without padding the requested maximum with unrelated lines. Sender labels no longer create false lexical matches, and whitespace/full-width-colon variants align as the same old bubble instead of being retransmitted. Generic messages still receive the full requested continuity depth; the fact capsule, conflict handling, inbox behavior, media, and routing are unchanged.
Performance targets
- Local semantic bridge budget: **under 2 seconds** before WeChat UI response time.
- Measured real optimized selected-chat send: **1.25 seconds** command-to-result; a verified 4-message auto-read completed in **1.38 seconds**.
- Measured v1.4 media sends in the authorized Jerry self-chat: **2.97 seconds** for a tiny file, **6.02 seconds** for a favorite sticker slot, and **8.57 seconds** for a searched sticker.
- v1.7.1 tool definitions remain **49% smaller** than the original baseline (5,624 → 2,849 characters) and **21% smaller** than v1.5. Triggered skill instructions are **4,024 bytes**, including the adaptive-context rule. Repeated favorite-sticker sending remains **3.78 seconds cached** versus **6.78 seconds cold**.
- Cold setup/check: **under 5 seconds** on a supported Mac.
- Normal read result: **under 2,000 characters**.
- Repeated reads: **zero messages when unchanged**; when changed, return only new messages plus 0–4 context lines, treating that number as a maximum rather than a padding target.
- Allowlisted inbox baseline/timeout: **50 JSON characters** in the measured two-chat test; internal scans do not enlarge the result.
- Computer Use fallback: **at least 80% smaller** than the raw accessibility tree on the bundled representative fixture.
- Runtime footprint: **under 288 KiB** for the bridge, skill, setup scripts, and universal native binary, enforced by tests. The normal install keeps a two-dependency ceiling.
Every result includes measured latency. The test suite fails if the mocked local bridge overhead exceeds two seconds; real WeChat timings are reported separately in docs/BENCHMARKS.md.
Requirements
- macOS 13 or newer
- WeChat for Mac (com.tencent.xinWeChat)
- Node.js 20 or newer
- Codex desktop, CLI, or IDE extension
- macOS Accessibility permission for the app that runs Codex
The included Dockerfile exists only so MCP registries can start the stdio server and inspect its tool schemas. The container reports MACOS_REQUIRED for runtime checks; real WeChat reading and sending still require macOS, WeChat Desktop, and Accessibility permission.
If you can copy and paste four commands, you can install it. See the child-friendly setup guide for every click and permission switch.
Install
Or download the repository and double-click install.command.
Restart Codex after setup. Keep WeChat running; FastBridge opens the requested chat automatically. Then ask:
The setup script only builds local configuration. It does not charge money, open a subscription, or publish anything.