claudeers.
// MCP Servers

wechat-exporter

A Claude Code / Codex skill to export and decrypt WeChat (macOS) chat history into plaintext SQLite databases

// MCP Servers[ api ][ web ][ claude ]#claude#mcp-servers$open-sourceupdated 25 days ago
Actively maintained
95/100
last commit 26 days ago
last release none
releases 0
open issues 0
// star history

Install with your AI

Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.

Install and set up wechat-exporter (claude-skill project) into my current project.
Found on https://claudeers.com/wechat-exporter
Repo: https://github.com/robbin/wechat-exporter
Homepage/docs: —
Detected install method: claude-skill → # copy this skill into .claude/skills/wechat-exporter/
Category: mcp-servers. Platforms: api, web.
Read the repo's README for exact setup and env vars, then install it and wire it into my project.

Claudeers Health Verdict:
active; community-verified: false. Confirm the source before running anything.
// or install directly (claude-skill)
# copy the skill dir into your project:
# .claude/skills/wechat-exporter/   (or ~/.claude/skills/wechat-exporter/ for all projects)
// or clone
git clone https://github.com/robbin/wechat-exporter

// compatibility

Platformsapi, web
Operating systems
AI compatibilityclaude
License
Pricingopen-source
Language

wechat-exporter

一个 Claude Code / Codex 技能(Skill),用于将 macOS 微信桌面端的本地聊天记录全量导出为明文 SQLite 数据库。

它能做什么

  • 自动安装所需依赖(sqlcipher、Python 虚拟环境等)
  • 对微信客户端进行重签名,从内存中提取数据库加密密钥
  • 解密全部聊天记录数据库(联系人、消息、会话等)
  • 输出为标准 SQLite 明文数据库,可直接用任何 SQL 工具查询
  • 注册为 MCP Server,解密后可在 Claude Code 中直接查询聊天记录

前置条件

条件说明
macOS仅支持 macOS 系统
微信桌面端需要已安装并登录微信 Mac 版
聊天记录已备份到电脑在手机微信中将聊天记录迁移/备份到 Mac 端
Claude Code 或 Codex用于运行本技能
终端完全磁盘访问权限系统设置 → 隐私与安全性 → 完全磁盘访问权限 → 添加你的终端

快速开始

1. 安装技能

将技能添加到你的 Claude Code 技能目录。以下两种方式任选其一:

# 方式一:直接复制文件
cp SKILL.md ~/.claude/skills/wechat-exporter.md

# 方式二:创建目录(适合后续扩展)
mkdir -p ~/.claude/skills/wechat-exporter
cp SKILL.md ~/.claude/skills/wechat-exporter/skill.md

以上示例为全局安装(所有项目可用)。如需项目级安装,将 ~/.claude/skills/ 替换为 <你的项目>/.claude/skills/

2. 运行

在 Claude Code 中输入:

导出微信聊天记录

或直接调用技能名:

/wechat-exporter

技能会一步步引导你完成整个过程,包括:

  1. 安装系统依赖(brew install sqlcipher
  2. 下载并编译密钥扫描工具
  3. 对微信进行重签名(需要 sudo
  4. 提取数据库加密密钥(需要 sudo,需手动在终端执行)
  5. 解密所有聊天数据库
  6. 输出导出摘要

3. 导出结果

解密后的数据库存放在 ~/wechat-decrypt-macos/decrypted/

decrypted/
├── contact/
│   └── contact.db          # 联系人
├── message/
│   ├── message_0.db        # 消息分片(按时间段切割)
│   ├── message_1.db
│   └── ...
├── session/
│   └── session.db          # 会话列表
└── ...

所有数据库均为标准 SQLite 格式,可以用 sqlite3、DB Browser for SQLite 等任何工具直接查询。

数据库结构

联系人(contact.db)

contact 表中 local_type 字段含义:

local_type含义
1真实好友(双向添加)
3有过消息往来但未必是好友
0服务号、系统通知

消息分片(message_*.db)

消息按时间段分片存储,message_0.db 通常是最近一年的主力库。每个联系人的消息存储在独立的 Msg_<md5> 表中,<md5> 为联系人 username 的 MD5 哈希值。

可通过 Name2Id 表建立 username 到表名的映射:

import hashlib, sqlite3

conn = sqlite3.connect("message_0.db")
for (username,) in conn.execute("SELECT user_name FROM Name2Id"):
    table = "Msg_" + hashlib.md5(username.encode()).hexdigest()
    print(f"{username}{table}")

工作原理

手机微信 ──备份──→ Mac 微信桌面端(加密 SQLCipher 数据库)
                         │
                    重签名微信 App
                         │
                    内存扫描提取密钥
                         │
                    SQLCipher 解密
                         │
                         ▼
                   明文 SQLite 数据库 ──→ 自由查询 / MCP Server

核心依赖了以下两个开源项目:

常见问题

问题处理方式
HMAC 验证失败config.json 指向了错误的账号目录,重新确认当前登录账号
0/N keys found微信版本更新后需重签名 + 重新扫描密钥
lldb attach 失败微信未重签名,执行 sudo codesign --force --deep --sign - /Applications/WeChat.app
解密后消息为空检查 server.py 是否已按技能说明修改为读取明文数据库

注意事项

  • 提取密钥需要 sudo 权限,技能会提示你手动在终端执行
  • 微信每次更新版本后需要重新签名并重新提取密钥
  • 导出的数据仅保存在本地,请妥善保管

致谢

License

MIT

// faq

What is wechat-exporter?

A Claude Code / Codex skill to export and decrypt WeChat (macOS) chat history into plaintext SQLite databases. It is open-source on GitHub.

Is wechat-exporter free to use?

wechat-exporter is open-source, so it is free to use.

What category does wechat-exporter belong to?

wechat-exporter is listed under mcp-servers in the Claudeers registry of Claude-compatible tools.

1 views
203 stars
unclaimed
updated 25 days ago

// embed badge

wechat-exporter on Claudeers
[![Claudeers](https://claudeers.com/api/badge/wechat-exporter.svg)](https://claudeers.com/wechat-exporter)

// retro hit counter

wechat-exporter hit counter
[![Hits](https://claudeers.com/api/counter/wechat-exporter.svg)](https://claudeers.com/wechat-exporter)

// reviews

// guestbook

0/500

// related in MCP Servers

🔓

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete…

// mcp-serversf/HTML167,135NOASSERTION[ claude ]
🔓

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io

// mcp-serversfarion1231/Rust127,274MIT[ claude ]
🔓

An open-source AI agent that brings the power of Gemini directly into your terminal.

// mcp-serversgoogle-gemini/TypeScript106,524Apache-2.0[ claude ]
🔓

🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman

// mcp-serversJuliusBrussee/JavaScript100,343MIT[ claude ]
→ see how wechat-exporter connects across the ecosystem