Skip to main content
Glama
deadmau5v

wecom-msg-audit-mcp

by deadmau5v

wecom-msg-audit-mcp

企业微信会话内容存档 MCP 服务:拉取、解密并查询聊天记录,让 AI Agent 拥有合规可审计的会话访问能力。

Python FastMCP License: MIT


特性

  • 🔌 MCP 协议:基于 FastMCP 暴露工具,兼容 Cursor、Claude Desktop、Cline 等 MCP 客户端

  • 🔐 完整解密链路:封装企业微信官方 libWeWorkFinanceSdk_C.so,自动处理 RSA 私钥解密 + SDK 对称解密

  • 📨 多种消息类型:支持文本、图片、视频、语音、文件、链接、位置、名片、表情、视频号、混排等

  • 🗂️ 本地检索:解密结果持久化为 JSONL,支持按群、发送者、消息类型、关键词查询与分页

  • 👥 群资料查询:自动识别内部群 / 外部客户群,补全群名称、成员列表

  • ☁️ 媒体上传:图片自动上传到 Cloudflare R2 并返回预签名链接(其他文件保存到本地)

  • 🛡️ Bearer 鉴权:内置 Token 校验,支持 stdio / http 两种传输

Related MCP server: wechat-mcp

架构

┌────────────────────┐
│  MCP 客户端         │
│  (Cursor / Claude) │
└─────────┬──────────┘
          │ MCP (stdio / http + Bearer)
          ▼
┌────────────────────┐
│  mcp_server.py     │  FastMCP 工具定义
└─────────┬──────────┘
          │
          ▼
┌────────────────────┐
│  wecom_core.py     │  配置 / 业务逻辑
└─────────┬──────────┘
          │ ctypes
          ▼
┌────────────────────┐    ┌──────────────┐
│  libWeWorkFinance  │◄──►│  企业微信 API │
│  SDK_C.so (官方)    │    └──────────────┘
└────────────────────┘

快速开始

1. 前置条件

拉取会话内容需要先在企业微信管理后台(work.weixin.qq.com)开启会话存档功能。开启方式和 API 参数说明见企业微信开发者文档

  • Python 3.11+

  • 企业微信会话内容存档权限:登录 管理后台 → 安全与管理 → 管理工具 → 会话内容存档

  • 企业微信官方 SDKlibWeWorkFinanceSdk_C.so(需自行从开放平台下载)

  • RSA 私钥:在管理后台「会话内容存档」页面上传公钥,私钥用 openssl 在本地生成(不要使用任何在线生成工具,避免私钥外泄):

    # 生成 2048 位 RSA 私钥(兼容企业微信会话存档)
    openssl genrsa -out private_key.pem 2048
    
    # 提取对应公钥,上传到管理后台
    openssl rsa -in private_key.pem -pubout -out public_key.pem

2. 安装

git clone https://github.com/deadmau5v/wecom-msg-audit-mcp.git
cd wecom-msg-audit-mcp

# 推荐使用 uv
uv sync

# 或使用 pip
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

将官方 SDK 文件 libWeWorkFinanceSdk_C.so 放置到项目根目录(或在 .env 中自定义 SDK_LIB_PATH)。

3. 配置

cp .env.example .env
# 编辑 .env,填入企业 ID、Secret、私钥路径等

4. 启动

作为 MCP 服务(推荐)

# stdio 模式(默认)
uv run python mcp_server.py

# http 模式(带 Bearer 鉴权)
MCP_TRANSPORT=http MCP_PORT=8331 uv run python mcp_server.py

然后在 MCP 客户端配置中接入:

{
  "mcpServers": {
    "wecom": {
      "command": "uv",
      "args": ["run", "python", "mcp_server.py"],
      "cwd": "/path/to/wecom-msg-audit-mcp"
    }
  }
}

作为 CLI 拉取

uv run python main.py

输出解密后的消息到 stdout,并增量追加到 wecom_messages.jsonl

配置项

所有配置通过环境变量(或 .env 文件)注入,禁止硬编码到代码中

变量

必填

说明

CORP_ID

企业 ID(我的企业 → 企业信息)

MSGAUDIT_SECRET

