Cover image
Try Now
2025-01-03

Espejo dehttps: //github.com/loongghao/wecom-bot-mcp-server

3 years

Works with Finder

0

Github Watches

1

Github Forks

2

Github Stars

WeCom Bot MCP Server

Python Package codecov PyPI version Python Version

A WeCom (WeChat Work) bot server implemented with FastMCP, supporting message sending via webhook.

中文文档 | English

Features

  • Built on FastMCP framework
  • Markdown message format support
  • Asynchronous message sending
  • Message history tracking
  • Complete type hints
  • Comprehensive unit tests

Installation

Using pip:

pip install wecom-bot-mcp-server

Or using poetry (recommended):

poetry add wecom-bot-mcp-server

Usage

  1. Set environment variable:
# Windows PowerShell
$env:WECOM_WEBHOOK_URL="your WeCom bot webhook URL"

# Linux/macOS
export WECOM_WEBHOOK_URL="your WeCom bot webhook URL"
  1. Run the server:
# Run directly after installation
wecom-bot-mcp-server

Or use in code:

from wecom_bot_mcp_server.server import main

# Start server
if __name__ == "__main__":
    main()
  1. Send messages:
from wecom_bot_mcp_server.server import send_message, get_message_history

# Send a message
await send_message("Hello, WeCom!")

# Get message history
history = get_message_history()

Cline Configuration

  1. Install dependency:
poetry add wecom-bot-mcp-server
  1. Configure Cline MCP settings:

Configure the Cline MCP settings file in VSCode. File location:

  • Windows: %APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json
  • Linux: ~/.config/Code/User/globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json
  • macOS: ~/Library/Application Support/Code/User/globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json

Add the following configuration:

{
  "mcpServers": {
    "wecom-bot-server": {
      "command": "wecom-bot-mcp-server",
      "args": [],
      "env": {
        "WECOM_WEBHOOK_URL": "<your WeCom bot webhook URL>"
      },
      "alwaysAllow": [
        "send_message"
      ],
      "disabled": false
    }
  }
}

Configuration notes:

  • command: Uses the installed command-line tool
  • env.WECOM_WEBHOOK_URL: Replace with your actual WeCom bot webhook URL

Development

  1. Clone repository:
git clone https://github.com/loonghao/wecom-bot-mcp-server.git
cd wecom-bot-mcp-server
  1. Install poetry and dependencies:
pip install poetry
poetry install --with dev
  1. Run tests:
poetry run pytest tests/ --cov=wecom_bot_mcp_server
  1. Code checks:
poetry run ruff check .
poetry run ruff format .
poetry run mypy src/wecom_bot_mcp_server --strict

Requirements

  • Python >= 3.10
  • FastMCP >= 0.4.1
  • httpx >= 0.24.1

License

MIT License

Contributing

Issues and Pull Requests are welcome!


WeCom Bot MCP Server (中文)

English | 中文

特性

  • 基于 FastMCP 框架实现
  • 支持 Markdown 格式消息
  • 异步消息发送
  • 消息历史记录
  • 完整的类型提示
  • 全面的单元测试

安装

使用 pip 安装:

pip install wecom-bot-mcp-server

或者使用 poetry 安装(推荐):

poetry add wecom-bot-mcp-server

使用方法

  1. 设置环境变量:
# Windows PowerShell
$env:WECOM_WEBHOOK_URL="你的企业微信机器人 Webhook URL"

# Linux/macOS
export WECOM_WEBHOOK_URL="你的企业微信机器人 Webhook URL"
  1. 运行服务器:
# 安装后可以直接运行命令
wecom-bot-mcp-server

或者在代码中使用:

from wecom_bot_mcp_server.server import main

# 启动服务器
if __name__ == "__main__":
    main()
  1. 发送消息:
from wecom_bot_mcp_server.server import send_message, get_message_history

# 发送消息
await send_message("Hello, WeCom!")

# 获取消息历史
history = get_message_history()

在 Cline 中配置

  1. 安装依赖:
poetry add wecom-bot-mcp-server
  1. 配置 Cline MCP 设置:

在 VSCode 中,需要配置 Cline MCP 设置文件。文件位置:

  • Windows: %APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json
  • Linux: ~/.config/Code/User/globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json
  • macOS: ~/Library/Application Support/Code/User/globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json

添加以下配置:

{
  "mcpServers": {
    "wecom-bot-server": {
      "command": "wecom-bot-mcp-server",
      "args": [],
      "env": {
        "WECOM_WEBHOOK_URL": "<你的企业微信机器人Webhook URL>"
      },
      "alwaysAllow": [
        "send_message"
      ],
      "disabled": false
    }
  }
}

配置说明:

  • command: 使用安装后的命令行工具
  • env.WECOM_WEBHOOK_URL: 替换为你的企业微信机器人实际的 Webhook URL

开发

  1. 克隆仓库:
git clone https://github.com/loonghao/wecom-bot-mcp-server.git
cd wecom-bot-mcp-server
  1. 安装 poetry 和依赖:
pip install poetry
poetry install --with dev
  1. 运行测试:
poetry run pytest tests/ --cov=wecom_bot_mcp_server
  1. 代码检查:
poetry run ruff check .
poetry run ruff format .
poetry run mypy src/wecom_bot_mcp_server --strict

要求

  • Python >= 3.10
  • FastMCP >= 0.4.1
  • httpx >= 0.24.1

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Gil kaminski
  • Make sure you are post-ready before you post on social media

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocolo del conector de mensajes )服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 支持员工信息查询和消息发送等功能。 支持员工信息查询和消息发送等功能。

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

    Reviews

    3 (1)
    Avatar
    user_dK9xpb4j
    2025-04-15

    I recently tried the mcd-demo by jspoelstra and was truly impressed. The user interface is intuitive, making navigation simple and efficient. The functionality aligns perfectly with my needs, and the seamless integration into my workflow was a standout feature. I highly recommend checking it out at https://mcp.so/server/mcd-demo/jspoelstra for an excellent demo experience!