Integrates with Meta's WhatsApp Business API platform for managing WhatsApp Business accounts and accessing messaging services through Meta's developer infrastructure.
Provides comprehensive integration with WhatsApp Business API for sending text, media (images, videos, documents, audio), interactive messages (lists and buttons), and managing message templates with dynamic parameters.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WhatsApp MCP Serversend a text message to +1234567890 saying 'Your order is ready for pickup'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
WhatsApp MCP Server
A comprehensive Model Context Protocol (MCP) server for WhatsApp Business API integration. This server provides powerful tools for sending various types of messages, managing templates, and handling interactive communications through WhatsApp Business API.
š Features
Message Types
Text Messages - Send plain text and template messages
Media Messages - Send images, videos, documents, and audio files
Interactive Messages - Send lists and button menus
Template Messages - Send approved templates with dynamic parameters
Template Management
Create Templates - Design new message templates
Check Status - Monitor template approval status
List Templates - View all available templates
Enterprise Ready
Clean Architecture - Modular, maintainable codebase
Error Handling - Robust error handling and logging
Type Safety - Full type hints for better development experience
Environment Based - Secure credential management
š¦ Installation
Option 1: Direct Installation
Option 2: From PyPI (when published)
āļø Configuration
Environment Setup
Create a .env file in your project root:
Configuration Benefits
Environment Variables: Set your phone number ID and business account ID once in environment variables, then use them across all function calls without needing to specify them each time.
Flexibility: You can still override the environment variables by passing explicit values to individual function calls when needed.
Simplicity: For most use cases, you'll only need to set the environment variables once and then use simpler function calls:
Getting Nango Credentials
Set up a Nango account
Create a WhatsApp Business integration in Nango
Set up your WhatsApp Business API connection
Get your Nango connection ID and secret key
Getting WhatsApp Credentials
Set up a WhatsApp Business Account
Create a Meta Developer App
Add WhatsApp Business API to your app
Configure the integration in Nango with your WhatsApp credentials
Running the Server
Note: This server uses the MCP stdio transport protocol and is designed to be run by MCP clients like Claude Desktop. It communicates via stdin/stdout and should not be run directly in interactive mode.
š¤ Claude Desktop Integration
Add this configuration to your Claude Desktop config file:
macOS
~/Library/Application Support/Claude/claude_desktop_config.json
Windows
%APPDATA%/Claude/claude_desktop_config.json
Linux
~/.config/Claude/claude_desktop_config.json
š ļø Available Tools
Message Tools
send_text_message
Send text messages or templates to WhatsApp users.
Parameters:
to(str): Recipient's phone number with country codemessage(str, optional): Text message contenttemplate_name(str, optional): Template name to uselanguage_code(str): Language code for templates (default: "en_US")phone_number_id(str, optional): Your WhatsApp Business phone number ID (uses env var if not provided)
Example Usage:
send_image_message
Send images with optional captions.
Parameters:
to(str): Recipient's phone numberimage_url(str): Public URL of the imagecaption(str, optional): Image captionphone_number_id(str, optional): Your WhatsApp Business phone number ID (uses env var if not provided)
send_video_message
Send videos with optional captions.
Parameters:
to(str): Recipient's phone numbervideo_url(str): Public URL of the videocaption(str, optional): Video captionphone_number_id(str, optional): Your WhatsApp Business phone number ID (uses env var if not provided)
send_document_message
Send documents like PDFs, Word files, etc.
Parameters:
to(str): Recipient's phone numberdocument_url(str): Public URL of the documentcaption(str, optional): Document captionfilename(str, optional): Filename for the documentphone_number_id(str, optional): Your WhatsApp Business phone number ID (uses env var if not provided)
send_audio_message
Send audio files and voice messages.
Parameters:
to(str): Recipient's phone numberaudio_url(str): Public URL of the audio filephone_number_id(str, optional): Your WhatsApp Business phone number ID (uses env var if not provided)
Interactive Tools
send_list_message
Send interactive list messages with selectable options.
Parameters:
to(str): Recipient's phone numbersections(list): List of sections with optionsheader_text(str): Header text (default: "Available Options")body_text(str): Body textfooter_text(str): Footer textbutton_text(str): Button text (default: "Options")phone_number_id(str, optional): Your WhatsApp Business phone number ID (uses env var if not provided)
Example Usage:
send_button_message
Send interactive messages with up to 3 buttons.
Parameters:
to(str): Recipient's phone numberbody_text(str): Main message textbuttons(list): List of buttons (max 3)header_text(str, optional): Header textfooter_text(str, optional): Footer textphone_number_id(str, optional): Your WhatsApp Business phone number ID (uses env var if not provided)
Template Tools
send_template_message
Send approved template messages with dynamic parameters.
Parameters:
to(str): Recipient's phone numbertemplate_name(str): Name of approved templateparameters(list, optional): List of parameters for template variableslanguage(str): Template language code (default: "en")phone_number_id(str, optional): Your WhatsApp Business phone number ID (uses env var if not provided)
Example Usage:
check_template_status
Check the approval status of a template.
Parameters:
template_name(str): Name of the template to checkbusiness_account_id(str, optional): WhatsApp Business Account ID (uses env var if not provided)
list_templates
List all templates for your business account.
Parameters:
status_filter(str, optional): Filter by status (APPROVED, PENDING, REJECTED)business_account_id(str, optional): WhatsApp Business Account ID (uses env var if not provided)
create_template
Create a new message template.
Parameters:
template_name(str): Name for the new templatelanguage(str): Language codecategory(str): Template category (MARKETING, UTILITY, AUTHENTICATION)components(list): List of template componentsbusiness_account_id(str, optional): WhatsApp Business Account ID (uses env var if not provided)
š Project Structure
š§ Development
Setup Development Environment
Code Formatting
Type Checking
Testing
š Usage Examples
Basic Text Message
Image with Caption
Interactive List
Template with Parameters
š Security
Environment Variables: Store sensitive data like access tokens in environment variables
Input Validation: All inputs are validated before API calls
Error Handling: Secure error messages that don't expose sensitive information
Rate Limiting: Respect WhatsApp API rate limits
š¤ Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Support
Documentation: Check this README and inline code documentation
Issues: Report bugs and request features via GitHub Issues
WhatsApp API: Refer to WhatsApp Business API Documentation
š Changelog
v0.1.0
Initial release
Basic message sending capabilities
Template management
Interactive messages
Claude Desktop integration
Clean modular architecture
Note: This MCP server requires a WhatsApp Business API account and valid access tokens. Make sure to comply with WhatsApp's terms of service and messaging policies.