
WhatsApp MCP Server
io.github.nakulben由 GitHub 账号 nakulben 发布v0.1.0更新于 Oct 24, 2026
Manage WhatsApp Business templates and send messages via Meta Cloud API
概览
通过 Meta Cloud API 管理 WhatsApp Business 消息模板并发送模板消息,可由 MCP 客户端驱动。
- 可以做什么
- 校验、创建、列出、查看详情、查询状态和删除 WhatsApp Business 模板
- 向单个手机号或批量向多个号码发送已审核通过的模板消息
- 创建模板时自动识别轮播、目录、优惠码、订单详情、商品消息等模板变体
- 既可作为本地 stdio 进程运行,也可作为托管 HTTP 服务供远程客户端连接
- 适用场景
- 适用于拥有 WhatsApp Business 账户、希望让助手起草、校验并提交消息模板,或直接在对话中向客户发送已审核模板的场景。
- 运行要求
- 需要 Python 3.10+ 并在本地安装该包,或自建 HTTP 端点。需要 Meta WhatsApp Business 账户,以及具备 whatsapp_business_messaging 和 whatsapp_business_management 权限的系统用户访问令牌,还需手机号 ID 和 WABA ID。凭据通过环境变量提供(META_ACCESS_TOKEN、META_PHONE_NUMBER_ID、META_WABA_ID,可选 META_APP_ID、META_API_VERSION),也可按请求通过 Bearer 令牌或 X-Meta-* 请求头传入。需要访问 Meta Graph API 的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 WhatsApp MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
WhatsApp MCP Server
Manage WhatsApp Business templates and send messages from Claude, ChatGPT, Cursor, VS Code Copilot, or any MCP-compatible client — powered by the Meta Cloud API.
[MCP Compatible] [Meta API v24.0] [MIT License] [Python 3.10+]
What It Does
8 tools covering the full template lifecycle: create → validate → approve → send.
Quick Start
1. Clone & Install
2. Configure Credentials
Environment variables are used by all modes — local stdio and hosted remote.
How to get these? Go to Meta for Developers, create or select your app, navigate to WhatsApp > API Setup.
3. Connect to Your MCP Client
The server supports 3 transport modes:
For HTTP transports, you can customize host/port:
Claude Desktop (stdio — local)
Add to claude_desktop_config.json:
Claude.ai Web (remote — streamable-http)
Claude.ai connects to remote MCP servers as custom connectors. The connection originates from Anthropic's cloud servers, not from your machine.
- Host the server with env vars configured, behind HTTPS:
- Put it behind HTTPS using nginx, Caddy, or a tunnel (ngrok, Cloudflare Tunnel)
- In Claude.ai: go to Customize > Connectors → Add custom connector
- Enter your server URL (e.g.
https://your-domain.com/mcp/) - Claude supports authless or OAuth-based servers. For simplest setup, leave auth blank — the server will use the env vars you configured in step 1.
Note: Claude.ai does not support custom request headers. The server must be pre-configured with Meta credentials via environment variables. Each hosted server serves one WhatsApp Business Account.
Example nginx config
ChatGPT (remote — Responses API)
ChatGPT supports remote MCP servers via the Responses API. It supports both Streamable HTTP and SSE transports.
Option 1 — Server pre-configured with env vars (simplest):
Option 2 — Per-request credentials via Bearer token:
Encode your Meta credentials as base64 JSON and pass them in the authorization field.
OpenAI forwards this value as the Authorization header to your MCP server:
Note: ChatGPT only supports remote MCP servers (no local stdio). Your server must be publicly accessible over HTTPS.
Cursor (stdio)
Add to .cursor/mcp.json in your project:
VS Code Copilot (stdio)
Add to .vscode/mcp.json:
Per-Request Credentials (direct HTTP / curl / scripts)
For programmatic access or custom MCP clients, you can pass per-request credentials instead of relying on server env vars. Two methods are supported:
Method 1 — Bearer token (recommended):
Base64-encode a JSON object with your Meta credentials:
Required fields: access_token, phone_number_id, waba_id. Optional: app_id, api_version.
Method 2 — X-Meta- headers:*
If neither Bearer token nor X-Meta-* headers are present, the server falls back to environment variables.
Usage Examples
Once connected, just talk to your AI assistant:
"Create a marketing template called
summer_salewith a header image, body text about 50% off, and a Shop Now button"
"List all my approved templates"
"Send the
order_confirmationtemplate to +919876543210 with order number ORD-456"
"Validate this template before I submit it: ..."
"Check the status of template ID 123456789"
Supported Template Types
Meta's API has 2 template categories(excluding Authentication). Within each category, templates can have different structural variants — each with its own component layout and validation rules.
Marketing Templates
Utility Templates
How routing works: When you call
create_template, the server inspects the components to auto-detect the structural variant (e.g., presence ofcards[]→ Carousel,CATALOGbutton → Catalog) and applies the correct validator. You just passcategory: "MARKETING"or"UTILITY"— the variant is determined from the component structure.
Running Tests
Project Structure
Requirements
- Python 3.10+
- Meta WhatsApp Business Account
- System User access token with
whatsapp_business_messagingandwhatsapp_business_managementpermissions
Dependencies
Roadmap
See ROADMAP.md for planned features.
License
MIT — see LICENSE.
Built by Jina Connect — the WhatsApp Business CX platform.
来源:README.md,提交 412460d
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分