Skip to main content
Glama
cocohahaha

wechat-local-mcp

by cocohahaha

wechat-local-mcp

一个只读的本地 MCP 服务,用来把你自己的 macOS 或 Windows 微信聊天变成可搜索、可提取待办的上下文。

它分成四层:

  1. 精确历史层:把已获得密钥的本地数据库解密成独立快照,再进行全文搜索和待办提取。

  2. 跨版本 UI 层:在数据库适配失效或尚无密钥时,用 macOS Vision 或 Windows.Media.Ocr 读取当前微信窗口。

  3. 媒体理解层:图片/截图使用本机 OCR;表情包读取消息说明和本地表情库;语音从 media_0.db 读取微信 SILK 并在本机转写;合并转发消息解压为分层 JSON。

  4. MCP 查询层:默认返回 JSON,不向微信发消息、不修改微信数据库。

这样微信升级时,只需要替换准备层;wechat_list_chatswechat_search_messageswechat_find_todos 等工具不需要跟着重写。

数据位置与版本兼容

wechat_status 会动态读取当前微信版本。聊天数据库通常位于:

~/Library/Containers/com.tencent.xinWeChat/Data/Documents/xwechat_files/<账号>/db_storage/

较新的 macOS 微信可能为每个数据库使用独立密钥,旧版“一个 key 解所有库”的工具不能直接复用。微信升级后,数据库结构或密钥派生方式仍可能变化。工具不会覆盖 /Applications/WeChat.app,也不会对日常微信做重签名。

Windows 微信 4.x 的账号数据通常位于“文档”目录下的 xwechat_files。如微信设置了自定义存储位置,可用 WECHAT_CONTAINER_DIR 指向 xwechat_files 本身或它的父目录。Windows 版优先提供不依赖数据库密钥的 UI/OCR 读取;已有明文快照仍可使用全部精确查询工具。

Related MCP server: wechat-msg-mcp

安全与隐私

  • 仓库不包含真实密钥、微信数据库、聊天导出、账号目录或本机虚拟环境。

  • MCP 服务自身不要求网络访问,只读取本机解密快照。

  • 图片、表情和语音内容不会上传;语音模型在本机运行。首次使用某个 Whisper 模型时会从 Hugging Face 下载模型文件。

  • 图片/截图 OCR、表情识别与语音转写会缓存为派生 JSON,默认位于 ~/Library/Application Support/wechat-local-vault/media-text/

  • 当 MCP 客户端把查询结果交给模型分析时,被选中的聊天内容会进入该客户端的模型上下文;请按所用客户端的隐私策略判断是否使用。

  • 密钥捕获脚本只应当用于你有权访问的本机微信账号。

  • keys.json 和明文快照默认保存在项目目录之外的用户配置目录中,并限制为仅当前系统账户可读;不要提交或分享它们。

安装

macOS

在本目录执行:

uv sync --extra keys --extra ui --extra media --extra test --python /opt/homebrew/bin/python3.12

查看状态:

uv run --python /opt/homebrew/bin/python3.12 wechat-local-sync status

Windows 10/11

安装 Python 3.11 或 3.12 与 uv,然后在 PowerShell 中运行:

uv sync --extra windows --extra media --extra test --python 3.12
uv run wechat-local-mcp --transport stdio

也可以直接运行 powershell -ExecutionPolicy Bypass -File scripts/install_windows.ps1 完成依赖安装和离线测试。

Windows UI 读取使用系统自带的 Windows.Media.Ocr,截图只存在于进程的临时目录,识别结束后自动删除,不调用云端 OCR。若诊断提示没有中文 OCR,请在“设置 → 时间和语言 → 语言和区域”中安装简体中文语言功能。

一次性准备密钥

如果你已有可用的 keys.json,放到:

~/.config/wechat-local-mcp/keys.json

格式是数据库相对路径(或文件名)到 64 位十六进制密钥的映射,例如:

{
  "contact/contact.db": "REPLACE_WITH_64_HEX_CHARACTERS",
  "message/message_0.db": "REPLACE_WITH_64_HEX_CHARACTERS"
}

如果没有 keys 文件,项目附带一个不改日常微信安装包的 Frida 辅助脚本。先安装可选依赖:

uv sync --extra keys --python /opt/homebrew/bin/python3.12

直接附加日常微信在部分 macOS 版本上会被系统拒绝。如果本机允许附加,可以退出并重新打开微信后运行:

