Skip to main content
Glama
Yero-413

wechat-clawbot-push

by Yero-413

wechat-clawbot-push

个人微信 ClawBot 定时主动推送桥 —— 一个符合 MCP(stdio) 协议的服务器。注册为 WorkBuddy 连接器后,云端 WB 自动化即可直接调用,把定时/触发任务的结果主动推送到 用户自己的个人微信。无需企业微信,无需抓包。

安装

pip install wechat-clawbot-push
# 或本地源码安装
pip install .

Related MCP server: wx4py-mcp

作为 WorkBuddy 连接器使用

~/.workbuddy/mcp.json 注册(command 指向你的 python,args 用 -m):

{
  "mcpServers": {
    "wechat-clawbot-push": {
      "command": "python",
      "args": ["-m", "wechat_clawbot_push", "--mcp"]
    }
  }
}

或安装后直接用 console script:

{
  "mcpServers": {
    "wechat-clawbot-push": {
      "command": "wechat-clawbot-push",
      "args": ["--mcp"]
    }
  }
}

暴露的工具

工具

作用

push_wechat_message(text[, auto_acquire])

主动推送一条文本到用户个人微信(发送前自动验证 token)

acquire_token()

获取/刷新 context_token(长轮询,需手机给 bot 发一条消息)

bridge_status()

返回当前 token 状态,供自动化推送前自检

首次授权

每个用户首次使用前需执行一次 acquire_token:退出 WB → 手机给 bot 发一条消息 → 脚本捕获并缓存 context_token。之后 push_wechat_message 即可全自动推送。

  • 收消息:POST https://ilinkai.weixin.qq.com/ilink/bot/getupdates

  • 发消息:POST https://ilinkai.weixin.qq.com/ilink/bot/sendmessage

  • 鉴权:Authorization: Bearer {bot_id:secret}(token 自动从 ~/.workbuddy/settings.json 读取)

  • 主动发须带回 context_token(随入站消息返回,持久化可复用)

实现说明(stdio 铁律)

  • stdout 仅输出 newline-delimited JSON-RPC 消息;所有日志走 stderr

  • 二进制缓冲 + UTF-8 编解码,规避 Windows GBK 中文乱码

  • 运行态(token/缓存)写入用户级目录 ~/.workbuddy/wechat-clawbot-push/,与安装位置无关、多用户隔离

License

MIT

Available Tools

3 tools
acquire_tokenA

获取/刷新 context_token(长轮询,约 35 秒内需用手机给 bot 发一条消息以完成绑定)。推送前若 bridge_status 显示未获取 token,应先调用本工具。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and discloses important behavior: it uses long polling, requires the user to send a message to the bot within ~35 seconds to complete binding, and must precede push operations. It does not mention failure behavior or what happens on timeout, but the key interactive traits are covered.

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 entire description is one dense, front-loaded sentence. It places the core action first, then provides the essential operational constraint and the ordering rule, with 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?

Given the tool has no parameters and no output schema, the description covers the main operational context: binding requirement, timeout window, and relationship to bridge_status and push. It could add what is returned or what happens on timeout, but this is not critical for selecting and invoking the tool.

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 default baseline of 4 applies. The schema already fully represents the empty input; no additional parameter explanation is 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?

The description clearly states a specific action: obtaining or refreshing context_token, and adds the distinctive long-polling/binding behavior. This differentiates it from sibling tools like bridge_status and push_wechat_message.

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?

It explicitly gives a usage condition: call this tool before pushing when bridge_status shows no token has been acquired. This effectively tells the agent when to invoke it and implies it is unnecessary once a valid token exists.

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

bridge_statusA

