API GuidesWhatsApp Business API
MCP Server
Configure the Notify Africa WhatsApp MCP server for agent-accessible WABA tools.
The WhatsApp MCP server wraps the WABA Developer API for MCP-compatible agents.
Package
@notifyafrica/whatsapp-mcp-serverInstall it globally:
npm install -g @notifyafrica/whatsapp-mcp-serveror:
pnpm add -g @notifyafrica/whatsapp-mcp-serverEnvironment
export NOTIFY_API_KEY="ntfy_your_api_key"
export NOTIFY_WHATSAPP_API_BASE_URL="https://api.notify.africa"NOTIFY_WHATSAPP_API_BASE_URL defaults to https://api.notify.africa. The API key must include the WABA service grant.
MCP Client Config
{
"mcpServers": {
"notify-whatsapp": {
"command": "notify-whatsapp-mcp-server",
"env": {
"NOTIFY_API_KEY": "ntfy_your_api_key",
"NOTIFY_WHATSAPP_API_BASE_URL": "https://api.notify.africa"
}
}
}
}Tools
| Tool | Purpose |
|---|---|
notify_whatsapp_send_text | Send a freeform WhatsApp text message |
notify_whatsapp_send_template | Send an approved WhatsApp template message |
notify_whatsapp_send_text
| Input | Type | Required | Notes |
|---|---|---|---|
to | string or string[] | Yes | One recipient phone number or an array of 1-100 phone numbers |
text | string | Yes | Freeform WhatsApp text body, 1-4096 characters |
idempotency_key | string | No | Optional retry-safe key, max 128 characters |
response_format | markdown or json | No | Defaults to markdown |
Use this tool only when the recipient has an open customer-service window.
notify_whatsapp_send_template
| Input | Type | Required | Notes |
|---|---|---|---|
to | string or string[] | Yes | One recipient phone number or an array of 1-100 phone numbers |
template_name | string | Yes | Approved WhatsApp template name |
template_parameters | object | No | Flat variables or grouped body, header, and buttons parameters |
language | string | No | Optional template language code |
idempotency_key | string | No | Optional retry-safe key, max 128 characters |
response_format | markdown or json | No | Defaults to markdown |
Template sends can start conversations when the template is approved and available for the selected WABA phone number.
Example Tool Inputs
{
"to": "255700000001",
"text": "Hello from Notify Africa",
"response_format": "markdown"
}{
"to": ["255700000001", "255700000002"],
"template_name": "hello_world",
"template_parameters": {
"body": {
"1": "Asha"
}
},
"language": "en",
"response_format": "json"
}