wecom-bot-mcp-server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
企业微信机器人 MCP HTTP 服务器 (Python版)
基于 Model Context Protocol (MCP) 标准的企业微信机器人HTTP服务器Python实现,支持streamable-http调用方式和双向通信。
✨ 功能特点
🔄 完整的企业微信API集成 - 支持文本、Markdown、图片、图文、文件等所有消息类型
📡 MCP标准合规 - 完全符合Model Context Protocol规范的HTTP调用方式
🚀 高性能异步处理 - 基于FastAPI和asyncio的高性能异步架构
🔒 类型安全 - 使用Pydantic进行完整的数据验证和类型检查
🐳 容器化部署 - 支持Docker和uvx部署方式
📝 完整文档 - 自动生成的API文档和使用指南
🔍 实时监控 - 内置健康检查和日志记录
🔄 双向通信 - 支持Webhook回调处理
Related MCP server: dingtalk-mcp
🚀 快速开始
使用uvx (推荐)
# 直接运行
uvx wecom-bot-mcp-server
# 或从GitHub运行
uvx --from git+https://github.com/Countdown229/wecom-bot-mcp-python-server.git wecom-bot-mcp-server本地安装
# 克隆项目
git clone https://github.com/Countdown229/wecom-bot-mcp-python-server.git
cd wecom-bot-mcp-python-server
# 安装依赖
pip install -e .
# 配置环境变量
cp .env.example .env
# 编辑 .env 文件,填入企业微信Webhook URL
# 启动服务器
wecom-bot-mcp-serverDocker部署
# 构建镜像
docker build -t wecom-bot-mcp-server .
# 运行容器
docker run -p 3000:3000 --env-file .env wecom-bot-mcp-server📋 环境配置
创建 .env 文件:
# 企业微信机器人配置 (必填)
WECOM_WEBHOOK_URL=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=your-webhook-key
# 文件上传URL (可选)
WECOM_UPLOAD_URL=https://qyapi.weixin.qq.com/cgi-bin/webhook/upload_media?key=your-webhook-key&type=file
# 服务器配置
HOST=0.0.0.0
PORT=3000
LOG_LEVEL=INFO🔧 在CodeBuddy中使用
在 CodeBuddy 中添加 mcp.json:
{
"mcpServers": {
"wecom-bot": {
"command": "uvx",
"args": [
"wecom-bot-mcp-server"
],
"env": {
"WECOM_WEBHOOK_URL": "your-wecom-webhook-url",
"PORT": "3000",
"LOG_LEVEL": "info"
}
}
}
}或使用本地版本:
{
"mcpServers": {
"wecom-bot": {
"command": "uvx",
"args": [
"--from",
"/path/to/wecom-bot-mcp-python-server",
"wecom-bot-mcp-server"
],
"env": {
"WECOM_WEBHOOK_URL": "your-wecom-webhook-url"
}
}
}
}🛠️ 可用工具
1. send_wecom_message
发送文本或Markdown消息到企业微信群
{
"content": "Hello, World!",
"msg_type": "text", # 或 "markdown"
"mentioned_list": ["@all"], # 可选
"mentioned_mobile_list": ["13800138000"] # 可选
}2. send_wecom_image
发送图片到企业微信群
{
"image_path": "/path/to/image.jpg" # 或使用 base64_data
}3. send_wecom_news
发送图文消息到企业微信群
{
"articles": [
{
"title": "标题",
"description": "描述",
"url": "https://example.com",
"picurl": "https://example.com/pic.jpg"
}
]
}4. send_wecom_file
发送文件到企业微信群
{
"file_path": "/path/to/file.pdf"
}5. test_wecom_connection
测试企业微信机器人连接
{} # 无需参数📚 API文档
启动服务器后访问:
Swagger UI: http://localhost:3000/docs
ReDoc: http://localhost:3000/redoc
🔍 MCP端点
POST /mcp/tools/list- 列出可用工具POST /mcp/tools/call- 调用工具POST /mcp/resources/list- 列出可用资源POST /mcp/resources/read- 读取资源POST /mcp/prompts/list- 列出可用提示POST /mcp/prompts/get- 获取提示
📊 监控端点
GET /- 服务器信息GET /health- 健康检查POST /webhook- 企业微信回调
🧪 开发
# 克隆项目
git clone https://github.com/Countdown229/wecom-bot-mcp-python-server.git
cd wecom-bot-mcp-python-server
# 安装开发依赖
pip install -e ".[dev]"
# 运行测试
pytest
# 代码格式化
black src/
isort src/
# 类型检查
mypy src/
# 代码质量检查
ruff check src/📄 许可证
MIT License - 详见 LICENSE 文件
🤝 贡献
欢迎提交 Issue 和 Pull Request!
📞 支持
如有问题,请提交 GitHub Issue
企业微信机器人 MCP HTTP 服务器 - 让企业微信集成更简单! 🚀
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Build your own tools from chat: design, test and host them on a shareable MCP server URL.
WhatsApp (Web + Business API), SMS, contacts, and call records via 2Chat's MCP server.
Discover MCP servers and A2A agents; verify, message, post, follow, react, and receive webhooks.
Hosted MCP messaging across owners, tools, and machines, with readable transcripts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables sending text messages, files, and images to Feishu (Lark) group chats via MCP, with support for automatic default group configuration.MIT
- AlicenseAqualityBmaintenanceEnables sending messages to DingTalk group chats through custom bot webhooks, supporting text, Markdown, images, news, and template card messages.5MIT
- AlicenseAqualityCmaintenanceEnables sending messages to Feishu group chats via custom bot webhook, supporting text, rich text, interactive cards, Markdown-converted cards, and chat sharing without requiring an enterprise app.6MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to send plain-text messages to a preconfigured WeCom group chat bot through a single send tool. It validates content size, restricts delivery to the configured webhook, and returns platform acceptance or error status without retries or persistence.11MIT