会话内容存档 Secret(不是普通应用 Secret)

EXTERNAL_CONTACT_SECRET

客户联系可调用应用 Secret(用于外部客户群)

SDK_LIB_PATH

SDK 动态库路径,默认 ./libWeWorkFinanceSdk_C.so

PRIVATE_KEY_PATH

RSA 私钥路径,默认 ./private_key.pem

SEQ_FILE

seq 进度文件,默认 ./wecom_msg_seq.txt

OUTPUT_JSONL

解密消息输出文件,默认 ./wecom_messages.jsonl

FETCH_LIMIT

单次拉取条数,1-1000,默认 100

SDK_TIMEOUT

SDK 请求超时(秒),默认 30

PROXY / PROXY_PASSWORD

代理与代理密码(按需)

R2_ENDPOINT

Cloudflare R2 端点,例:https://xxx.r2.cloudflarestorage.com/<bucket>

R2_BUCKET

R2 存储桶(若已包含在 endpoint 路径中可省略)

R2_CUSTOM_DOMAIN

自定义访问域名(用于预签名 URL 替换)

R2_TOKEN

兼容字段(当前未使用,可保留)

R2_S3_ID / R2_S3_KEY

R2 S3 兼容 AccessKey

MCP_BEARER_TOKEN

HTTP 模式下的 Bearer 鉴权 Token,留空则自动生成

MCP_TRANSPORT

stdio(默认)或 http

MCP_HOST / MCP_PORT

HTTP 模式监听地址,默认 127.0.0.1:8331

完整示例见 .env.example

MCP 工具一览

工具

用途

wecom_get_config_status

检查服务就绪状态(各能力是否可用)

wecom_pull_messages

从当前 seq 拉取并解密新消息

wecom_get_seq / wecom_set_seq

查看 / 重置拉取进度

wecom_query_messages

按群、发送者、类型、关键词检索本地消息

wecom_extract_roomids

从本地消息中提取所有群聊 roomid

wecom_get_group_info

查询群聊详情(内部 / 外部自动判定)

wecom_list_external_groups

列出外部客户群

wecom_download_media

下载 / 上传消息中的媒体文件

示例:让 Agent 拉取并搜索

User: 帮我拉取最近的聊天记录,搜索包含"发票"的消息

Agent: 调用 wecom_pull_messages → 解密
       调用 wecom_query_messages(keyword="发票", limit=20) → 返回结果

安全提醒

⚠️ 本项目会处理企业敏感数据,部署前请仔细阅读本节。

  1. .env 绝不能提交到仓库——本项目已通过 .gitignore 默认忽略;首次 git add 前请确认。

  2. private_key.pem 绝不能提交——同理已忽略。若不慎泄露,请立即在企业微信管理后台 重置公钥

  3. 消息数据可能包含个人隐私——wecom_messages.jsonl、群资料导出文件等已加入 .gitignore,请勿外发。

  4. Bearer Token 默认会写入 .env——HTTP 模式启动时若未设置 MCP_BEARER_TOKEN,会自动生成并保存到 .env;若希望每次启动都使用临时 Token,请改为外部注入或自行改造启动脚本。

  5. 部署时建议

    • 使用反向代理(HTTPS + IP 白名单)暴露 MCP HTTP 端点

    • 定期轮换 MSGAUDIT_SECRET 和 RSA 密钥对

    • 限制 OUTPUT_JSONL 所在目录的访问权限

项目结构

.
├── mcp_server.py        # FastMCP 入口,工具定义
├── wecom_core.py        # 核心业务:配置、SDK 封装、解密、查询
├── main.py              # CLI 入口:拉取并打印消息
├── group_chat.py        # 群资料识别与导出脚本
├── test_mcp_all.py      # MCP 工具冒烟测试
├── restart.sh           # tmux 一键重启脚本
├── fastmcp.json         # FastMCP 客户端配置
├── pyproject.toml       # 项目元数据
├── requirements.txt     # pip 依赖
├── .env.example         # 配置示例
├── .gitignore
├── LICENSE
└── README.md

开发

# 启动 HTTP 模式做本地调试
MCP_TRANSPORT=http MCP_PORT=8331 uv run python mcp_server.py