uv run --python /opt/homebrew/bin/python3.12 python scripts/capture_keys.py \
  --pid "$(pgrep -x WeChat | head -1)" \
  --db-dir "$HOME/Library/Containers/com.tencent.xinWeChat/Data/Documents/xwechat_files/<账号>/db_storage"

这只把捕获到的派生 key 合并写入 ~/.config/wechat-local-mcp/keys.json,不会清除之前已捕获的有效 key。如果 macOS 报 task_for_pid 或权限错误,请使用专用副本:

zsh scripts/prepare_capture_copy.sh

退出日常微信后,用 --spawn "$HOME/Library/Application Support/wechat-local-mcp/WeChatKeyCapture.app/Contents/MacOS/WeChat" 运行捕获脚本。脚本会在微信启动时安装只读派生函数观察器;当前版本通常无需再次扫码。辅助副本放在应用支持目录中,避免被 macOS 当作第二个日常微信注册;脚本不会替你修改系统设置,也不会对日常使用的 /Applications/WeChat.app 重签名。

密钥捕获是一次性环境准备,当前微信版本或下次升级后可能需要重新做。不要把 keys.json、明文数据库或聊天导出文件提交到 Git。

截图快捷键或录屏权限异常

如果准备密钥后,微信的截图快捷键失效,或者系统设置中的“录屏与系统音频录制”权限反复丢失,常见原因是旧版脚本把辅助副本放在 ~/Applications:辅助副本与正式微信使用同一个 Bundle ID,但签名不同,macOS 的 LaunchServices/TCC 可能把两者误认为同一个应用,导致快捷键打开错误副本,或把录屏权限绑定到辅助副本的签名。

修复步骤:

  1. 完全退出正式微信和辅助副本。

  2. 把旧的 ~/Applications/WeChatKeyCapture.app 移到 $HOME/Library/Application Support/wechat-local-mcp/WeChatKeyCapture.app,或重新运行 scripts/prepare_capture_copy.sh

  3. 取消辅助副本的 LaunchServices 注册:

    LSREGISTER="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister"
    "$LSREGISTER" -u "$HOME/Library/Application Support/wechat-local-mcp/WeChatKeyCapture.app"
  4. 重置正式微信的录屏授权,然后重新打开正式微信:

    tccutil reset ScreenCapture com.tencent.xinWeChat
    open -a /Applications/WeChat.app
  5. 在系统设置的“隐私与安全性 → 录屏与系统音频录制”中重新允许微信,再测试微信截图快捷键。

新版 prepare_capture_copy.sh 会默认把辅助副本放在应用支持目录,并在创建后主动取消其 LaunchServices 注册,避免再次抢占正式微信。辅助副本仍可通过其可执行文件的绝对路径启动,不影响密钥捕获。

解密本地快照

建议先完全退出微信,再执行:

uv run --python /opt/homebrew/bin/python3.12 wechat-local-sync sync

默认输出到:

~/Library/Application Support/wechat-local-vault/decrypted/current/

也可以通过环境变量覆盖:

export WECHAT_CONTAINER_DIR="$HOME/Library/Containers/com.tencent.xinWeChat/Data/Documents"
export WECHAT_DECRYPTED_DIR="$HOME/Library/Application Support/wechat-local-vault/decrypted/current"
export WECHAT_KEYS_FILE="$HOME/.config/wechat-local-mcp/keys.json"

配置 MCP

以 stdio 方式添加到支持 MCP 的客户端:

{
  "mcpServers": {
    "wechat-local": {
      "command": "/绝对路径/outputs/wechat-local-mcp/.venv/bin/wechat-local-mcp",
      "args": ["--transport", "stdio"]
    }
  }
}

或直接运行:

uv run --python /opt/homebrew/bin/python3.12 wechat-local-mcp --transport stdio

Codex CLI 可直接注册:

codex mcp add wechat-local -- \
  "/绝对路径/outputs/wechat-local-mcp/.venv/bin/wechat-local-mcp" \
  --transport stdio

Windows PowerShell 示例:

codex mcp add wechat-local -- `
  "$PWD\.venv\Scripts\wechat-local-mcp.exe" `
  --transport stdio

响应格式

所有读取、搜索、汇总和待办工具默认使用 response_format="json"。响应同时包含:

  • JSON 文本内容,兼容只读取 MCP content 的客户端。

  • 原始对象形式的 structuredContent,方便支持结构化工具输出的客户端直接消费。

