Whatsapp Cloud API MCP
Pricing
Pay per event
Whatsapp Cloud API MCP
Give your AI agents a phone number! The easiest way to integrate WhatsApp Business API with Claude and other MCP-compliant tools. Supports text, media, and interactive buttons.
Pricing
Pay per event
Rating
0.0
(0)
Developer

Mouhamed Bakhoum
Actor stats
0
Bookmarked
1
Total users
0
Monthly active users
5 days ago
Last modified
Categories
Share
WhatsApp MCP Server
Model Context Protocol (MCP) Server for WhatsApp Business API
This Apify Actor runs a full MCP Server that enables AI agents (like Claude, Cursor, etc.) to interact with WhatsApp. It supports sending messages, handling webhooks, and managing conversations.
Features
- MCP Protocol Support: Implements the Model Context Protocol (JSON-RPC 2.0) for seamless integration with AI agents.
- WhatsApp Integration: Send and receive text, media, and interactive messages.
- Webhook Handling: Validates and processes WhatsApp Cloud API webhooks.
- Message History: Stores messages in Apify Dataset and provides tools to search and retrieve conversation history.
- Reliability: Built-in retry logic, rate limiting, and message deduplication.
Tools Available to Agents
The server exposes the following MCP tools:
send_whatsapp_message: Send text or media messages.send_interactive_message: Send buttons or list messages.get_recent_messages: Retrieve recent messages (inbound/outbound).get_conversation: Get full conversation history with a specific number.search_messages: Search message content.
Configuration
Required Settings
- WHATSAPP_PHONE_NUMBER_ID: Your Phone Number ID from the Meta for Developers Console.
- WHATSAPP_ACCESS_TOKEN: A valid system user access token with
whatsapp_business_messagingpermission.
Optional Settings
- VERIFY_TOKEN: The verification token you set in the Meta App Dashboard > WhatsApp > Configuration.
- WEBHOOK_SECRET: The App Secret for validating webhook signatures (highly recommended for security).
Usage
1. Deploy the Actor
Deploy this actor to your Apify account.
2. Configure Meta Webhook
In your Meta App Dashboard:
- Go to WhatsApp > Configuration.
- Click Edit under Webhook.
- Callback URL: Use the Apify Actor Container URL +
/webhook.- Start the actor in Apify.
- Copy the Container URL from the "Live View" or logs (e.g.,
https://unique-container-url.apify.actor). - Append
/webhook(e.g.,https://unique-container-url.apify.actor/webhook).
- Verify Token: Enter the
VERIFY_TOKENyou configured in the Actor input.
3. Connect Your AI Agent
Your AI agent (e.g., Claude Desktop, Cursor) needs to connect to this MCP server.
The server exposes the MCP endpoint at /mcp.
Endpoint: https://unique-container-url.apify.actor/mcp
Endpoint: https://unique-container-url.apify.actor/mcp
How to Use with LLMs
Since your actor runs on Apify (remote HTTP), you need a way to bridge it to your local MCP client.
Option 1: Using with Claude Desktop
Claude Desktop typically communicates with MCP servers via standard input/output (stdio). To connect to your remote Apify Actor, you can use a generic HTTP client adapter or a simple local script.
1. Get your Apify Actor URL
- Go to your Actor in the Apify Console.
- Copy the Container URL (e.g.,
https://whatsapp-mcp-actor-xyz.apify.actor).
2. Configure Claude Desktop
Open your Claude Desktop configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - Mac:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following configuration. We'll use npx to run a lightweight bridge that forwards requests to your Apify Actor.
{"mcpServers": {"whatsapp": {"command": "npx","args": ["-y","@modelcontextprotocol/server-http-client","https://<YOUR-ACTOR-URL>.apify.actor/mcp"],"env": {"APIFY_TOKEN": "<YOUR_APIFY_TOKEN>"}}}}
Note: Replace <YOUR-ACTOR-URL> with your actual actor URL and <YOUR_APIFY_TOKEN> with your Apify API token.
3. Restart Claude Desktop
Restart the application. You should now see the WhatsApp tools (e.g., send_whatsapp_message) available in the chat interface.
Option 2: Testing with MCP Inspector
You can use the official MCP Inspector to test your server directly from the command line without configuring Claude Desktop yet.
Run this command in your terminal:
$npx @modelcontextprotocol/inspector https://<YOUR-ACTOR-URL>.apify.actor/mcp
This will open a web interface where you can:
- See the list of available tools.
- Test sending messages.
- View the JSON-RPC responses.
Option 3: Using with Cursor
Cursor currently has built-in MCP support (beta).
- Open Cursor Settings (
Ctrl/Cmd + ,). - Navigate to Features > MCP.
- Click Add New MCP Server.
- Name:
whatsapp - Type:
HTTP(if available) orCommand.- If
HTTPis supported: Enter your Actor URL +/mcp. - If only
Commandis supported: Use the samenpxcommand as above:npx -y @modelcontextprotocol/server-http-client https://<YOUR-ACTOR-URL>.apify.actor/mcp
- If
Troubleshooting
- Connection Refused: Ensure your Actor is RUNNING in the Apify Console. It must be active to receive requests.
- Authentication: If your actor requires an Apify Token for access (likely), ensure you pass it in the headers or environment variables if using a custom client. The
@modelcontextprotocol/server-http-clientmight need specific configuration for headers.
Output
All messages (sent and received) are stored in the Apify Dataset. You can view them in the "Output" tab or download them in JSON/CSV format.
Pricing
This Actor is paid per event. For detailed pricing information, please visit the Pricing Page.