# 跑冒烟测试(需要先启动服务)
uv run python test_mcp_all.py

常见问题

Q: 启动报 SDK 动态库不存在 A: 检查 .envSDK_LIB_PATH 是否指向正确的 .so 文件,且有可执行权限。

Q: 报 RSA 解密 encrypt_random_key 失败 A: 私钥与后台公钥版本不匹配,需在管理后台重新下载配套私钥。

Q: 报 errcode=60011 A: 表示企业没有开通「会话内容存档」权限,需管理员在后台申请。

License

MIT

Available Tools

9 tools
wecom_download_mediaA

下载消息中的媒体文件(图片、视频、语音、文件等)。

通过 sdkfileid 下载媒体内容。图片上传到 R2 并返回预签名访问链接,其他文件保存到磁盘。 也可指定 save_to 路径将文件保存到指定位置。

ParametersJSON Schema
NameRequiredDescriptionDefault
save_toNo保存路径,不传则图片返回 R2 预签名链接、其他文件自动保存
sdkfileidYes媒体文件 ID(从消息的 sdkfileids 字段获取)

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals key behaviors: images are uploaded to R2 and return a presigned link, other files are saved to disk, and the save_to parameter can override the default path. This provides meaningful behavioral context beyond a simple 'download', though it does not cover error handling or access permissions.

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 concise and well-structured. It starts with a clear purpose statement, then provides key behavioral details, and ends with the optional save_to parameter. Every sentence adds value without redundancy.

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 that an output schema exists (as noted in context signals), the description adequately covers the tool's core functionality and return behavior for different media types. It explains the two possible outcomes (R2 link or saved file) without needing to detail return values. However, it could be more complete by noting potential error conditions or limiting factors like file size.

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 input schema already has 100% coverage with descriptions for both parameters (sdkfileid and save_to). The tool description adds value by explaining the behavioral difference between images (R2 presigned link) and other files (disk save), and how save_to modifies default behavior. This provides semantic context beyond the schema's descriptions.

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 core purpose: downloading media files (images, videos, voice, files) from messages. It uses a specific verb ('下载/download') and resource ('媒体文件/media files'), and it distinguishes itself from sibling tools, which focus on other operations like extracting room IDs or pulling 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 lacks explicit 'when to use' or 'when not to use' instructions, and no comparison to sibling tools is made. The implied usage is for downloading media from messages, but no context is given for exclusion criteria.

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

wecom_extract_roomidsA

从本地消息记录中提取所有群聊 roomid。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral aspects such as side effects, required state (e.g., need for prior message pulling), or performance considerations.

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, succinct sentence that directly states the tool's purpose. No redundant or unnecessary information.

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?

For a parameterless tool with an output schema, the description is minimally adequate but could be enhanced by mentioning dependency on local message availability or relation to sibling tools like wecom_pull_messages.

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 score is 4. The description does not add parameter-specific meaning, but schema coverage is 100% by default.

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 explicitly states the action (extract) and resource (all group chat roomids from local message records). It clearly distinguishes from sibling tools like wecom_pull_messages or wecom_get_group_info.

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 on when to use this tool versus alternatives. The description only states what it does but does not mention prerequisites, context, or when not to use it.

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

wecom_get_config_statusA

检查服务是否就绪(消息拉取、群聊查询等能力是否可用)。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior2/5

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

No annotations provided. Description only states readiness check, lacks details on side effects, auth requirements, or behavior.

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, focused sentence with no unnecessary words. Front-loaded with the main purpose.

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?

For a zero-parameter health check tool with output schema, the description adequately explains purpose. Could briefly mention return value but not required.

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; baseline 4 as per rules. Description adds no parameter info, but none needed.

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 the tool checks service readiness for specific capabilities (message pulling, group chat querying). Distinguishes from siblings that perform these actions.

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?

Implies use for pre-check before other tools, but no explicit when-to-use or when-not-to-use guidance.

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

wecom_get_group_infoB

获取群聊详情(外部客户群或内部群)。