如需适合人工阅读的文本,可以显式传入 response_format="markdown";此时 structuredContent 仍会保留。

可用工具

  • wechat_status:检查微信版本、数据库、密钥与快照状态。

  • wechat_sync:按 keys.json 解密数据库到独立快照目录。

  • wechat_list_chats:列出联系人和群聊,支持分页。

  • wechat_read_chat:按昵称、备注、群名或微信 ID 读取消息,并自动理解图片、截图、表情包、语音及合并转发消息。

  • wechat_search_messages:按关键词、聊天和时间范围搜索普通消息及已自动转换的媒体文字。

  • wechat_recent_messages:汇总最近消息,并自动转换其中的图片、截图、表情包和语音。

  • wechat_find_todos:用可解释的中英文行动项启发式找待办候选。

  • wechat_chat_summary:自动转换媒体后返回参与者统计、待办候选和消息。

  • wechat_media_status:检查图片/表情缓存、本机 OCR、SILK 解码和离线 Whisper 是否就绪。

  • wechat_ui_diagnose:诊断屏幕录制/OCR 只读兜底。

  • wechat_list_recent_chats:数据库快照不可用时读取当前窗口可见会话。

  • wechat_read_chat_ui:数据库快照不可用时用本机 OCR 读取聊天。

  • wechat_find_todos_ui:对 OCR 结果做待办候选提取。

所有微信访问都是只读的;普通消息读取工具只在独立目录自动写入派生文字缓存。wechat_find_todos 只返回候选,不会替你创建任务、发消息或修改微信。

图片、截图、表情包、合并转发消息和语音

先准备最新明文快照并安装媒体依赖:

uv run --python /opt/homebrew/bin/python3.12 wechat-local-sync sync
uv sync --extra ui --extra media --python /opt/homebrew/bin/python3.12

直接调用原来的消息读取工具,无需先调用单独的媒体工具:

{
  "chat": "聊天名称",
  "limit": 50,
  "response_format": "json"
}

wechat_read_chatwechat_recent_messageswechat_chat_summary 遇到图片、截图、表情包或语音时会自动处理。识别成功后:

  • 消息的 content 直接变成图片/截图 OCR、表情说明或语音转写正文;

  • original_content 保留原来的 [图片][表情包][语音] 占位信息;

  • content_source 标识 image_ocrscreenshot_ocrsticker_recognitionvoice_transcript

  • message_kind 会区分 image、启发式的 screenshot_candidatestickervoice

  • media 保留引擎、模型、置信信息、分段和 cached 状态;

  • 无法识别时的具体原因,例如“图片未在本机缓存”。

wechat_search_messages 会同时搜索普通文本和这些自动生成的媒体文字缓存,不需要 Agent 选择另一套搜索工具。

截图在微信数据库里仍属于普通图片,因此 screenshot_candidate 是根据 OCR 文字密度和长宽比给出的可解释启发式分类,并非微信官方字段。表情包优先读取消息里的说明,其次查询本地 emoticon.db;若缓存文件是微信专有加密格式且没有说明,会返回 unavailable,不会联网下载或猜测含义。

类型 19 的合并转发/压缩聊天会返回 forwarded.items 数组。每个子项带 data_typekindsendertimecontent,以及可用的媒体摘要;支持文本、图片、语音、视频、文件、链接、位置、嵌套聊天、表情包、小程序和视频号等类型。最多展开 200 条,超出时设置 truncated=true

图片优先读取微信本机的高清/中图缓存,找不到时使用缩略图。若结果提示图片未缓存,请先在微信中打开一次原图。Apple Silicon macOS 默认使用 MLX Whisper;Windows、Linux 和 Intel macOS 使用 faster-whisper。可设置:

export WECHAT_WHISPER_MODEL=mlx-community/whisper-small-mlx
export WECHAT_FASTER_WHISPER_MODEL=small
export WECHAT_MEDIA_TEXT_DIR="$HOME/Library/Application Support/wechat-local-vault/media-text"

语音转写属于模型推断,可能出现漏字或误字,因此返回值固定带 review_required=true;重要内容仍应对照原语音确认。

macOS OCR 兜底需要:

uv sync --extra ui --python /opt/homebrew/bin/python3.12

并在系统设置中允许运行 MCP 的终端使用“屏幕与系统音频录制”。OCR 是当前屏幕的近似读取,长期历史、精确 sender 和全文搜索仍以数据库快照后端为准。

