
WhatsApp Business Cloud API的MCP服务器. 50+ 用于消息,模板,媒体,分析,流量和网络呼声的工具.
概览
为官方WhatsApp Business Cloud API提供安全加固的模型上下文协议(MCP)服务器. 连接克劳德,Cursor等AI助手或任何MCP相容客户端到WhatsApp Business. - 跨越8个模块——通讯、模板、媒体、分析、流量、网络呼号、业务概况、账户管理————API密钥认证、速率限制、输入验证、网络呼克签名验证、错误消毒、路径穿行保护——所有调用都通过图.facebook.com,没有非官方/第三方API——Stdio(用于Claude桌面等MCP客户端)和HTTP(用于REST API访问)——CORS控制、安全头条、通过环境变量进行配置 - 在HTTP端点上(X-API-Key header) - (每IP10 req/sec,内相符号桶) - (HMAC-SHA256通过META APP SECRET) - 电话号码格式,消息长度限制 - 从错误响应中剥去的符号和敏感URL - 媒体上传限制允许目录 - X-Content-Type-opers, X-Frame-opers,.
概述(AI 翻译)
为官方WhatsApp Business Cloud API提供安全加固的模型上下文协议(MCP)服务器. 连接克劳德,Cursor等AI助手或任何MCP相容客户端到WhatsApp Business.
□ 特性
- 50+工具 跨越8个单元——信息、模板、媒体、分析、流量、网络呼声、业务概况、账户管理
- ** 安全第一** — API 密钥认证、速率限制、输入验证、webhook 签名验证、错误消毒、路径穿行保护
- ** Meta Official API只**——所有电话拨到
graph.facebook.com,没有非官方/第三方API - 两个传输模式——stdio(用于Claude桌面等MCP客户端)和HTTP(用于REST API访问)
- ** 生产准备** – – 通过环境变量可配置的中央遥感控制系统控制、安全头条
□ 工具概览
模块 工具 描述 |-------------. ** ** 发送文本、媒体、互动、位置、联系、反应、回复 * * * * 所有WhatsApp消息类型 * * * ** ** 模板 ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- ** 媒体** 上传、下载、删除、获取信息 * * 图像、视频、音频、文档处理 * * *
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
WhatsApp Business MCP Server
A security-hardened Model Context Protocol (MCP) server for the official WhatsApp Business Cloud API. Connect AI assistants like Claude, Cursor, or any MCP-compatible client to WhatsApp Business.
Features
- 50+ tools across 8 modules — messaging, templates, media, analytics, flows, webhooks, business profile, account management
- Security-first — API key auth, rate limiting, input validation, webhook signature verification, error sanitization, path traversal protection
- Official Meta API only — all calls go to
graph.facebook.com, no unofficial/third-party APIs - Two transport modes — stdio (for MCP clients like Claude Desktop) and HTTP (for REST API access)
- Production-ready — CORS controls, security headers, configurable via environment variables
Tools Overview
| Module | Tools | Description |
|---|---|---|
| Messaging | Send text, media, interactive, location, contact, reaction, reply | All WhatsApp message types |
| Templates | Create, list, send, delete, get status | Full template lifecycle management |
| Media | Upload, download, delete, get info | Image, video, audio, document handling |
| Analytics | Conversation analytics, quality rating, messaging limits | Business insights |
| Flows | Create, list, send flow messages | WhatsApp interactive experiences |
| Webhooks | Subscribe, unsubscribe, manage webhook fields | Event management |
| Business Profile | Get/update profile, phone numbers | Business identity management |
| Business Account | WABA management, phone operations | Account administration |
Quick Start
1. Clone and install
git clone https://github.com/tkhattar14/whatsapp-business-mcp.git
cd whatsapp-business-mcp
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
2. Configure
cp .env.example .env
# Edit .env with your Meta WhatsApp Business API credentials
# Get them from: https://developers.facebook.com/
3. Run (stdio mode — for MCP clients)
source .env && python main.py
4. Run (HTTP mode — for REST API)
source .env && python main_http.py
MCP Client Configuration
Claude Desktop / Cursor
{
"mcpServers": {
"whatsapp": {
"command": "python",
"args": ["/path/to/whatsapp-business-mcp/main.py"],
"env": {
"META_ACCESS_TOKEN": "your_token",
"META_PHONE_NUMBER_ID": "your_phone_id"
}
}
}
}
mcporter (OpenClaw)
mcporter add whatsapp-business --stdio "python /path/to/main.py"
Environment Variables
| Variable | Required | Description |
|---|---|---|
META_ACCESS_TOKEN |
Yes | Meta API bearer token |
META_PHONE_NUMBER_ID |
Yes | WhatsApp sender phone number ID |
META_BUSINESS_ACCOUNT_ID |
Recommended | Business account ID |
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"whatsapp": {
"command": "python",
"args": ["/path/to/whatsapp-business-mcp/main.py"],
"env": {
"META_ACCESS_TOKEN": "your_token",
"META_PHONE_NUMBER_ID": "your_phone_id"
}
}
}
}