Skip to main content
Glama

wechat-sync-kit

本地优先的微信数据采集与项目信号工具包,将 MCP Server (wechat-sync-mcp) + CLI (wechat-sync) + Agent Skill (skill/SKILL.md) 整合在同一仓库中,直接对接开源 im-mcp(MIT License)完成本机微信群的定时同步、项目风险/截止/行动提取与可播放语音归档。

核心能力

  • 全自动 im-mcp 同步链路:对接 im-mcp 运行时执行 decrypt_all -> WAL 回退校验 -> database.sync_data -> PRAGMA quick_check -> project.db 增量入库,完整记录发言人名称 (sender)、sender_id、is_self 与复核状态 (pending/reviewed/dismissed)。

  • 标准 MCP Server (wechat-sync-mcp):支持 Claude Code / Codex 直接通过 stdio 接入,提供 7 个工具:

    • get_sync_status

    • refresh_wechat_signals

    • list_tracked_projects

    • get_project_signals

    • add_or_update_tracked_group

    • mark_signal_status

    • export_session_chat

  • 零依赖离线 HTML 看板 + signals.json:每次同步自动原子写入权限为 0600 的 board.html(离线可交互)和标准化 signals.json(可直接被 claude-command-board 消费)。

  • 单会话聊天 + 原声语音导出:支持 SILK (pilk) 与微信 4.x OPUS_RAW_V1(系统 libopus),生成内嵌 <audio> 播放器的 HTML、TXT、CSV(防公式注入)与 summary.json,绝不擅自上传或自动转写。

Related MCP server: WeChat History MCP

快速开始

1. 安装依赖与 Skill

python3 -m venv .venv
source .venv/bin/activate
pip install -e .
# 如需语音解码与 im-mcp 运行时依赖:
pip install -e ".[all]"

# 软链安装 Skill 到 ~/.claude/skills 与 ~/.codex/skills
chmod +x install.sh && ./install.sh

2. 零隐私 Demo 快速体验

无需微信密钥即可生成脱敏样例、signals.json 与交互式 board.html:

wechat-sync --root /tmp/wechat-sync-demo demo
open /tmp/wechat-sync-demo/board.html

3. 对接 im-mcp 同步真实工作群

  1. 先使用上游 im-mcp 在本机完成授权密钥获取,将 keys.json 放入受保护目录(权限 0600)。

  2. 初始化工作区并配置 projects.json(格式见 examples/projects.example.json):

export WECHAT_SYNC_ROOT="$HOME/Library/Application Support/WeChat Sync Kit"
export WECHAT_IM_MCP_SRC="/path/to/im-mcp/src"

wechat-sync init-config
wechat-sync add-group --group-id "10000000001@chatroom" --group-name "核心项目群" --project "示例项目"
wechat-sync refresh --days 7

4. 接入 Claude Code / Codex MCP

参考 mcp/mcp-config.example.json 将 wechat-sync-mcp 加入宿主 MCP 配置:

{
  "mcpServers": {
    "wechat-sync": {
      "command": "/path/to/.venv/bin/wechat-sync-mcp",
      "env": {
        "WECHAT_SYNC_ROOT": "/Users/<you>/Library/Application Support/WeChat Sync Kit",
        "WECHAT_IM_MCP_SRC": "/path/to/im-mcp/src"
      }
    }
  }
}

隐私与安全边界

  • 纯本地运行:不向任何云端或第三方 API 发送聊天记录、语音或密钥。

  • 敏感文件隔离:.gitignore 默认拦截 *.db、*keys*.json、projects.json、signals.json、board.html;运行时目录权限为 0700,产物文件权限为 0600 且使用原子替换写入。

  • 诚实汇报缺口:若底层 im-mcp 发生 WAL 合并回退,状态会自动标为 部分 WAL 回退 并在看板与 status.json 中显式告警。

开源致谢与关联项目

License

MIT

Available Tools

8 tools
add_or_update_tracked_groupC

Add a WeChat group to projects.json or update its project mapping.

Inputs: group_id (required), group_name (required), project_name (required), root. Returns: object

discover_wechat_groupsC

Discover all available WeChat group chats from the local im-mcp snapshot so users can select or track all.

Inputs: days, root, app_db, keys_file, +1 more. Returns: object

export_session_chatC

Export a WeChat session into HTML/TXT/CSV with playable WAV voice messages (never auto-transcribes).

Inputs: app_db (required), out_dir (required), session (required), end_date (required), +4 more. Returns: object

get_project_signalsC

Query extracted project signals (blockers, deadlines, actions, milestones) with speaker attribution.

Inputs: days, kind, root, limit, +4 more. Returns: object

get_sync_statusC

Return current local workspace sync health, WAL fallback count, tracked group count, and output file paths.

Inputs: root. Returns: object

list_tracked_projectsB

List configured tracked WeChat groups and their mapped project names.

Inputs: root. Returns: object

mark_signal_statusC

Update a signal's triage status (pending, reviewed, dismissed).

Inputs: uid (required), status (required), root. Returns: object

refresh_wechat_signalsC

Refresh WeChat project signals via im-mcp (decrypt -> WAL check -> ETL -> project.db -> signals.json + board.html).

Inputs: days, root, app_db, keys_file, +2 more. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 8 tools

    Disambiguation4/5

    Each tool has a distinct verb+resource target: status reads, ETL refresh, group discovery, tracked-group listing, signal querying, config writes, triage updates, and export. The only mild overlap is between discover_wechat_groups (available groups from snapshot) and list_tracked_projects (configured groups), but the descriptions make the snapshot-vs-config distinction clear.

    Naming Consistency5/5

    All eight tools use consistent snake_case verb_noun naming (get_*, refresh_*, discover_*, list_*, add_or_update_*, mark_*, export_*). The compound 'add_or_update_tracked_group' is a minor stylistic deviation but remains predictable and readable.

    Tool Count5/5

    Eight tools is well within the ideal 3-15 range and each maps to a distinct stage of the sync/triage/export workflow. No tool feels redundant or like filler.

    Completeness4/5

    The surface covers discovery, configuration, ETL refresh, status, signal querying/triage, and export, which is strong lifecycle coverage for this domain. The notable gap is the absence of a remove/untrack operation for tracked groups (add_or_update exists but no delete), and there is no explicit transcription trigger, though the export description suggests that is intentional.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to read the local, already-logged-in WeChat account's chat history: fetch recent messages per contact for reply suggestions, bulk-export all conversations into a local SQLite index for full-text and semantic search, and export media or Moments timelines as offline HTML. Everything runs locally and read-only on macOS, exposing 15 MCP tools plus a matching CLI.
      1
      GPL 3.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to search locally synchronized WeChat group and private chats, read images, voice messages, and documents, and extract project-relevant context with message-level citations.
      3
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to list permitted WeChat group chats, fetch cleaned message histories by cursor or time window, search messages with context, and export decrypted group media through a read-only offline MCP stdio interface.
      5
      MIT