Windows OCR 兜底需要:

uv sync --extra windows --python 3.12

支持新版 Weixin.exe 和旧版 WeChat.exe。调用读取工具时应保持微信已登录、主窗口未最小化;工具可能把微信切到前台、打开指定聊天并向上滚动,但不会在输入框发送内容。OCR 是当前窗口的近似读取,长期历史、精确 sender 和全文搜索仍以数据库快照后端为准。

验证

uv run --python /opt/homebrew/bin/python3.12 pytest
uv run --python /opt/homebrew/bin/python3.12 wechat-local-sync status

Windows:

uv run pytest
uv run wechat-local-sync status

若没有明文快照,MCP 会返回下一步提示,不会把加密数据库误当成可读内容。

许可证与声明

本项目采用 MIT License

本项目是社区开发的非官方工具,与腾讯或微信团队无隶属或背书关系。“微信”和“WeChat”及相关标识属于其各自权利人。

Available Tools

12 tools
wechat_chat_summary汇总单个微信聊天A
Read-onlyIdempotent

返回指定聊天的消息量、参与者、行动项候选和最近消息,供模型进一步生成摘要。

ParametersJSON Schema
NameRequiredDescriptionDefault
chatYes
end_timeNo
start_timeNo
max_messagesNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only, idempotent, non-destructive behavior. The description adds context by specifying the data returned (message count, participants, action items, recent messages), which is beyond the annotations. However, it does not mention any potential limits or performance aspects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that efficiently conveys the tool's output and purpose with no wasted words. It is front-loaded with the key verb and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 parameters and no schema descriptions, the description is insufficient for an agent to use the tool effectively. It lacks details on how to specify time ranges or message limits. However, an output schema exists, which may explain return values. Overall, adequate but with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only implicitly mentions the 'chat' parameter ('指定聊天') but does not explain optional parameters like start_time, end_time, max_messages, or response_format. This provides minimal added meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool returns message count, participants, action items candidates, and recent messages for a specified chat, intended for model to generate a summary. It distinguishes from sibling tools like wechat_read_chat and wechat_search_messages by aggregating summary data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives like wechat_read_chat or wechat_search_messages. Usage is implied for generating a summary, but no when-not or exclusion criteria are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_find_todos从微信聊天中提取待办A
Read-onlyIdempotent

在最近 N 天的聊天文本中用可解释的中英文行动项启发式筛选待办候选;结果需要人工确认,不会自动创建任务或发送消息。

ParametersJSON Schema
NameRequiredDescriptionDefault
daysNo
chatsNo
limitNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark it as read-only and idempotent. The description adds transparency by noting it uses heuristic screening, requires manual confirmation, and does not create tasks or send messages. This provides behavioral context beyond annotations, though it omits details about parameter effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that conveys the core function and key constraint (manual confirmation). It is not verbose and front-loads the action. However, it could be expanded slightly to cover parameters or return values without becoming long.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 parameters with 0% schema coverage and an output schema present (which may document return values), the description should explain parameter usage (e.g., which chats are scanned, limit behavior). It only addresses 'days' indirectly. The tool's context is not fully specified, leaving gaps for effective invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. However, it only implicitly references the 'days' parameter ('最近N天') and entirely ignores 'chats', 'limit', and 'response_format'. No additional meaning is provided beyond the schema's field names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it extracts to-do candidates from recent WeChat chats using heuristic filtering, with specific verb '筛选待办候选' and scope '最近N天的聊天文本'. It also distinguishes from automatic task creation, differentiating it from similar tools like wechat_find_todos_ui.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for initial candidate extraction requiring human confirmation, but does not explicitly state when to use this tool versus alternatives like wechat_find_todos_ui or wechat_search_messages. No explicit when-not or exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_find_todos_ui从微信窗口提取待办A
Read-onlyIdempotent

对 OCR 读取到的当前聊天消息运行本地启发式待办提取;结果需要人工确认,不会写入任务系统。

