Skip to main content

Documentation 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.

WhatsApp MCP API is a self-hosted Node.js server that links your personal WhatsApp account through WhatsApp Linked Devices, stores the session locally, and exposes messaging capabilities over a REST API and an MCP-over-HTTP endpoint. Once paired, you can send messages, list chats, and read message history programmatically — without manually opening WhatsApp Web each time.

Quickstart

Clone, install, pair, and send your first message in minutes.

Configuration

Customize host, port, auth directory, and Chrome settings via environment variables.

REST API Reference

Explore every REST endpoint — status, send, chats, messages, and more.

MCP Endpoint

Use the MCP-over-HTTP endpoint to integrate WhatsApp tools into AI agents.

How It Works

WhatsApp MCP API uses whatsapp-web.js, an unofficial WhatsApp Web client, to establish a Linked Devices session. After a one-time phone-number pairing step, the session is persisted locally in .wwebjs_auth/ so the server reconnects automatically on restart.
1

Install the server

Clone the repository and run npm install inside whatsapp-mcp-api/.
2

Start the server

Run npm start. The server listens at http://127.0.0.1:8790 by default.
3

Pair your WhatsApp account

Request a pairing code via POST /api/pairing-code and enter it in WhatsApp under Linked devices → Link with phone number.
4

Send messages

Call POST /api/send with a phone number and message body — or use the MCP endpoint from your AI agent.

Key Features

Phone-number pairing

Pair without scanning a QR code — request a numeric code and enter it on your phone.

Persistent session

Auth state is saved locally so the server reconnects automatically after restarts.

REST API

Full REST API for status checks, sending messages, listing chats, and reading history.

MCP-over-HTTP

JSON-RPC 2.0 MCP endpoint with 7 WhatsApp tools for AI agent integration.
This project uses an unofficial WhatsApp Web client. Use it only with accounts and recipients you control or have explicit permission to message. Automated WhatsApp use may violate WhatsApp Terms of Service.

Build docs developers (and LLMs) love