WhatsApp MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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.
What It Does
| Tool | Description |
|------|-------------|
| validate_template | Validate a template payload before submitting to Meta |
| create_template | Submit a template for Meta approval |
| list_templates | List templates with optional filters (status, category, name) |
| get_template_detail | Get full details of a template by ID |
| check_template_status | Quick status check for a template |
| delete_template | Delete a template by name |
| send_template_message | Send an approved template to a phone number |
| send_bulk_template_messages | Send an approved template to multiple phone numbers |
**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**:
| Transport | Command | Used By |
|---|---|---|
| stdio (default) | python -m whatsapp_mcp | Claude Desktop, Cursor, VS Code, Windsurf |
| sse | python -m whatsapp_mcp --transport sse | Legacy remote clients |
| streamable-http | python -m whatsapp_mcp --transport streamable-http | Claude.ai, ChatGPT, newer MCP clients |
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.
1. Host the server with env vars configured, behind HTTPS:
2. Put it behind HTTPS using nginx, Caddy, or a tunnel (ngrok, Cloudflare Tunnel)
3. In Claude.ai: go to Customize > Connectors → Add custom connector
4. Enter your server URL (e.g. https://your-domain.com/mcp/)
5. 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: