The WeCom Bot MCP Server enables interaction with WeCom (WeChat Work) bots through a Model Context Protocol (MCP) compliant interface. With this server, you can:
Send Messages: Text, markdown, images (base64/URL), and file attachments
Mention Users: By user ID or phone number in messages
Track History: Access message history for reference
API Methods: Use
send_message
,send_wecom_file
, andsend_wecom_image
to interact with WeCom botsContext Handling: Utilize FastMCP context for logging, progress reporting, and resource access
Custom Deployment: Configure with environment variables for webhook URLs and logging preferences
Provides a Model Context Protocol (MCP) server implementation for WeCom (WeChat Work) bot, enabling sending of text, markdown, image and file messages to WeCom groups, with support for @mentions and message history tracking.
WeCom Bot MCP Server
A Model Context Protocol (MCP) compliant server implementation for WeCom (WeChat Work) bot.
Features
Support for multiple message types:
Text messages
Markdown messages
Image messages (base64)
File messages
@mention support (via user ID or phone number)
Message history tracking
Configurable logging system
Full type annotations
Pydantic-based data validation
Requirements
Python 3.10+
WeCom Bot Webhook URL (obtained from WeCom group settings)
Installation
There are several ways to install WeCom Bot MCP Server:
1. Automated Installation (Recommended)
Using Smithery (For Claude Desktop):
Using VSCode with Cline Extension:
Install Cline Extension from VSCode marketplace
Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
Search for "Cline: Install Package"
Type "wecom-bot-mcp-server" and press Enter
2. Manual Installation
Install from PyPI:
Configure MCP manually:
Create or update your MCP configuration file:
Configuration
Setting Environment Variables
Log Management
The logging system uses platformdirs.user_log_dir()
for cross-platform log file management:
Windows:
C:\Users\<username>\AppData\Local\hal\wecom-bot-mcp-server
Linux:
~/.local/share/hal/wecom-bot-mcp-server
macOS:
~/Library/Application Support/hal/wecom-bot-mcp-server
The log file is named mcp_wecom.log
and is stored in the above directory.
Usage
Starting the Server
Usage Examples (With MCP)
Direct API Usage
Send Messages
Send Files
Send Images
Development
Setup Development Environment
Clone the repository:
Create a virtual environment and install dependencies:
Testing
Code Style
Building and Publishing
Project Structure
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
Author: longhao
Email: hal.long@outlook.com
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A server for sending messages via WeCom bots using FastMCP, supporting asynchronous communication and message tracking through webhooks.
Related Resources
Related MCP Servers
- -securityFlicense-qualityAn MCP server that enables communication with users through Telegram. This server provides a tool to ask questions to users and receive their responses via a Telegram bot.Last updated -838
- AsecurityAlicenseAqualityEnables sending messages to webhook endpoints through the MCP protocol, supporting custom content, display names, and avatar URLs.Last updated -4223MIT License
- AsecurityAlicenseAqualityAn MCP server that enables posting messages to Discord webhooks, allowing customization of content, username, and avatar URL.Last updated -1MIT License
- -securityFlicense-qualityA simple Meta-agent Communication Protocol server built with FastMCP framework that provides 'echo' and 'dummy' tools via Server-Sent Events for demonstration and testing purposes.Last updated -