返回推送桥当前状态:是否已缓存 context_token、目标用户微信id。供自动化推送前自检。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/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. It discloses that the tool returns a status (cached or not), implying a read-only operation. However, it does not explicitly state non-destructiveness, whether any side effects occur, or the exact return format. Given the simplicity, it adds some value but lacks explicit behavioral details.

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, compact sentence that front-loads the key information (what is returned) and then states its purpose. There is no redundancy or filler.

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, no-output-schema status check tool, the description covers the essential purpose and when to use it. It does not detail the exact format of the status (e.g., boolean vs. object), but the phrasing '是否已缓存' (whether cached) implies a boolean-like response. Given the tool's simplicity, it is sufficiently complete for an agent to invoke it correctly.

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 schema coverage is trivially 100%. The description does not need to explain parameters. Per rubric, baseline for 0 params is 4, and the description appropriately omits parameter details since there are none.

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 (返回/returns), resource (推送桥当前状态/current status of the push bridge), and specifically what it returns (whether context_token and target user WeChat ID are cached). It also mentions its purpose (pre-push self-check), which distinguishes it from siblings push_wechat_message and acquire_token.

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 gives a clear usage context: '供自动化推送前自检' (for self-check before automated push). This tells an agent when to use it, but it does not explicitly state exclusions or alternatives to siblings. However, the purpose is unambiguous enough to guide selection.

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

push_wechat_messageA

向用户【个人微信】(ClawBot)主动推送一条文本消息。发送前自动验证 context_token:已获取则直接推送;未获取或已失效则返回明确指引,提示先调用 acquire_token 并在手机给 bot 发消息。供 WB 自动化在定时/触发任务完成后调用,把结果推送到用户微信。

ParametersJSON Schema
NameRequiredDescriptionDefault
textYes要推送到微信的文本内容
auto_acquireNo可选。token 缺失时是否自动尝试获取(会阻塞等待手机消息,默认 false)

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool automatically validates context_token before sending, and details the two branches (valid → push directly; invalid → return guidance to call acquire_token and send a message to the bot). This goes beyond the bare 'push' action and covers the prerequisite flow, which is valuable behavioral context.

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, information-dense paragraph. It front-loads the core action and then explains the token validation logic and usage context. No fluff, but it could be slightly more compact; still well-structured and efficient.

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 description covers the main flow (token validation, usage context) but does not describe the return value on successful push, nor does it mention the auto_acquire parameter (even though the schema covers it). For a simple 2-parameter tool with no output schema, the missing success-return specification is a minor gap, so it's adequate but not fully 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 100% as both 'text' and 'auto_acquire' have descriptions in the schema. The description does not add additional meaning beyond what the schema already provides; it mentions token validation but does not elaborate on parameter specifics. Baseline of 3 is appropriate when schema fully documents parameters.

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 ('push') and resource ('text message to user's personal WeChat/ClawBot'), and specifies the scope ('WB automation after scheduled/triggered tasks'). It differentiates from siblings by explicitly referencing acquire_token as a prerequisite and describing the token validation flow, making it unmistakable which tool this is.

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?

It gives clear context: 'for WB automation after scheduled/triggered tasks' and explicitly states that if the token is missing/expired, one should call acquire_token first. While it doesn't mention bridge_status, the usage scenario and interaction with acquire_token are clearly outlined, providing sufficient guidance for when to use this tool.

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.

  1. 3 tool updatesv2.0.1
    • First observedacquire_token
    • First observedbridge_status
    • First observedpush_wechat_message

TDQS

A4.4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool maps to a distinct step in the push workflow: checking bridge/token state, acquiring/refreshing the token, and sending the message. There is no overlap or ambiguity between them.

Naming Consistency4/5

Two tools use a clear verb_noun pattern (push_wechat_message, acquire_token), while bridge_status is a noun phrase that would be more consistent as get_bridge_status. Minor deviation, but the naming is still predictable and readable.

Tool Count5/5

Three tools is exactly right for this narrow purpose: preflight status, token acquisition, and sending. Every tool serves a necessary role in the workflow with no redundancy.

Completeness5/5

The lifecycle is complete: check status, acquire token if needed, then push; push_wechat_message also self-verifies the token, avoiding dead ends. There are no obvious missing operations for the stated text-push use case.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers