WeCom Bot MCP Server logo

WeCom Bot MCP Server

by loonghao

A Model Context Protocol (MCP) compliant server implementation for WeCom (WeChat Work) bot. It allows you to send various types of messages to your WeCom bot using the MCP protocol.

View on GitHub

Last updated: N/A

What is WeCom Bot MCP Server?

WeCom Bot MCP Server is a server that implements the Model Context Protocol (MCP) for sending messages to WeCom (WeChat Work) bots. It provides a standardized way to interact with WeCom bots, allowing you to send text, markdown, images, and files.

How to use WeCom Bot MCP Server?

  1. Install the server using pip or Smithery. 2. Configure the server with your WeCom Bot Webhook URL. 3. Start the server. 4. Use the mcp.send_message function to send messages to your WeCom bot, specifying the content and message type. You can also use the direct API functions for sending files and images.

Key features of WeCom Bot MCP Server

  • Support for multiple message types (text, markdown, image, file)

  • @mention support (via user ID or phone number)

  • Message history tracking

  • Configurable logging system

  • Full type annotations

  • Pydantic-based data validation

Use cases of WeCom Bot MCP Server

  • Sending weather information to WeCom

  • Sending meeting reminders and @mentioning relevant people

  • Sending files to the WeCom group

  • Automated notifications from applications

  • Integrating WeCom bot with other services via MCP

FAQ from WeCom Bot MCP Server

How do I get the WeCom Bot Webhook URL?

You can obtain the WeCom Bot Webhook URL from your WeCom group settings.

What message types are supported?

The server supports text, markdown, image (base64 or URL), and file messages.

How do I @mention users?

You can @mention users by providing a list of user IDs or phone numbers in the mentioned_list parameter of the send_message function.

Where are the logs stored?

The logs are stored in a platform-specific directory using platformdirs.user_log_dir(). The log file is named mcp_wecom.log.

How do I configure the log level?

You can configure the log level using the MCP_LOG_LEVEL environment variable. Available log levels are DEBUG, INFO, WARNING, ERROR, and CRITICAL.