This guide walks you through everything you need to get WhatsApp MCP API running locally — from cloning the repository to sending your very first WhatsApp message via the REST API. By the end, your server will be listening onDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jihvijhojhviihogyuvi/whatsapp-api/llms.txt
Use this file to discover all available pages before exploring further.
http://127.0.0.1:8790, your phone will be linked, and you’ll have confirmed a successful message send.
Prerequisites before you begin:
- Node.js >= 20 — check with
node --version - Google Chrome installed on the machine running the server (the server drives Chrome via Puppeteer)
- A WhatsApp-registered phone number you can access to enter the pairing code
Install dependencies
Navigate into the server directory and install the Node.js dependencies:This installs
whatsapp-web.js, qrcode, qrcode-terminal, and all other required packages listed in package.json.Start the server
Start the server with the default configuration:The server starts and binds to Chrome will open in the background so it can handle the WhatsApp Web session.
http://127.0.0.1:8790. You will see output similar to:Request a pairing code
With the server running, request a Linked Devices pairing code for your phone number. Include the full country code (no A successful response returns a pairing code, for example:
+ prefix, no spaces or dashes):Your WhatsApp phone number including country code, digits only. Example:
15551234567 for a US number. No +, spaces, or dashes.Link your phone
Open WhatsApp on your phone and navigate to:Enter the pairing code returned in the previous step. WhatsApp will confirm the device is linked within a few seconds, and the server logs will show:
Send your first message
To verify the server is running and check the current WhatsApp connection state at any time, call the root health endpoint:The response includes
ok: true, the MCP endpoint URL, and a full status object describing the WhatsApp client state (e.g. ready, qr, authenticated, disconnected).