WhatsApp MCP Server
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 "Deploy 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 Server send 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
Related MCP server: Wasapi MCP Server
š¦ Installation
Option 1: Direct Installation
git clone <repository-url>
cd whatsapp-mcp
pip install -e .Option 2: From PyPI (when published)
pip install whatsapp-mcpāļø Configuration
Environment Setup
Create a .env file in your project root:
# Nango Configuration for WhatsApp Business API
NANGO_CONNECTION_ID=your_nango_connection_id
NANGO_INTEGRATION_ID=whatsapp-business
NANGO_BASE_URL=https://api.nango.dev
NANGO_SECRET_KEY=your_nango_secret_key
# WhatsApp Business Configuration (Optional - can be set per call)
WHATSAPP_PHONE_NUMBER_ID=your_whatsapp_phone_number_id
WHATSAPP_BUSINESS_ACCOUNT_ID=your_whatsapp_business_account_idConfiguration 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:
# Simple - uses environment variables
send_text_message(to="+1234567890", message="Hello!")
# Explicit - overrides environment variables
send_text_message(to="+1234567890", message="Hello!", phone_number_id="different_id")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
# Run using the installed command
whatsapp-mcp
# Or run directly from source
python main.py
# Or as a module
python -m whatsapp_mcp.server
# Show help
python main.py --helpNote: 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
{
"mcpServers": {
"whatsapp": {
"command": "uvx",
"args": ["git+https://github.com/ampcome-mcps/whatsapp-mcp.git"],
"env": {
"NANGO_CONNECTION_ID": "your_nango_connection_id",
"NANGO_INTEGRATION_ID": "whatsapp-business",
"NANGO_BASE_URL": "https://api.nango.dev",
"NANGO_SECRET_KEY": "your_nango_secret_key",
"WHATSAPP_PHONE_NUMBER_ID": "your_whatsapp_phone_number_id",
"WHATSAPP_BUSINESS_ACCOUNT_ID": "your_whatsapp_business_account_id"
}
}
}
}š ļø 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 text message (using environment variable for phone_number_id)
send_text_message(
to="+1234567890",
message="Hello! How can I help you today?"
)
# Send text message with explicit phone_number_id
send_text_message(
to="+1234567890",
message="Hello! How can I help you today?",
phone_number_id="1234567890"
)
# Send template message
send_text_message(
to="+1234567890",
template_name="welcome_message",
language_code="en_US"
)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:
sections = [
{
"title": "Main Menu",
"rows": [
{
"id": "option_1",
"title": "Product Info",
"description": "Get information about our products"
},
{
"id": "option_2",
"title": "Support",
"description": "Contact customer support"
}
]
}
]
send_list_message(
to="+1234567890",
sections=sections,
body_text="How can we help you today?"
)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:
parameters = [
{"type": "text", "text": "John Smith"},
{"type": "text", "text": "December 25, 2024"}
]
send_template_message(
to="+1234567890",
template_name="appointment_reminder",
parameters=parameters,
language="en"
)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
whatsapp-mcp/
āāā src/
ā āāā whatsapp_mcp/
ā āāā __init__.py
ā āāā server.py # Main server entry point
ā āāā tools/ # MCP tools
ā ā āāā __init__.py
ā ā āāā messages.py # Message sending tools
ā ā āāā interactive.py # Interactive message tools
ā ā āāā templates.py # Template management tools
ā āāā utils/ # Utilities
ā āāā __init__.py # Core utilities
ā āāā client.py # WhatsApp API client
āāā .env.example # Environment template
āāā pyproject.toml # Project configuration
āāā README.md # This fileš§ Development
Setup Development Environment
git clone <repository-url>
cd whatsapp-mcp
pip install -e ".[dev]"Code Formatting
black src/
isort src/Type Checking
mypy src/Testing
pytestš Usage Examples
Basic Text Message
# Send a simple text message (using environment variables)
result = send_text_message(
to="+1234567890",
message="Hello! Welcome to our service."
)Image with Caption
# Send an image with caption
result = send_image_message(
to="+1234567890",
image_url="https://example.com/image.jpg",
caption="Check out our new product!"
)Interactive List
# Send an interactive list
sections = [
{
"title": "Services",
"rows": [
{
"id": "service_1",
"title": "Web Development",
"description": "Custom website development"
},
{
"id": "service_2",
"title": "Mobile Apps",
"description": "iOS and Android app development"
}
]
}
]
result = send_list_message(
to="+1234567890",
sections=sections,
body_text="What service are you interested in?"
)Template with Parameters
# Send template with dynamic content
parameters = [
{"type": "text", "text": "Alice Johnson"},
{"type": "text", "text": "Premium"},
{"type": "text", "text": "January 15, 2025"}
]
result = send_template_message(
to="+1234567890",
template_name="subscription_confirmation",
parameters=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.
Available Tools
11 toolscheck_template_statusB
Check the approval status of a WhatsApp template
Inputs: template_name (required), business_account_id.
create_templateC
Create a new WhatsApp message template
Inputs: template_name (required), language (required), category (required), components (required), +1 more.
list_templatesC
List all templates for a WhatsApp Business Account
Inputs: status_filter, business_account_id.
send_audio_messageC
Send an audio/voice message via WhatsApp Business API
Inputs: to (required), audio_url (required), phone_number_id.
send_button_messageB
Send an interactive button message via WhatsApp Business API
Inputs: to (required), body_text (required), buttons (required), header_text, +2 more.
send_document_messageC
Send a document message via WhatsApp Business API
Inputs: to (required), document_url (required), caption, filename, +1 more.
send_image_messageC
Send an image message via WhatsApp Business API
Inputs: to (required), image_url (required), caption, phone_number_id.
send_list_messageC
Send an interactive list message via WhatsApp Business API
Inputs: to (required), sections (required), header_text, body_text, +3 more.
send_template_messageB
Send a template message with dynamic parameters via WhatsApp Business API
Inputs: to (required), template_name (required), parameters, language, +1 more.
send_text_messageC
Send a text message or template message via WhatsApp Business API
Inputs: to (required), message, template_name, language_code, +1 more.
send_video_messageC
Send a video message via WhatsApp Business API
Inputs: to (required), video_url (required), caption, phone_number_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 11 tools
Most tools have distinct purposes, with clear separation between template management (check_template_status, create_template, list_templates) and message sending functions. However, there is some potential confusion between send_template_message and send_text_message, as send_text_message's description mentions 'or template message' which overlaps with the dedicated template message tool.
All tools follow a consistent verb_noun pattern with snake_case throughout. The naming is highly predictable with clear action-object pairs like 'send_audio_message', 'list_templates', and 'create_template'.
With 11 tools, this server provides comprehensive coverage for WhatsApp Business API operations. The count is well-scoped for the domain, offering template management and multiple message types without being overwhelming.
The server covers core WhatsApp Business API functionality well with template lifecycle management and comprehensive message sending capabilities. A minor gap exists in message management operations like retrieving message status or deleting messages, but agents can work effectively with the provided tools.
Maintenance
Related MCP Connectors
Send WhatsApp messages and templates, manage chats, contacts, broadcasts and AI agents.
Send and read WhatsApp messages, templates, chats and campaigns through the official Business API.
Send, receive, edit and react to WhatsApp messages from your own number. OAuth or API key sign-in.
Send, receive, edit and react to WhatsApp messages from your own number. OAuth or API key sign-in.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to send WhatsApp messages, templates, and retrieve media through the WhatsApp Cloud API. Provides webhook handling and seamless integration with Meta's WhatsApp Business platform.23ISC
- AlicenseBqualityCmaintenanceEnables managing WhatsApp Business accounts through natural language, including sending messages, managing contacts, and querying conversations.6212 npmISC

GoWA MCP Serverofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents and tools to send and manage WhatsApp messages, media, statuses, and scheduled sends across multiple linked devices.MIT
ConverZAP MCP serverofficial
AlicenseNot gradedqualityCmaintenanceEnables AI assistants and agents to work with WhatsApp through the official WhatsApp Business Platform (Meta Cloud API), exposing tools to search contacts, read conversations, send messages and approved templates, manage CRM deals, run campaigns, enroll contacts in automations and pull reports. All actions run through a hosted public API, so they honor the account's existing roles, scopes and rate limits, with write operations supporting dry-run validation and confirmation for destructive calls.1MIT