ParametersJSON Schema
NameRequiredDescriptionDefault
roomidYes群聊 roomid
group_typeNo群类型,可选 auto(自动尝试)、external(外部客户群)、internal(内部群)auto

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. However, it only describes the basic functionality without disclosing behavioral traits such as authentication requirements, potential errors, or side effects.

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 directly states the purpose. 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 that an output schema exists, the description does not need to explain return values. However, with no annotations and minimal description, the tool lacks context about behavior and limitations. It is adequate for a straightforward tool but could be improved by adding usage hints or prerequisites.

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 coverage is 100% with descriptions for both 'roomid' and 'group_type'. The tool description does not add meaning beyond the schema; it merely restates the parameter purpose. Baseline score of 3 is appropriate as the schema already provides sufficient clarity.

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 clearly states the tool retrieves group chat details for both external and internal groups. It uses a specific verb ('获取') and resource ('群聊详情'), but does not differentiate from sibling tools like wecom_list_external_groups (which lists groups) or wecom_pull_messages (which retrieves 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 on when to use this tool versus alternatives. The description only states what the tool does, with no mention of when to use it, when not to, or any prerequisites.

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

wecom_get_seqA

获取当前消息拉取进度 seq。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

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

The description implies a read operation but does not explicitly disclose behavioral traits beyond that. With no annotations, it carries the full burden, but the minimal description is not misleading.

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, short sentence with no wasted words. It is appropriately sized and front-loaded.

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?

For a simple getter with no parameters and an output schema, the description is largely sufficient. It does not explain what 'seq' is, but the output schema likely covers that.

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 description does not need to add parameter information. Baseline is 4.

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 ('获取' - get) and the resource ('当前消息拉取进度 seq' - current message pull progress seq). It distinguishes from sibling tools like wecom_set_seq.

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 vs alternatives. No context on prerequisites, when not to use, or comparisons to siblings.

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

wecom_list_external_groupsC

列出外部客户群。

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo返回群数量上限

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral aspects. It does not mention that the tool is read-only, or describe pagination, rate limits, or other traits beyond the limit parameter. The short description lacks transparency.

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 sentence, concise and front-loaded. It earns its place by stating the core purpose without unnecessary words, though it could benefit from slight expansion for completeness.

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 only one parameter and an output schema exists, the description is minimally adequate. However, it does not explain what the output contains or how it differs from sibling group tools, leaving some ambiguity.

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 100%, so baseline is 3. The description does not add meaning beyond the parameter schema; it merely repeats the operation without elaborating on parameter behavior or constraints.

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 '列出外部客户群。' clearly states it lists external customer groups, using a specific verb and resource. However, it does not explicitly distinguish from sibling tools like wecom_get_group_info, which may confuse an AI agent.

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?

There is no guidance on when to use this tool versus alternatives, such as wecom_get_group_info or other list tools. No exclusions, prerequisites, or context are provided.

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

wecom_pull_messagesA

从企业微信会话存档 SDK 拉取并解密聊天记录。

从上次保存的 seq 位置继续拉取,解密后返回消息列表,并自动更新 seq。

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo单次拉取条数,最大 1000
save_to_fileNo是否将解密消息追加保存到本地

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It states the tool decrypts messages, returns a list, and auto-updates seq, and optionally saves to file. However, it does not disclose potential side effects (e.g., whether it modifies data), prerequisites, or error handling. Some behavioral aspects are transparent, but not comprehensive.

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 highly concise with two sentences that front-load the main action. Every sentence adds value—purpose first, then continuation and update behavior. No redundant information, making it easy to parse quickly.

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 that an output schema exists (so return values don't need explanation) and parameters are fully documented, the description adequately covers the core process. It explains the pull-decrypt-update workflow. Missing some edge-case context (e.g., what happens if seq is invalid), but overall sufficient for a straightforward data pull tool.

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 100%, so the schema already documents both parameters (limit and save_to_file) with clear descriptions. The tool description does not add additional meaning or context for these parameters beyond what the schema provides. Baseline score of 3 is appropriate.

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 pulls and decrypts chat records from the WeCom session archive SDK, continuing from a saved seq position. It uses a specific verb-resource combination and distinguishes itself from siblings like wecom_get_seq (which only gets seq) and wecom_query_messages (which likely queries without pulling/decrypting).

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 continuous pulling from a saved seq, but does not explicitly state when to use this tool versus alternatives (e.g., wecom_query_messages, wecom_get_seq) or provide conditions for not using it. The context is clear but lacks direct guidelines.

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

wecom_query_messagesC

查询本地已保存的解密聊天记录。

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo返回条数上限
offsetNo分页偏移
roomidNo按群聊 roomid 过滤
keywordNo按关键词全文搜索
msgtypeNo按消息类型过滤(text、image、file 等)
from_userNo按发送者 userid 过滤

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are present, so the description must carry full behavioral disclosure. It only states the operation without revealing if it's read-only, what preconditions exist (e.g., local storage must be populated), or how pagination works. Input schema implies pagination but description does not clarify.

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 concise sentence, but it is under-specified for a tool with 6 parameters and an output schema. It could be expanded to include important context without verbosity.

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 presence of an output schema and multiple sibling tools, the description lacks completeness. It does not explain the local query nature, decryption context, or differentiate from wecom_pull_messages. The tool has several filters, but usage scenarios are omitted.

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 100% with each parameter having a Chinese description (e.g., limit, offset, filters). The tool description adds no additional semantic value beyond what the schema provides, meeting the baseline expectation.

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 clearly states the tool queries locally saved decrypted chat records, specifying the resource (locally saved decrypted records) and verb (query). However, it does not distinguish from sibling tool wecom_pull_messages, which might pull from server, so a slight deduction.

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 on when to use this tool vs alternatives like wecom_pull_messages. There is no mention of prerequisites, context, or exclusions. The single sentence provides only a basic description.

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

wecom_set_seqB

设置消息拉取起始 seq(用于重置或跳过历史消息)。

ParametersJSON Schema
NameRequiredDescriptionDefault
seqYes新的 seq 值

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It discloses that the tool sets the seq for message pulling, but does not mention side effects (e.g., overwriting previous seq, affecting future pulls), authentication needs, or error states. This is insufficient for a mutation tool.

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 conveys purpose and use case. It is front-loaded with the verb and resource, with no wasted words.

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?

Despite having an output schema (not shown), the description lacks details on return values, failure modes, prerequisites, or behavioral implications of setting the seq. For a tool that modifies state, more context is needed to ensure safe and correct usage.

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 coverage is 100% with the parameter 'seq' described as '新的 seq 值' (new seq value). The description adds context that seq is for message pull starting point, but offers no additional meaning beyond the schema's description. Baseline 3 is appropriate.

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 verb '设置' (set) and the resource '消息拉取起始 seq' (message pull starting seq), and explains the purpose: resetting or skipping historical messages. This distinguishes it from siblings like wecom_get_seq (get) and wecom_pull_messages (pull).

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 resetting or skipping historical messages, but does not provide explicit when-to-use or when-not-to-use guidance, nor does it mention alternative tools. The agent can infer context but lacks clear directives.

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

TDQS

A3.8/5.0
Disambiguation5/5

Each tool has a distinct purpose: media download, room ID extraction, config status, group info, seq management, external group listing, message pulling, message querying, and seq setting. No overlaps or ambiguity.

Naming Consistency5/5

All tools follow a consistent 'wecom_verb_noun' snake_case pattern, with verbs like get, list, pull, query, set, extract, download. No mixing of styles.

Tool Count5/5

9 tools is well-scoped for the message auditing domain. Each tool covers a necessary function without being excessive or insufficient.

Completeness5/5

The tool set covers the full workflow: config check, seq management, message pull/query, media download, and group info/extraction. No obvious gaps for the stated auditing purpose.

Maintenance

ActivityStale
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

  • A
    license
    A
    quality
    F
    maintenance
    Enables Claude Code to read encrypted WeChat chat history from local database, search messages, view sessions and contacts.
    4
    18
    Do What The F*ck You Want To Public
  • F
    license
    A
    quality
    C
    maintenance
    Enables AI agents to control WeChat through MCP protocol, including sending messages, managing contacts, and searching messages.
    10
  • 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.

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/deadmau5v/wecom-msg-audit-mcp'

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