ParametersJSON Schema
NameRequiredDescriptionDefault
chatYes
limitNo
min_scoreNo
scroll_pagesNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds significant behavioral context beyond annotations: it runs local heuristics, requires manual confirmation, and does not write to the task system. Annotations already indicate read-only and non-destructive behavior, and the description aligns perfectly while adding actionable nuance.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but omits crucial parameter information. While the core purpose is front-loaded, the lack of structure (e.g., lists or bullet points) reduces its utility. It prioritizes brevity over completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description does not explain return values despite the existence of an output schema, nor does it elaborate on the 5 parameters. It also fails to differentiate from closely related sibling tools like 'wechat_find_todos'. The tool's complexity (5 params, heuristics) demands richer context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explain any of the 5 parameters (chat, limit, min_score, scroll_pages, response_format). The agent cannot infer their meanings or defaults beyond basic schema types. This is a major gap for a tool with a required parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool extracts todos from OCR-read current chat messages using local heuristics. It specifies that results require manual confirmation and are not written to the task system. This distinguishes it from sibling tools like 'wechat_find_todos' (likely non-UI) and 'wechat_read_chat'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context: results are unconfirmed and not auto-committed. However, it does not explicitly state when to or not to use this tool, nor does it mention alternatives among siblings. The agent is left to infer appropriate use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_list_chats列出微信聊天A
Read-onlyIdempotent

列出明文快照中的联系人和群聊,支持关键词与 offset/limit 分页。

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryNo
offsetNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description adds context beyond annotations: it specifies the data source ('plaintext snapshot') and pagination behavior ('offset/limit'). Annotations already indicate read-only and idempotent, and description aligns with those. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no filler. Front-loaded with the core action and resource, followed by key features. Every word is informative and earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists, the description does not need to explain return values. It covers source, filtering, and pagination. However, it omits any limitations (e.g., max results) or error conditions. Still, for a read-only list tool, it is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so description must compensate. It explains '关键词' (keyword) for query, and 'offset/limit 分页' for pagination, covering three of four parameters. The 'response_format' parameter is not mentioned, leaving a gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states '列出明文快照中的联系人和群聊' (list contacts and group chats in plaintext snapshot), specifying the resource (chats) and scope (snapshot-based). It distinguishes from sibling 'wechat_list_recent_chats' by emphasizing 'snapshot' rather than recent data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus siblings like wechat_list_recent_chats. The description only lists capabilities without stating use cases or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_list_recent_chats从微信窗口列出最近聊天A
Read-onlyIdempotent

当明文数据库快照还未准备好时,用本机 OCR 读取当前微信窗口左侧可见的最近会话。不会修改界面内容以外的任何数据。

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnlyHint, destructiveHint, idempotentHint), the description discloses the OCR mechanism, UI-level reading, and guarantees no data modification beyond interface content. Full consistency with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: two sentences front-loading the condition and method, with zero redundancy. Every sentence provides essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the existence of an output schema, return values are not needed. The description covers the tool's behavior well but lacks parameter documentation. Considering tool complexity (OCR, UI interaction), it is mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description provides no information about the 'limit' or 'response_format' parameters. The schema defines defaults and types, but the tool description adds no semantic value for parameters, leaving the agent to infer from names alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool uses OCR to read recent chats from the current WeChat window when the database snapshot is not ready. It distinguishes itself from database-based siblings like wechat_list_chats and wechat_recent_messages by specifying the UI-based approach.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states the condition for use ('when the plaintext database snapshot is not yet ready'), implying that alternatives should be used otherwise. It does not name specific sibling tools but provides clear context for when this tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_read_chat读取微信聊天记录A
Read-onlyIdempotent

按联系人昵称、备注、群名或微信 ID 读取消息;可用 ISO-8601 时间范围和 limit 限制结果。

ParametersJSON Schema
NameRequiredDescriptionDefault
chatYes
limitNo
end_timeNo
start_timeNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the tool is safe and idempotent. The description adds context about filtering capabilities (time range, limit), which is helpful. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently communicates the main purpose and key filtering options. It is front-loaded and contains no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema and sibling tools, the description is minimal but adequate. It does not specify ordering, pagination, or behavior for missing chats. The presence of an output schema partially compensates for missing return value details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain parameters. It explains the 'chat' parameter can accept various identifiers, and mentions ISO-8601 for time parameters and limit. However, it does not explain the 'response_format' parameter. This provides moderate semantic value but is incomplete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool reads messages by contact nickname, remark, group name, or WeChat ID, with optional time and limit filters. This is specific about verb and resource, but it does not differentiate from sibling tools like wechat_search_messages or wechat_recent_messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as wechat_search_messages or wechat_recent_messages. The description only explains what the tool does without contextual usage advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_read_chat_ui从微信窗口读取可见聊天A
Read-only

