WhatsApp Messaging API by Retention Stack
Allows sending WhatsApp messages, images, and files by creating and managing WhatsApp sessions authenticated via QR code or pairing code, checking if contacts exist on WhatsApp, and checking session status.
WhatsApp Messaging API — MCP Server
Send WhatsApp messages from Claude, Cursor, or any MCP client. Create a session, scan a QR code, and send text, images and files — no Meta Business approval and no WhatsApp Business account required.
Wraps the WhatsApp Messaging API by Retention Stack.
Quick start
Sign in at whatsapp-messaging.retentionstack.agency/start (free tier, no credit card) and copy a key from the console:
a session token (
ch_live_...) for one number. Tools then need no session name.an account key (
ak_live_...) for every number on your account. Needed forcreate_session; passsessionto the other tools.
Add this to your MCP client config (Claude Desktop:
claude_desktop_config.json):{ "mcpServers": { "whatsapp": { "command": "npx", "args": ["-y", "whatsapp-messaging-api-mcp"], "env": { "WHATSAPP_API_KEY": "ch_live_your_session_token" } } } }Restart the client. Ask it to create a WhatsApp session and show you the QR code.
Nothing to install or build — npx fetches the package on first run.
Related MCP server: whatsapp-mcp
Tools
Tool | Description |
| List all sessions on this API key |
| Create a new session (account key only) |
| Check a session's current status |
| Get the QR code to authenticate a session |
| Get an 8-digit pairing code instead of a QR |
| Check if a phone number is on WhatsApp before sending |
| Send a text message |
| Send an image via URL |
| Send a file (PDF, document) via URL |
Typical flow
create_session→get_qr_code→ scan with WhatsApp (Settings → Linked Devices)get_session_statusuntil it reportsWORKING. If it reportsPASSKEY_REQUIREDorPASSKEY_CONFIRMATION_REQUIRED, finish linking in the console: the passkey is signed in a browser, which an MCP client cannot do.check_contact_exists, thensend_text_message/send_image/send_file
Sessions stay authenticated between runs, so steps 1-2 are one-time per number.
Configuration
Variable | Required | Description |
| yes | A session token ( |
The key is read from the environment and sent only to the API host. It is never logged.
Upgrading from 1.x: earlier versions used a RapidAPI key, which no longer works. Replace it with a session token or account key from the console.
Local development
git clone https://github.com/jevil25/whatsapp-messaging-api-mcp.git
cd whatsapp-messaging-api-mcp
npm install
npm run dev # runs src/index.ts directly via tsx, no build step
npm run build # compile to dist/
npm test # boots the built server and drives a real MCP handshakenpm test needs no credentials — it passes a dummy key, which gets far enough to
list tools because nothing in the handshake makes an API call.
To point an MCP client at your local build, use "command": "node" with
"args": ["/absolute/path/to/dist/index.js"].
See DEVELOPING.md for the release process.
Links
MCP registry entry —
io.github.jevil25/whatsapp-messaging-api-mcp
License
MIT
Available Tools
9 toolscheck_contact_existsB
Check whether a phone number is registered on WhatsApp before sending to it.
Inputs: phone (required), session.
create_sessionA
Create a new WhatsApp session. Needs an account key (ak_live_...). Returns the session name and its own session token; pair it with get_qr_code next.
Inputs: no named parameters.
get_qr_codeB
Get the QR code to authenticate a session by scanning with WhatsApp (Settings > Linked Devices).
Inputs: session.
get_session_statusA
Get the current status of a session (STARTING, SCAN_QR_CODE, WORKING, FAILED, STOPPED, PASSKEY_REQUIRED, PASSKEY_CONFIRMATION_REQUIRED). PASSKEY_* means WhatsApp wants a passkey, which must be signed in a browser: tell the user to finish linking at https://whatsapp-messaging.retentionstack.agency/app. These tools cannot do it.
Inputs: session.
list_sessionsA
List all WhatsApp sessions belonging to this API key.
Inputs: no named parameters.
request_pairing_codeB
Request an 8-digit pairing code as an alternative to scanning a QR code.
Inputs: phoneNumber (required), session.
send_fileB
Send a file (PDF, document, etc.) to a contact, group, or channel via a public URL.
Inputs: chatId (required), fileUrl (required), session, filename.
send_imageB
Send an image to a contact, group, or channel via a public URL.
Inputs: chatId (required), imageUrl (required), caption, session.
send_text_messageB
Send a WhatsApp text message to a contact, group, or channel.
Inputs: text (required), chatId (required), session.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct resource+action: session lifecycle (create/list/status/QR/pairing), contact verification, and three clearly separated send operations by media type. The only near-pair, get_qr_code vs request_pairing_code, is explicitly framed as alternative authentication methods in the descriptions.
All nine tools follow a strict snake_case verb_noun pattern (check_contact_exists, create_session, get_qr_code, list_sessions, request_pairing_code, send_text_message, etc.). No camelCase or vague bare verbs anywhere.
Nine tools is well within the ideal 3-15 range and each maps to a concrete step in the session-setup or message-sending workflow. Nothing feels padded or redundant.
Sending is well covered (text, image, file) and session creation/authentication is complete, but the lifecycle has a dead end: no stop_session, logout, or delete_session despite get_session_status reporting STOPPED, and no tool to read/receive messages or manage groups/channels. Agents can set up and send but cannot tear down a session or ingest inbound traffic.
Maintenance
Related MCP Connectors
Drive WhatsApp from any MCP client: pair devices, send text and media, manage contacts and groups.
WhatsMCP connects Claude and other MCP-compatible AI agents directly to WhatsApp. Send and receive text, images, documents, and voice notes; manage groups (create, add/remove members, promote admins); look up contacts and profiles; follow channels; and read call and message history — all through a standard MCP interface. For voice use cases, WhatsMCP offers SIP-based calling plans (inbound-only, or full inbound/outbound) so AI voice agents can answer and place WhatsApp calls, plus low-latency WebSocket integrations with voice agent providers like ElevenLabs. Multiple WhatsApp accounts can be paired and managed per workspace, with webhook support for real-time inbound message delivery to your own infrastructure.
Link a WhatsApp number by QR code and use it from Claude or ChatGPT via MCP.
Hosted WhatsApp MCP server: send and read messages from your own linked number. OAuth sign-in.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables sending messages, managing templates, uploading media, and configuring webhooks for WhatsApp Business via the MCP protocol.5-
- AlicenseAqualityCmaintenanceEnables sending WhatsApp messages from MCP clients using a personal WhatsApp account via WebSocket protocol, without needing the Business API or browser automation.5MIT
- AlicenseAqualityBmaintenanceEnables agents and MCP clients to read and send WhatsApp messages and media, search chats, and manage contacts and groups after a one-time QR pairing.13MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to read, search, and send personal WhatsApp messages and files through a locally linked device.49 npmMIT