# WhatsApp Messaging API [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/jevil25/whatsapp-messaging-api-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 539  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/whatsapp-messaging-api

## Description
Send WhatsApp messages from Claude. No Meta Business approval or WhatsApp Business account.

## Tools
Capabilities this server exposes over MCP:

- **list_sessions** — List all WhatsApp sessions belonging to this API key.
- **create_session** — Create a new WhatsApp session. Returns a session name and STARTING status — pair it with get_qr_code next.
- **get_session_status** — Get the current status of a session (STARTING, SCAN_QR_CODE, WORKING, FAILED, STOPPED).
- **get_qr_code** — Get the QR code to authenticate a session by scanning with WhatsApp (Settings > Linked Devices).
- **request_pairing_code** — Request an 8-digit pairing code as an alternative to scanning a QR code.
- **check_contact_exists** — Check whether a phone number is registered on WhatsApp before sending to it.
- **send_text_message** — Send a WhatsApp text message to a contact, group, or channel.
- **send_image** — Send an image to a contact, group, or channel via a public URL.
- **send_file** — Send a file (PDF, document, etc.) to a contact, group, or channel via a public URL.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "whatsapp-messaging-api": {
    "command": "npx",
    "args": ["-y","whatsapp-messaging-api-mcp"],
    "env": {
      "WHATSAPP_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `WHATSAPP_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What WhatsApp Messaging API does

WhatsApp Messaging API exposes WhatsApp account and messaging operations as MCP tools. It connects to the WhatsApp Messaging API operated by Retention Stack and lets an MCP client create or inspect sessions, complete authentication, check phone-number registration, and send media or text.

Messages can target individual contacts, groups, or channels. Supported outbound content includes plain text, images referenced by public URL, and files such as PDFs or other documents referenced by public URL.

## How it works

The normal setup flow is to create a session, obtain its QR code, scan that code in WhatsApp under Settings > Linked Devices, and poll the session until its status is `WORKING`. Pairing-code authentication is available as an alternative to scanning: `request_pairing_code` returns an 8-digit code.

A session can report states including `STARTING`, `SCAN_QR_CODE`, `WORKING`, `FAILED`, and `STOPPED`. Some linking flows may require `PASSKEY_REQUIRED` or `PASSKEY_CONFIRMATION_REQUIRED`; those steps are completed in the Retention Stack console because an MCP client cannot sign in to the passkey through a browser.

Once authenticated, sessions remain linked between runs, so the QR or pairing step is generally needed only once per number. Before sending, call `check_contact_exists` when you need to verify that a phone number is registered on WhatsApp.

## Setup and configuration

Create an account at the Retention Stack WhatsApp Messaging API console and copy a key. A session token beginning with `ch_live_` is associated with one number and lets the tools operate without a session name. An account key beginning with `ak_live_` covers the numbers on an account, is required for `create_session`, and requires the relevant session to be passed to the other tools.

Run the package through `npx` in the MCP client configuration:

```json
{
  "mcpServers": {
    "whatsapp": {
      "command": "npx",
      "args": ["-y", "whatsapp-messaging-api-mcp"],
      "env": {
        "WHATSAPP_API_KEY": "ch_live_your_session_token"
      }
    }
  }
}
```

Restart the client after adding the entry. `WHATSAPP_API_KEY` is required; the server exits at startup if it is absent. The key is read from the environment, sent to the API host, and not logged.

## Tools and capabilities

- `list_sessions` returns sessions associated with the API key.
- `create_session` starts a session and returns its name and initial status.
- `get_session_status` reports the state of a session.
- `get_qr_code` retrieves the authentication QR code.
- `request_pairing_code` provides an alternative 8-digit linking code.
- `check_contact_exists` checks whether a number is registered on WhatsApp.
- `send_text_message` sends text to a contact, group, or channel.
- `send_image` sends an image from a public URL.
- `send_file` sends a file from a public URL.

## Limitations and notes

An account key is needed to create sessions, while a session token is intended for one number. Public URLs are required for image and file delivery. Older RapidAPI keys from 1.x configurations no longer work; use a session token or account key from the console instead.

_Full upstream README: https://allmcps.com/mcp/whatsapp-messaging-api/readme_