用 OCR 打开指定聊天并读取最近可见/可滚动的消息。它是数据库快照不可用时的只读兜底,消息可能缺少精确时间戳和发送者识别。

ParametersJSON Schema
NameRequiredDescriptionDefault
chatYes
limitNo
scroll_pagesNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true. The description adds behavioral context: uses OCR, reads visible/scrollable content, may lack timestamps and sender identification. Does not contradict annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with no filler, front-loading the core purpose and usage context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values need not be explained. However, the description lacks parameter details entirely. For a complex OCR tool, this is a notable gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The tool description does not explain any of the four parameters (chat, limit, scroll_pages, response_format) beyond their names, leaving the agent uninformed about their meaning or usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool uses OCR to read visible messages from a chat and positions it as a fallback when database snapshots are unavailable, distinguishing it from sibling tools like wechat_read_chat.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says it's a read-only fallback for when database snapshots are unavailable, and warns about missing precision. This guides the agent on when to use it vs alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_recent_messages获取最近微信消息B
Read-onlyIdempotent

从指定聊天或全部聊天中按时间倒序返回最近消息。

ParametersJSON Schema
NameRequiredDescriptionDefault
chatsNo
limitNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds the specific behavioral detail that messages are returned in reverse chronological order, which is useful but not extensive. It does not mention pagination, rate limits, or edge cases, but the annotations cover safety profiles.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. It efficiently conveys the core purpose and scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (3 optional params, no required) and existence of an output schema, the description is minimally adequate. However, it omits parameter details for limit and response_format, and lacks any usage context or examples. It meets the bare minimum but is not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only clarifies the 'chats' parameter by mentioning 'specified chats or all chats'. The 'limit' and 'response_format' parameters are not described at all, leaving their purpose unclear without external knowledge.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns recent messages from specified chats or all chats in reverse chronological order. It uses a specific verb (返回) and resource (最近消息), and the scope is well-defined, distinguishing it from siblings like wechat_read_chat or wechat_search_messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as wechat_search_messages for filtered queries or wechat_read_chat for a single chat's full history. No when-to-use or when-not-to-use conditions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_search_messages搜索微信消息B
Read-onlyIdempotent

在全部聊天或指定聊天中搜索文本消息,支持时间范围、offset/limit 和 JSON/Markdown 输出。

ParametersJSON Schema
NameRequiredDescriptionDefault
chatsNo
limitNo
queryYes
offsetNo
end_timeNo
start_timeNo
response_formatNomarkdown

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, indicating a safe read operation. The description adds high-level features (time range, pagination, output format) but does not disclose additional behavioral details such as result ordering or limitations beyond default values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that front-loads the core action and scope. Every part adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 7 parameters, but the description only covers about half (time range, pagination, output format). With an output schema presumably present, return values are covered, but parameter coverage is incomplete, requiring the agent to rely on schema alone for missing aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions time range, offset/limit, and output format corresponding to parameters, but fails to explain the 'query' or 'chats' parameters or provide any format/semantics details. This is insufficient given the parameter richness.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies that the tool searches text messages in all or specific chats, with support for time range, pagination, and output formats. This effectively distinguishes it from sibling tools like wechat_find_todos or wechat_recent_messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide any guidance on when to use this tool versus alternatives. It only lists features, leaving the agent to infer appropriate usage without explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_status检查本地微信接入状态A
Read-onlyIdempotent

只读检查微信版本、加密数据库、密钥文件和明文聊天快照是否就绪。不会读取或返回聊天正文。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, destructiveHint. The description adds explicit statement that it does not read or return chat content, which is valuable beyond annotations. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first states action and components, second clarifies what it does not do. Both are concise and front-loaded. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool is simple with no parameters and has an output schema. Description covers what it checks and what it avoids, but could mention that it can be used as a prerequisite check before other WeChat tools. Still adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so description does not need to add parameter details. Baseline for 0 parameters is 4. Description is sufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The title is in Chinese but clearly means 'Check local WeChat access status'. The description specifies read-only check of version, DB, key file, and snapshot readiness. It distinguishes from chat-reading tools by stating it does not read chat content. Clearly defines verb and resource, and differentiates from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this is a safe, non-invasive check but does not explicitly state when to use it vs alternatives like wechat_ui_diagnose or wechat_list_chats. No 'when to use' or 'when not to use' guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_sync同步本地微信数据库快照B
Idempotent

