Allows for the use of Google's Gemini models to provide automated AI-powered responses to incoming messages received through the WhatsApp Business API.
Facilitates management of WhatsApp Business assets, including updating business profiles and managing the creation and approval status of message templates within the Meta ecosystem.
Enables integration with OpenAI models to power AI-driven automatic replies and chatbot functionality for incoming WhatsApp messages.
Provides a comprehensive suite of tools for the WhatsApp Business Cloud API, including sending text and media messages, managing templates, interacting with WhatsApp Flows, and tracking delivery analytics.
WhatsApp Business MCP Server
The most complete MCP Server for WhatsApp Business Cloud API. 43 tools | 8 modules | Hosted on Cloudflare Workers | Zero installation
Built by spirit122
What is this?
This MCP Server lets you control WhatsApp Business directly from Claude AI. Send messages, receive replies, manage templates, track analytics — all through natural language.
Example: Just tell Claude "Send a message to +56 9 1234 5678 saying the order is ready" and it does it.
Get Started in 3 Steps
Step 1: Choose Your Plan
Free | Pro | Enterprise | |
Price | $0 | $27,000 CLP/mo | $92,000 CLP/mo |
Core messages (text, image, video, audio, docs) | 10 tools | 10 tools | 10 tools |
Templates (send, create, list, delete) | 5 tools | 5 tools | 5 tools |
Media (upload, download, delete) | 3 tools | 3 tools | 3 tools |
Business profile | 3 tools | 3 tools | 3 tools |
Interactive messages (buttons, lists, products) | - | 5 tools | 5 tools |
Webhooks (receive messages, search conversations) | - | 3 tools | 3 tools |
WhatsApp Flows (forms, surveys in chat) | - | 2 tools | 2 tools |
Analytics (metrics, quality, delivery stats) | - | 4 tools | 4 tools |
Support | Community | Priority + SLA | |
Safety tools (allowlist, spam config) | 2 tools | 2 tools | 5 tools |
Enterprise safety (audit log, custom limits, reports) | - | - | 3 tools |
AI Auto-Reply (chatbot with 5 providers) | - | - | 3 tools |
Anti-spam protection | Strict | Moderate | Fully customizable |
Rate limit | 100/hr | 1,000/hr | 10,000/hr |
Total tools | 5 | 25 | 38 |
Buy Pro: Click here to subscribe
Buy Enterprise: Click here to subscribe
Step 2: Get Your API Key
After purchasing, you will receive a license key via email from Lemonsqueezy. This is your API key.
You can also retrieve it at any time:
GET https://whatsapp-mcp-server.eosspirit.workers.dev/billing/api-key?email=YOUR_EMAILStep 3: Connect to Claude Desktop
Open Claude Desktop
Click the gear icon (Settings) > Developer > Edit Config
This opens
claude_desktop_config.json. Paste the config below.Restart Claude Desktop
Config file location:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonMac:
~/Library/Application Support/Claude/claude_desktop_config.json
Free tier (no API key needed):
{
"mcpServers": {
"whatsapp": {
"type": "url",
"url": "https://whatsapp-mcp-server.eosspirit.workers.dev/mcp"
}
}
}Pro / Enterprise (with API key):
{
"mcpServers": {
"whatsapp": {
"type": "url",
"url": "https://whatsapp-mcp-server.eosspirit.workers.dev/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY_HERE"
}
}
}
}That's it! Now just ask Claude to send messages, check analytics, or anything else.
All 35 Tools
Module 1: Messages (10 tools)
Tool | Description |
| Send text with URL preview and reply support |
| Send image via URL or media ID |
| Send video (MP4, 3GPP) |
| Send audio (AAC, MP3, OGG) |
| Send document (PDF, etc.) |
| Send sticker (WEBP) |
| Send location with coordinates |
| Send contact cards |
| React to a message with emoji |
| Mark message as read (blue checkmarks) |
Module 2: Interactive Messages (5 tools) PRO
Tool | Description |
| Up to 3 reply buttons for quick choices |
| Scrollable list with sections and rows |
| Call-to-action URL button |
| Single product from your catalog |
| Multi-product catalog view |
Module 3: Templates (5 tools)
Tool | Description |
| Send approved template with dynamic parameters |
| List all your message templates |
| Create a new template (requires Meta approval) |
| Delete a template by name |
| Check if a template is approved, pending, or rejected |
Module 4: Media (3 tools)
Tool | Description |
| Upload file to WhatsApp servers (max 100MB) |
| Get download URL for a media file (expires in 5 min) |
| Delete uploaded media |
Module 5: Webhooks (3 tools) PRO
Tool | Description |
| Get messages received from customers |
| Track sent / delivered / read / failed |
| Search messages by text, phone number, or date |
Module 6: Business Profile (3 tools)
Tool | Description |
| Get your profile info (about, address, email) |
| Update any profile field |
| List registered numbers with quality rating |
Module 7: WhatsApp Flows (2 tools) PRO
Tool | Description |
| Create interactive forms/surveys inside WhatsApp |
| Send a Flow to a customer |
Module 8: Analytics (4 tools) PRO
Tool | Description |
| Conversation metrics by time period |
| Phone quality: GREEN / YELLOW / RED |
| Current tier and daily contact limits |
| Delivery statistics for a date range |
Safety Tools (2 tools — all tiers)
Tool | Description |
| Add/remove/list phone numbers on your recipient allowlist. Enable or disable the allowlist. |
| View your current anti-spam config, rate limits, and usage this hour |
Enterprise Safety Tools (3 tools) ENTERPRISE
Tool | Description |
| Full audit log of all messages sent. Filter by recipient, status, date. Essential for compliance. |
| Override default rate limits. Set per-recipient caps, restrict message types, add custom blocked patterns. |
| Generate compliance report with volume stats, risk score, top recipients, blocked messages, and recommendations. |
Anti-Spam Protection
Every outbound message is checked by the built-in MessageGuard before sending. No bad prompt can turn into spam.
Protections by Tier
Protection | Free | Pro | Enterprise |
Recipient allowlist | Configurable | Configurable | Configurable |
Messages per recipient per hour | 5 | 30 | 100 |
Unique recipients per hour | 3 | 50 | 500 |
Spam content detection | Yes | Yes | Yes |
Blocked patterns | "buy now", "click here to claim", "congratulations you won", etc. | Same | Same |
How It Works
Allowlist — Enable it with
manage_allowlistto restrict who can receive messages. If enabled, only numbers on the list can be messaged.Per-recipient rate limit — Max messages to the same number per hour. Prevents flooding a single contact.
Unique recipient limit — Max different numbers per hour. Prevents mass-messaging campaigns.
Content filter — Blocks messages matching known spam patterns (promotional language, chain messages).
Duplicate detection — Blocks sending the same message to the same number within a short window.
Quick Example
You: "Send a message to +1234567890 saying hello"
Claude: ❌ Blocked — recipient not in allowlist. Use manage_allowlist to add them.
You: "Add +1234567890 to my allowlist"
Claude: ✅ Added. Allowlist now has 1 number.
You: "Send a message to +1234567890 saying hello"
Claude: ✅ Message sent!AI Auto-Reply (Enterprise) — WhatsApp Chatbot
Enterprise customers can enable AI-powered automatic replies to incoming WhatsApp messages. When a customer messages you, the server calls an AI provider to generate a response and sends it back automatically.
Supported AI Providers
Provider | Model (default) | Free tier? |
Groq | Llama 3.3 70B | Yes (recommended to start) |
Claude (Anthropic) | claude-sonnet-4-20250514 | No |
OpenAI | gpt-4o | No |
Gemini (Google) | gemini-2.0-flash | Limited free |
DeepSeek | deepseek-chat | No |
Each client uses their own AI API key — you are not charged for AI calls.
How to Set Up Auto-Reply
Step 1: Get an API key from your preferred provider:
Groq (free): console.groq.com → API Keys → Create
OpenAI: platform.openai.com → API Keys
Claude: console.anthropic.com → API Keys
Gemini: aistudio.google.com/apikey
DeepSeek: platform.deepseek.com → API Keys
Step 2: Configure auto-reply via Claude:
You: "Configure auto-reply with Groq. My API key is gsk_xxxxx.
Use this system prompt: You are a friendly customer service agent
for my online store. Answer questions about products, shipping,
and returns in Spanish. Our website is https://mystore.com"
Claude: ✅ Auto-reply ENABLED with Groq (Llama 3.3 70B)Step 3: That's it! Incoming WhatsApp messages will now get automatic AI responses.
Auto-Reply Tools (3 tools) ENTERPRISE
Tool | Description |
| Set up auto-reply: choose provider, set API key, system prompt, business hours, memory, rate limits |
| Check current auto-reply config and status |
| Clear AI conversation memory for a customer or all customers |
Features
Conversation memory — the AI remembers previous messages per customer (configurable, up to 20 messages)
Business hours — only auto-reply during work hours, with a custom off-hours message
Per-recipient rate limit — max 20 auto-replies per customer per hour (configurable)
Custom system prompt — tell the AI who it is, what it sells, how to respond
Any model — use the default or specify a custom model name
Example Conversation
Customer: "Hola, cuánto cuesta?"
Bot: "Hola Ricardo, tenemos planes Free, Pro ($29 USD/mes) y
Enterprise ($99 USD/mes). Visita https://mysite.com para más detalles."
Customer: "Tienen envío gratis?"
Bot: "Sí, el envío es gratuito en pedidos mayores a $50.
¿Te gustaría hacer un pedido?"Why This Server vs Others?
Feature | Other MCP Servers | This Server |
Send messages (text, media, templates) | Yes | Yes |
Interactive messages (buttons, lists, products) | Partial | Full |
Receive messages (webhooks) | No | Yes |
AI auto-reply chatbot | No | Yes |
WhatsApp Flows (forms/surveys) | No | Yes |
Analytics & quality monitoring | No | Yes |
Multi-number support | No | Yes |
5 AI providers (Groq, Claude, OpenAI, Gemini, DeepSeek) | No | Yes |
Hosted (zero installation) | No | Yes |
Tier-based access control | No | Yes |
Paid support | No | Yes |
Self-Hosting (Advanced)
If you want to host your own instance instead of using our hosted version:
Prerequisites
WhatsApp Business API access
Node.js 18+
Setup
# Clone the repository
git clone https://github.com/spirit122/whatsapp-mcp-server.git
cd whatsapp-mcp-server
npm install
# Create Cloudflare resources
wrangler d1 create whatsapp-mcp-db
wrangler kv namespace create CACHE
# Update wrangler.toml with the generated IDs
# Set your WhatsApp API secrets
wrangler secret put WHATSAPP_ACCESS_TOKEN
wrangler secret put WHATSAPP_PHONE_NUMBER_ID
wrangler secret put WHATSAPP_BUSINESS_ACCOUNT_ID
wrangler secret put WHATSAPP_WEBHOOK_VERIFY_TOKEN
wrangler secret put META_APP_SECRET
# Run database migrations
wrangler d1 execute whatsapp-mcp-db --remote --file=./schemas/d1-schema.sql
# Deploy
wrangler deployWebhook Setup (to receive messages)
Go to Meta Developer Portal > Your App > WhatsApp > Configuration
Set Webhook URL:
https://YOUR-WORKER.workers.dev/webhookSet Verify Token: same value as your
WHATSAPP_WEBHOOK_VERIFY_TOKENsecretSubscribe to:
messages
Development
wrangler dev # Run locally
npm test # Run tests (72 tests)
npm run typecheck # TypeScript checkAPI Endpoints
Method | Path | Description |
|
| Health check — server status and tool count |
|
| List all 43 tools with descriptions |
|
| MCP JSON-RPC endpoint (for Claude) |
|
| MCP JSON-RPC endpoint (alternative) |
|
| Meta webhook verification |
|
| Meta webhook incoming events |
|
| Lemonsqueezy payment webhooks |
|
| Retrieve your API key |
Architecture
Claude / AI Assistant
|
v
┌──────────────────────────────┐
│ Cloudflare Worker (Edge) │
│ - MCP Protocol (JSON-RPC) │
│ - Auth + API Keys + Tiers │
│ - Rate Limiting │
│ - Billing (Lemonsqueezy) │
└──────────┬───────────────────┘
|
┌─────┴──────┐
v v
┌─────────┐ ┌──────────────┐
│ WhatsApp│ │ Durable │
│ Cloud │ │ Objects │
│ API │ │ (webhooks) │
└─────────┘ └──────────────┘
|
┌──────┴──────┐
v v
┌──────┐ ┌──────┐
│ D1 │ │ KV │
│ logs │ │cache │
└──────┘ └──────┘FAQ
Q: Do I need my own WhatsApp Business API account? A: For the hosted version, your API key gives you access to the shared test environment. For production with your own phone number, you'll need a Meta Business Account.
Q: How do I get my API key after purchase?
A: You receive it via email from Lemonsqueezy. You can also retrieve it anytime at:
https://whatsapp-mcp-server.eosspirit.workers.dev/billing/api-key?email=YOUR_EMAIL
Q: Can I cancel my subscription? A: Yes, anytime through Lemonsqueezy. Your API key will be deactivated at the end of the billing period.
Q: What happens if my API key stops working? A: Check that your subscription is active. If your payment failed, update your payment method in Lemonsqueezy.
Q: Is there a free tier? A: Yes! 5 core tools are available for free with no API key needed. Just connect to the MCP endpoint.
Q: How does anti-spam protection work?
A: Every message goes through the MessageGuard which checks allowlists, per-recipient rate limits, unique recipient limits, and spam content patterns. Use manage_allowlist to control who can receive messages, and get_messaging_safety_status to check your current limits.
Q: Can someone use a bad prompt to send spam? A: No. The free tier only allows 5 messages to 3 different numbers per hour. All tiers have spam pattern detection and per-recipient rate limiting. You can enable an allowlist so messages can only go to pre-approved numbers.
Q: Can I self-host this? A: Yes, the code is open source (MIT). See the Self-Hosting section above.
Support
Free tier: GitHub Issues
Pro: Email support (included with subscription)
Enterprise: Priority support with SLA
License
MIT - Built by spirit122