WeChat MCP server for reading and replying to messages via macOS Accessibility APIs
This MCP server has basic tool definitions with reasonable descriptions and input schemas, but exhibits significant gaps in error handling, parameter validation, and naming consistency. All 4 tools are explicitly registered via @mcp.tool() decorators and have documentation strings. However, parameter descriptions vary in completeness, output schemas are not formally documented, and error guidance is minimal. The tools operate on a macOS accessibility API surface (WeChat automation via UI interaction), which introduces inherent brittleness not addressed by the tooling. Naming uses verb_object pattern (fetch_*, reply_*, add_*, publish_*), which is good, but descriptions could better explain when to use each tool and what prerequisites exist. None of the tools declare destructive/idempotent hints via tool annotations.
Add a new contact using a WeChat ID. This tool automates the WeChat flow: - Type the given WeChat ID into the global search box. - Click the "Search WeChat ID" card under the "More" section. - In the "Add Contacts" window, click "Add to Contacts". - In the "Send Friend Request" window, optionally customize the friending message, remark, and privacy options, then confirm. The `privacy` argument controls the "Privacy" section of the friend-request window: - "all" (default) selects "Chats, Moments, WeRun, etc." and applies the `hide_my_posts` / `hide_their_posts` flags. - "chats_only" selects "Chats Only" and ignores the hide flags.
Fetch recent messages for a specific chat (contact or group). This will: - Look for the chat in the left sidebar session list - If found, click it to open the chat - If not found, search for the chat via the search box - Once the chat is open, retrieve recent messages from that chat
Publish a Moments post containing only text (no media). This will: - Open the main WeChat window and click the "Moments" button. - Long-press the "Post" button in the Moments window to open the composer sheet. - Fill the text entry area with the provided content. - If `publish` is True (default), click the "Post" button in the sheet to publish the moment; if False, leave the composer open without sending.
Optionally send a reply to a chat (contact or group). This tool is designed to be driven by the LLM using this MCP: - Call fetch_messages_by_chat first to inspect conversation history. - Have the LLM compose a reply string. - Call this tool with that reply string to send it. If reply_message is None or empty, no message is sent; the tool still ensures the chat is open.
Output schemas not formally documented. All four tools return dict[str, Any] or list[dict[str, Any]], but the response field structure is not declared in tool registration. LLMs cannot reliably extract fields for downstream tool calls.
publish_moment_without_media: naming is overly specific and negates action clarity. 'publish_moment_without_media' is verbose; 'publish_moment' with an optional media parameter is clearer. The current name suggests 'media' is special-cased, when really the tool simply doesn't support media yet.
Error handling lacks recovery guidance. When open_chat_for_contact returns candidates (ambiguous match), the tool surfaces them in the response but does not guide the LLM on next steps. Should explicitly document: 'If chat name is ambiguous, try calling with the full display name from the candidates list.'
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 56 | <=2025-11-25 | v2 |
| 2026-03-09 | D | 52 | - | v1 |
add_contact_by_wechat_id: parameter 'privacy' accepts string but no enum constraint or validation documented. Should declare enum: ['all', 'chats_only']. Currently LLMs could pass arbitrary strings.
No tool annotations (destructiveHint, idempotentHint, readOnlyHint). reply_to_messages_by_chat and add_contact_by_wechat_id are write operations with side effects; publish_moment_without_media is destructive (publishes to social feed). These should be marked to help agents reason about retry safety.
reply_to_messages_by_chat: parameter 'reply_message' defaults to None with no description of optional behavior. Tool description explains 'if None or empty, no message is sent' but this is not surfaced in the parameter annotation. Ambiguity risk.
No pagination or result limits documented for fetch_messages_by_chat. last_n defaults to 50; no validation that it's reasonable (1 - 500). For a chat with 10,000 messages, allowing unbounded requests could cause performance issues.