将本机微信 db_storage 中有对应 64 位十六进制密钥的数据库,解密到独立的本地只读快照目录。不会修改微信源文件、不会发送消息。建议退出微信后执行。

ParametersJSON Schema
NameRequiredDescriptionDefault
key_fileNo
output_dirNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds behavioral details beyond annotations: it explains the tool decrypts to a read-only snapshot, does not modify source files, and does not send messages. This aligns with destructiveHint=false and idempotentHint=true. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences in Chinese, efficient but missing parameter details. It front-loads the core purpose, but the structure could be improved by adding parameter explanations in a clear format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (two optional parameters, no enums, output schema exists), the description only covers high-level purpose and safety. It fails to document input parameters, leaving the agent underinformed. Output schema exists but is not referenced, reducing completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has two parameters (key_file, output_dir) with 0% description coverage, and the tool description does not explain their meaning or format. Without any parameter guidance, an agent cannot correctly supply values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: decrypting a WeChat database with a 64-bit hex key into a local read-only snapshot. It specifies the resource (db_storage) and verb (decrypt/create snapshot), and distinguishes from siblings by focusing on local snapshot creation rather than reading or searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a recommendation (exit WeChat before execution) and states safety (no modifications, no messages), but does not explicitly state when to use this tool versus alternatives like wechat_read_chat or wechat_list_chats. The guidance is present but not comprehensive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wechat_ui_diagnose诊断微信 UI 只读兜底A
Read-onlyIdempotent

使用 macOS 截图和本机 Vision OCR 诊断微信主窗口是否可读。仅在安装 ui 可选依赖并授予屏幕录制权限后使用;不会发送、输入或保存截图。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnlyHint, idempotentHint, destructiveHint), the description discloses use of screenshots and OCR, non-persistence of data, and required permissions, adding valuable behavioral context without contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with action and resource, and every sentence provides essential information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless diagnostic tool with existing output schema and annotations, the description covers prerequisites, behavior, and safety guarantees comprehensively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the baseline is 4. The description correctly omits parameter details as none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: diagnosing whether the WeChat main window is readable using macOS screenshot and local Vision OCR. It distinguishes itself from sibling tools like wechat_read_chat_ui by being a diagnostic pre-check.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly mentions prerequisites (install ui optional dependency, grant screen recording permission) and assures no data is sent or saved. However, it does not explicitly guide when to use this tool versus alternatives like wechat_read_chat_ui.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 12 tool updatesv0.1.0
    • First observedwechat_chat_summary
    • First observedwechat_find_todos
    • First observedwechat_find_todos_ui
    • First observedwechat_list_chats
    • First observedwechat_list_recent_chats
    • First observedwechat_read_chat
    • First observedwechat_read_chat_ui
    • First observedwechat_recent_messages
    • First observedwechat_search_messages
    • First observedwechat_status
    • First observedwechat_sync
    • First observedwechat_ui_diagnose

TDQS

A3.7/5.0
Disambiguation4/5

Tools are mostly distinct, with clear separation between UI-based fallbacks and snapshot-based operations. However, pairs like wechat_list_recent_chats / wechat_list_chats and wechat_read_chat_ui / wechat_read_chat could cause confusion, though descriptions help clarify their intended use cases.

Naming Consistency3/5

All tools start with 'wechat_', but naming conventions are mixed: some use verb_noun (e.g., wechat_list_chats, wechat_search_messages), while others are noun-only (e.g., wechat_status, wechat_chat_summary) or adjective_noun (e.g., wechat_recent_messages). This inconsistency reduces predictability.

Tool Count5/5

With 12 tools, the server is well-scoped for a read-only WeChat assistant. Each tool serves a distinct purpose, covering status checks, sync, OCR fallbacks, listing, reading, searching, and summarization. No tool feels redundant or unnecessary.

Completeness4/5

The toolset provides comprehensive read coverage: listing chats, reading messages, searching, summarizing, and extracting todos. Missing features like retrieving detailed contact info or sending messages are likely intentional given the read-only nature. Minor gaps exist but do not hinder core functionality.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    B
    maintenance
    Provides AI clients read-only access to WeChat chat history by extracting and decrypting the local Mac database, enabling search, summary, and analysis of messages.
    -
  • A
    license
    A
    quality
    A
    maintenance
    A read-only MCP server that lets AI search and read both sides of a user's own LINE Desktop chat history on macOS using local database snapshots, without needing a LINE Official Account or altering unread state.
    6
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cocohahaha/wechat-local-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server