Get the FREE Ultimate OpenClaw Setup Guide →

wecom-bot

A Python server implementation for WeCom (WeChat Work) bot that follows the Model Context Protocol (MCP). This server provides a standardized interface for handling automated messaging and context-aware interactions within enterprise WeChat environments.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio loonghao-wecom-bot-mcp-server uvx wecom-bot-mcp-server \
  --env WECOM_BOTS="Optional JSON string defining multiple bots" \
  --env WECOM_WEBHOOK_URL="Your WeCom webhook URL for the default bot"

How to use

WeCom Bot MCP Server exposes a multi-bot WeCom integration via MCP. It accepts content from your AI assistant and forwards messages to one or more WeCom webhook endpoints, supports text, markdown and markdown_v2 formats, and can attach mentions and images or files through dedicated tools. The server is designed to run behind an MCP client (for example Claude, Windsurf, or Cline) and is configurable per-bot or multi-bot via environment variables or an MCP configuration file. You can instruct the assistant to send weather reports, meeting reminders with @mentions, or share files and images directly to WeCom groups or chats using the available tools.

Once the MCP server is running, you interact with it through natural language prompts. Use the send_message tool to post content, with options for markdown formatting and @mentions. Use send_wecom_file or send_wecom_image to attach files or images. If you need structured content like notices, choose the corresponding template card tools (text_notice or news_notice) to present highlighted information with actions. For multi-bot setups, you can route messages to a specific bot by configuring multiple webhook URLs and selecting the target bot via the bot_id parameter on tool calls.

How to install

Prerequisites:

  • Python 3.10+ installed on your system
  • Access to a WeCom Bot Webhook URL (for the default bot) and optional additional bot webhook URLs

Installation steps (manual installation recommended):

  1. Install the MCP client if not already installed (example using uvx in the MCP client config):

  2. Install the MCP server package in your Python environment (via uvx or your preferred method):

    Example: if you are using uvx to run the server module directly, ensure the module name matches the server package

    Command is shown in the mcp_config as: uvx wecom-bot-mcp-server

  3. Prepare environment variables:

    • WECOM_WEBHOOK_URL: Your default WeCom webhook URL
    • Optional: WECOM_BOTS to configure multiple bots in JSON format
    • Optional: MCP_LOG_LEVEL to adjust logging (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  4. Run the MCP client with the server configured (example command from MCP setup):

    uvx wecom-bot-mcp-server

  5. Verify the server starts and the MCP client can route messages to WeCom using the available tools.

Additional notes

Tips and common considerations:

  • For multi-bot setups, consider using the WECOM_BOTS JSON to define named bots with their own webhook URLs.
  • The MCP server supports multiple message types (markdown, markdown_v2, images, files, and template cards). Use the appropriate tool parameters when crafting prompts.
  • Ensure your WeCom webhook URLs remain confidential. Do not expose them in public repos or logs.
  • Logging can be customized via MCP_LOG_LEVEL and MCP_LOG_FILE to aid debugging during integration.
  • If you encounter authentication or permission issues with WeCom, verify that the webhook URL is active and configured for the target chat/group.
  • When using multi-bot configurations, remember to specify bot_id in tool calls to route messages to the desired bot.

Related MCP Servers

Sponsor this space

Reach thousands of developers