English | 中文
使用 pip 安装:
pip install wecom-bot-mcp-server
或者使用 poetry 安装(推荐):
poetry add wecom-bot-mcp-server
# Windows PowerShell
$env:WECOM_WEBHOOK_URL="你的企业微信机器人 Webhook URL"
# Linux/macOS
export WECOM_WEBHOOK_URL="你的企业微信机器人 Webhook URL"
# 安装后可以直接运行命令
wecom-bot-mcp-server
或者在代码中使用:
from wecom_bot_mcp_server.server import main
# 启动服务器
if __name__ == "__main__":
main()
from wecom_bot_mcp_server.server import send_message, get_message_history
# 发送消息
await send_message("Hello, WeCom!")
# 获取消息历史
history = get_message_history()
poetry add wecom-bot-mcp-server
在 VSCode 中,需要配置 Cline MCP 设置文件。文件位置:
%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json~/.config/Code/User/globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json~/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 URLgit clone https://github.com/loonghao/wecom-bot-mcp-server.git
cd wecom-bot-mcp-server
pip install poetry
poetry install --with dev
poetry run pytest tests/ --cov=wecom_bot_mcp_server
poetry run ruff check .
poetry run ruff format .
poetry run mypy src/wecom_bot_mcp_server --strict
欢迎提交 Issue 和 Pull Request!