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.
  • python

77

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "loonghao-wecom-bot-mcp-server": {
      "command": "uvx",
      "args": [
        "wecom-bot-mcp-server"
      ],
      "env": {
        "WECOM_BOTS": "{\"alert\": {\"name\": \"Alert Bot\", \"webhook_url\": \"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=alert\"}, \"ci\": {\"name\": \"CI Bot\", \"webhook_url\": \"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=ci\"}}",
        "MCP_LOG_FILE": "/var/log/mcp/wecom.log",
        "MCP_LOG_LEVEL": "DEBUG",
        "WECOM_WEBHOOK_URL": "YOUR_WEBHOOK_URL"
      }
    }
  }
}

You can run a MCP (Model Context Protocol) compliant server that connects to WeCom (WeChat Work) bots, enabling you to send markdown messages, images, files, and template cards to one or more WeCom bots from your AI assistant. This guide shows practical steps to install, configure, and use the WeCom Bot MCP Server with your MCP client for multi-bot messaging workflows.

How to use

To use the WeCom Bot MCP Server, you configure your MCP client to talk to the local MCP server process. The server exposes tools that let you send messages, files, images, and template cards to one or more WeCom bots. You can target a specific bot by its ID, and you can manage multiple bots from a single MCP client setup.

How to install

Prerequisites you need before installation:

Choose one of the installation approaches below.

Automated Installation (Recommended)

Using Smithery (For Claude Desktop):

npx -y @smithery/cli install wecom-bot-mcp-server --client claude

Using VSCode with Cline Extension

  1. Install Cline Extension from VSCode marketplace

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)

  1. Search for “Cline: Install Package”

  1. Type “wecom-bot-mcp-server” and press Enter

Manual Configuration

Add the MCP server to your MCP client configuration file as shown.

{
  "mcpServers": {
    "wecom": {
      "command": "uvx",
      "args": [
        "wecom-bot-mcp-server"
      ],
      "env": {
        "WECOM_WEBHOOK_URL": "your-webhook-url"
      }
    }
  }
}

Additional configuration and multi-bot setup

You can configure multiple WeCom bots by setting up a default bot URL and per-bot URLs through environment variables or a JSON list. The following examples show how to define a default webhook and named bots for use with the MCP server.

Multi-bot configuration examples

Single default bot and additional named bots can be defined in your MCP client settings.

{
  "mcpServers": {
    "wecom": {
      "command": "uvx",
      "args": ["wecom-bot-mcp-server"],
      "env": {
        "WECOM_WEBHOOK_URL": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=default",
        "WECOM_BOTS": "{\"alert\": {\"name\": \"Alert Bot\", \"webhook_url\": \"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=alert\"}, \"ci\": {\"name\": \"CI Bot\", \"webhook_url\": \"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=ci\"}}"
      }
    }
  }
}

Log management and observability

The server uses a cross-platform log location and supports adjustable log levels. Set environment variables to customize logging behavior.

Security notes

Keep your webhook URLs confidential. Use environment variables or secure configuration management to protect credentials. When running multiple bots, ensure each bot’s webhook URL is scoped to its purpose.

Usage with MCP tools and endpoints

The MCP server exposes a set of tools that your AI assistant can use to interact with WeCom.

Additional sections

Notes, troubleshooting tips, and further usage patterns are included to help you get the most out of multi-bot WeCom messaging and template card delivery.

Available tools

send_message

Send text or markdown messages to a WeCom bot. Supports markdown and markdown_v2 formats and optional mentions.

send_wecom_file

Send files to a specific WeCom bot.

send_wecom_image

Send images to a specific WeCom bot via local path or URL.

send_wecom_template_card_text_notice

Send a text notice type template card with emphasis content and actions.

send_wecom_template_card_news_notice

Send a news-style template card with image support and actions.

list_wecom_bots

List all configured WeCom bots with IDs, names, and descriptions.

get_webhook_url

Retrieve the webhook URL for a specific bot from the registry.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational