Skip to main content
Glama
whatsapp-mcp-server

whatsapp-mcp-server

by rukman7

WhatsApp MCP Server

An MCP (Model Context Protocol) server that enables LLMs to interact with WhatsApp via the official WhatsApp Cloud API by Meta.

Features

Messaging Tools (13 tools)

Tool

Description

whatsapp_send_text

Send text messages

whatsapp_send_template

Send approved template messages (required for initiating conversations)

whatsapp_send_image

Send images via URL

whatsapp_send_document

Send documents (PDF, DOCX, etc.) via URL

whatsapp_send_location

Send location pins

whatsapp_send_contact

Send contact cards

whatsapp_send_reaction

React to messages with emoji

whatsapp_send_buttons

Send interactive reply buttons (up to 3)

whatsapp_send_list

Send interactive list menus

whatsapp_mark_as_read

Mark messages as read (blue checkmarks)

whatsapp_get_business_profile

Retrieve your business profile

whatsapp_update_business_profile

Update business profile fields

whatsapp_list_templates

List approved message templates

Related MCP server: Meta Cloud API MCP Server

Prerequisites

  1. Meta Developer Account — Register at https://developers.facebook.com

  2. WhatsApp Business App — Create a Meta app with the WhatsApp use case

  3. Access Token — Generate from the WhatsApp API Setup panel

  4. Phone Number ID — Found in the WhatsApp API Setup panel

Getting Your Credentials

  1. Go to Meta for Developers

  2. Create or select your app → Add the WhatsApp use case

  3. In the WhatsApp API Setup panel, note:

    • Phone Number ID (numeric ID under your test number)

    • WhatsApp Business Account ID (for template operations)

  4. Generate a Temporary Access Token (valid 24h) or set up a System User for a permanent token

Setup

1. Install Dependencies

npm install

2. Configure Environment Variables

# Required
export WHATSAPP_ACCESS_TOKEN="your_access_token"
export WHATSAPP_PHONE_NUMBER_ID="your_phone_number_id"

# Optional
export WHATSAPP_BUSINESS_ACCOUNT_ID="your_waba_id"  # Required for template operations
export WHATSAPP_API_VERSION="v23.0"                  # Default: v23.0
export TRANSPORT="stdio"                              # "stdio" (default) or "http"
export PORT="3000"                                    # HTTP port (default: 3000)

3. Build & Run

npm run build
npm start

Usage with Claude Desktop

Add this to your Claude Desktop MCP config (claude_desktop_config.json):

{
  "mcpServers": {
    "whatsapp": {
      "command": "node",
      "args": ["/path/to/whatsapp-mcp-server/dist/index.js"],
      "env": {
        "WHATSAPP_ACCESS_TOKEN": "your_token",
        "WHATSAPP_PHONE_NUMBER_ID": "your_phone_id",
        "WHATSAPP_BUSINESS_ACCOUNT_ID": "your_waba_id"
      }
    }
  }
}

Usage as HTTP Server

TRANSPORT=http PORT=3000 npm start

The server exposes:

  • POST /mcp — MCP endpoint (Streamable HTTP)

  • GET /health — Health check

Important Notes

24-Hour Messaging Window

WhatsApp enforces a 24-hour customer service window. You can only send free-form messages (text, image, etc.) to users who have messaged you within the last 24 hours. Outside this window, you must use approved template messages to initiate contact.

Phone Number Format

Always use international format without the + prefix (e.g., 353851234567 for an Irish number, 14155551234 for a US number).

Rate Limits

The Cloud API supports up to 80 messages per second for standard tier. Monitor your usage in the Meta Business Manager.

License

MIT

Available Tools

13 tools
whatsapp_get_business_profileGet WhatsApp Business ProfileA
Read-onlyIdempotent

Retrieve the WhatsApp Business Profile for the configured phone number.

Returns: Business profile fields: about, address, description, email, websites, vertical, and profile picture URL.

Inputs: response_format.

whatsapp_list_templatesList WhatsApp Message TemplatesA
Read-onlyIdempotent

List message templates for the WhatsApp Business Account. Requires WHATSAPP_BUSINESS_ACCOUNT_ID env var.

Args:

  • limit (number): Max results (default: 20, max: 100)

  • status (string, optional): Filter by APPROVED, PENDING, or REJECTED

Returns: List of templates with name, status, category, language, and components.

Inputs: limit, status, response_format.

whatsapp_mark_as_readMark Message as ReadA
Idempotent

Mark a received WhatsApp message as read (shows blue checkmarks).

Args:

  • message_id (string): The wamid of the message to mark as read

Returns: Confirmation.

Inputs: message_id (required), response_format.

whatsapp_send_buttonsSend Interactive ButtonsA

Send a message with up to 3 reply buttons.

Args:

  • to (string): Recipient phone number

  • body_text (string): Main message body

  • buttons (string): JSON array of buttons: [{"id":"btn1","title":"Yes"},{"id":"btn2","title":"No"}]

  • header_text (string, optional): Header text

  • footer_text (string, optional): Footer text

