WeCom MCP server

Integrates WeCom group messaging, enabling automated sending of diverse message types and file uploads for streamlined team communication and notifications.
Back to servers
Setup instructions
Provider
gotoolkits
Release date
Jan 08, 2025
Language
Go
Stats
28 stars

The MCP-WeCom Bot Server enables sending various types of messages to WeCom groups through a robot webhook. This tool simplifies the integration between your applications and WeCom (WeChat Work) by providing a standardized interface for sending text, markdown, image, news, and template card messages.

Installation Options

Installing via Smithery

For Claude Desktop users, the easiest way to install is through Smithery:

npx -y @smithery/cli install @gotoolkits/mcp-wecombot-server --client claude-desktop

Manual Installation

To install manually:

# Clone the repository
git clone https://github.com/gotoolkits/mcp-wecombot-server.git

# Navigate to the directory and build
cd mcp-wecombot-server && make build

# Create a symlink to make the command available system-wide
sudo ln -s $PWD/dist/mcp-wecombot-server_xxx_xxxx /usr/local/bin/mcp-wecombot-server

Note: Replace $PWD/dist/mcp-wecombot-server_xxx_xxxx with the actual binary filename generated during the build process.

Alternatively, you can download and use the pre-compiled binary from the releases page.

Configuration

Create a configuration file for the MCP server with your WeCom robot webhook key:

{
  "mcpServers": {
    "mcp-wecombot-server": {
      "command": "mcp-wecombot-server",
      "env": {
        "WECOM_BOT_WEBHOOK_KEY": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
      }
    }
  }
}

Important: You need to replace the WECOM_BOT_WEBHOOK_KEY value with your own webhook key from WeCom.

Usage

The server supports several message types that can be sent to WeCom groups:

Sending Text Messages

Send simple text messages to your WeCom group:

prompt: 给我在WeCom发送一条文本消息,消息内容为:这是一条测试消息

or in English:

prompt: Send me a text message on WeCom with the content: This is a test message.

Sending Markdown Messages

Send formatted markdown messages:

prompt: 给我在WeCom发送一条markdown消息,消息内容为:# 这是一条测试 Markdown 消息

or in English:

prompt: Send me a Markdown message on WeCom with the content: # This is a test Markdown message

Sending News Messages

Send news-style messages with title, description, URL, and image:

prompt: 给我在WeCom发送一条图文消息,图文标题为:这是一条图文消息,图文描述为:这是一条图文消息,图文链接为:https://github.com/gotoolkits,图文图片为:https://img-blog.csdnimg.cn/fcc22710385e4edabccf2451d5f64a99.jpeg

or in English:

prompt: Send me a graphic message on WeCom with the title: This is a graphic message, the description: This is a graphic message, the link: https://github.com/gotoolkits, and the image: https://img-blog.csdnimg.cn/fcc22710385e4edabccf2451d5f64a99.jpeg

Other Supported Message Types

  • send_image: Send image messages to WeCom group
  • send_template_card: Send template card messages to WeCom group
  • upload_file: Upload files to WeCom

WeCom Robot Setup

To use this server, you'll need to set up a WeCom group robot first:

  1. Follow the official WeCom documentation at: https://developer.work.weixin.qq.com/document/path/91770
  2. After creating the robot, you'll get a webhook URL like: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=693axxx6-7aoc-4bc4-97a0-0ec2sifa5aaa
  3. Extract the key (the part after key=) and use it as your WECOM_BOT_WEBHOOK_KEY in the configuration.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-wecombot-server" '{"command":"mcp-wecombot-server","env":{"WECOM_BOT_WEBHOOK_KEY":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-wecombot-server": {
            "command": "mcp-wecombot-server",
            "env": {
                "WECOM_BOT_WEBHOOK_KEY": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-wecombot-server": {
            "command": "mcp-wecombot-server",
            "env": {
                "WECOM_BOT_WEBHOOK_KEY": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later