Whatsapp Cloud API MCP

Whatsapp Cloud API MCP

by mdbm

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...

10 runs
1 users
Try This Actor

Opens on Apify.com

About 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.

What does this actor do?

Whatsapp Cloud API MCP is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.

Key Features

  • Cloud-based execution - no local setup required
  • Scalable infrastructure for large-scale operations
  • API access for integration with your applications
  • Built-in proxy rotation and anti-blocking measures
  • Scheduled runs and webhooks for automation

How to Use

  1. Click "Try This Actor" to open it on Apify
  2. Create a free Apify account if you don't have one
  3. Configure the input parameters as needed
  4. Run the actor and download your results

Documentation

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: 1. send_whatsapp_message: Send text or media messages. 2. send_interactive_message: Send buttons or list messages. 3. get_recent_messages: Retrieve recent messages (inbound/outbound). 4. get_conversation: Get full conversation history with a specific number. 5. search_messages: Search message content. ## Configuration ### Required Settings 1. WHATSAPP_PHONE_NUMBER_ID: Your Phone Number ID from the Meta for Developers Console. 2. WHATSAPP_ACCESS_TOKEN: A valid system user access token with whatsapp_business_messaging permission. ### 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: 1. Go to WhatsApp > Configuration. 2. Click Edit under Webhook. 3. 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). 4. Verify Token: Enter the VERIFY_TOKEN you 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 1. Go to your Actor in the Apify Console. 2. 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. json { "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: bash npx @modelcontextprotocol/inspector https://<YOUR-ACTOR-URL>.apify.actor/mcp This will open a web interface where you can: 1. See the list of available tools. 2. Test sending messages. 3. View the JSON-RPC responses. ### Option 3: Using with Cursor Cursor currently has built-in MCP support (beta). 1. Open Cursor Settings (Ctrl/Cmd + ,). 2. Navigate to Features > MCP. 3. Click Add New MCP Server. 4. Name: whatsapp 5. Type: HTTP (if available) or Command. * If HTTP is supported: Enter your Actor URL + /mcp. * If only Command is supported: Use the same npx command as above: npx -y @modelcontextprotocol/server-http-client https://<YOUR-ACTOR-URL>.apify.actor/mcp ### 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-client might 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.

Common Use Cases

Market Research

Gather competitive intelligence and market data

Lead Generation

Extract contact information for sales outreach

Price Monitoring

Track competitor pricing and product changes

Content Aggregation

Collect and organize content from multiple sources

Ready to Get Started?

Try Whatsapp Cloud API MCP now on Apify. Free tier available with no credit card required.

Start Free Trial

Actor Information

Developer
mdbm
Pricing
Paid
Total Runs
10
Active Users
1
Apify Platform

Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.

Learn more about Apify

Need Professional Help?

Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.

Find a Specialist

Trusted by millions | Money-back guarantee | 24/7 Support