This MCP server provides a Model Context Protocol compliant implementation for integrating with WeCom (WeChat Work) bots, allowing you to send various message types through the WeCom platform.
npx -y @smithery/cli install wecom-bot-mcp-server --client claude
Install from PyPI:
pip install wecom-bot-mcp-server
Configure MCP manually by creating or updating your MCP configuration file:
// For Windsurf: ~/.windsurf/config.json
{
"mcpServers": {
"wecom": {
"command": "uvx",
"args": [
"wecom-bot-mcp-server"
],
"env": {
"WECOM_WEBHOOK_URL": "your-webhook-url"
}
}
}
}
# Windows PowerShell
$env:WECOM_WEBHOOK_URL = "your-webhook-url"
# Optional configurations
$env:MCP_LOG_LEVEL = "DEBUG" # Log levels: DEBUG, INFO, WARNING, ERROR, CRITICAL
$env:MCP_LOG_FILE = "path/to/custom/log/file.log" # Custom log file path
The logging system stores logs in platform-specific directories:
C:\Users\<username>\AppData\Local\hal\wecom-bot-mcp-server
~/.local/share/hal/wecom-bot-mcp-server
~/Library/Application Support/hal/wecom-bot-mcp-server
The log file is named mcp_wecom.log
.
wecom-bot-mcp-server
# Send weather information
await mcp.send_message(
content="Shenzhen Weather:\n- Temperature: 25°C\n- Weather: Sunny\n- Air Quality: Good",
msg_type="markdown"
)
# Send meeting reminder with @mentions
await mcp.send_message(
content="## Project Review Meeting Reminder\n\nTime: Today 3:00 PM\nLocation: Meeting Room A\n\nPlease be on time!",
msg_type="markdown",
mentioned_list=["zhangsan", "lisi"]
)
# Send a file
await mcp.send_message(
content=Path("weekly_report.docx"),
msg_type="file"
)
from wecom_bot_mcp_server import mcp
# Send markdown message
await mcp.send_message(
content="**Hello World!**",
msg_type="markdown"
)
# Send text message and mention users
await mcp.send_message(
content="Hello @user1 @user2",
msg_type="text",
mentioned_list=["user1", "user2"]
)
from wecom_bot_mcp_server import send_wecom_file
# Send file
await send_wecom_file("/path/to/file.txt")
from wecom_bot_mcp_server import send_wecom_image
# Send local image
await send_wecom_image("/path/to/image.png")
# Send URL image
await send_wecom_image("https://example.com/image.png")
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.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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.
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.