Returns: Message ID and delivery status.

Inputs: to (required), buttons (required), body_text (required), footer_text, +2 more.

whatsapp_send_contactSend WhatsApp ContactA

Send a contact card to a WhatsApp user.

Args:

  • to (string): Recipient phone number

  • first_name (string): Contact first name

  • last_name (string, optional): Contact last name

  • phone (string): Contact phone number

  • email (string, optional): Contact email

Returns: Message ID and delivery status.

Inputs: to (required), phone (required), first_name (required), email, +2 more.

whatsapp_send_documentSend WhatsApp DocumentA

Send a document (PDF, DOCX, etc.) to a WhatsApp user via a public URL.

Args:

  • to (string): Recipient phone number

  • document_url (string): Public URL of the document

  • filename (string, optional): Display filename

  • caption (string, optional): Document caption

Returns: Message ID and delivery status.

Inputs: to (required), document_url (required), caption, filename, +1 more.

whatsapp_send_imageSend WhatsApp ImageA

Send an image to a WhatsApp user via a public URL.

Args:

  • to (string): Recipient phone number

  • image_url (string): Public URL of the image

  • caption (string, optional): Image caption (max 1024 chars)

Returns: Message ID and delivery status.

Inputs: to (required), image_url (required), caption, response_format.

whatsapp_send_listSend Interactive ListA

Send a message with a menu list of options.

Args:

  • to (string): Recipient phone number

  • body_text (string): Main message body

  • button_text (string): Text on the list menu button

  • sections (string): JSON array of sections with rows

  • header_text (string, optional): Header text

  • footer_text (string, optional): Footer text

Returns: Message ID and delivery status.

Inputs: to (required), sections (required), body_text (required), button_text (required), +3 more.

whatsapp_send_locationSend WhatsApp LocationA

Send a location pin to a WhatsApp user.

Args:

  • to (string): Recipient phone number

  • latitude (number): Latitude (-90 to 90)

  • longitude (number): Longitude (-180 to 180)

  • name (string, optional): Location name

  • address (string, optional): Location address

Returns: Message ID and delivery status.

Inputs: to (required), latitude (required), longitude (required), name, +2 more.

whatsapp_send_reactionReact to WhatsApp MessageA

Send a reaction emoji to an existing message.

Args:

  • to (string): Phone number of the conversation

  • message_id (string): wamid of the message to react to

  • emoji (string): Emoji character (e.g. '👍')

Returns: Confirmation of reaction sent.

Inputs: to (required), emoji (required), message_id (required), response_format.

whatsapp_send_templateSend WhatsApp Template MessageA

Send an approved template message. Templates are the only way to initiate conversations outside the 24-hour window.

Args:

  • to (string): Recipient phone number

  • template_name (string): Approved template name

  • language_code (string): Template language (default: "en_US")

  • components (string, optional): JSON string of template components for dynamic values

Returns: Message ID and delivery status.

Examples:

  • "Send welcome template to user" → template_name="hello_world", language_code="en_US"

Inputs: to (required), template_name (required), components, language_code, +1 more.

whatsapp_send_textSend WhatsApp Text MessageA

Send a text message to a WhatsApp user.

Args:

  • to (string): Recipient phone number in international format

  • body (string): Message text (max 4096 chars)

  • preview_url (boolean): Show URL preview (default: false)

Returns: Message ID and delivery status.

Examples:

  • "Send hello to +353851234567" → to="+353851234567", body="hello"

Inputs: to (required), body (required), preview_url, response_format.

whatsapp_update_business_profileUpdate WhatsApp Business ProfileA
Idempotent

Update the WhatsApp Business Profile fields.

Args:

  • about (string, optional): About text (max 139 chars)

  • address (string, optional): Business address

  • description (string, optional): Description (max 512 chars)

  • email (string, optional): Contact email

  • websites (string, optional): JSON array of website URLs

  • vertical (string, optional): Industry vertical

Returns: Confirmation of update.

Inputs: about, email, address, vertical, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool targets a distinct action: one per message media type (text, image, document, location, contact, reaction, buttons, list), plus mark-as-read and profile/template management. No two tools overlap in purpose, even the interactive buttons and list messages are clearly differentiated by their payload structures.

    Naming Consistency5/5

    All tools follow a uniform 'whatsapp_verb_noun' pattern: send_text, send_image, get_business_profile, list_templates, etc. The snake_case convention is consistently applied, and verbs are descriptive and non-repetitive across the set.

    Tool Count5/5

    13 tools is well within the ideal range for a domain-focused server. The count reflects a comprehensive but not bloated surface: nine send methods, one acknowledgment, two profile operations, and one template listing. Each tool earns its place.

    Completeness4/5

    The core send capabilities are thorough (text, template, media, interactive), and profile management is covered with both get and update. Minor gaps exist: no video/audio send tools and no create/delete template operations, but these are peripheral to the primary send and profile workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers