All configuration for WhatsApp MCP API is done through environment variables — there is no configuration file to edit. Simply set the relevant variables in your shell or process manager before runningDocumentation 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.
npm start, and the server picks them up automatically. Any variable that is not set falls back to a sensible default so the server works out of the box on Windows without any configuration at all.
Environment Variables
| Variable | Default | Description |
|---|---|---|
WHATSAPP_MCP_HOST | 127.0.0.1 | The network interface the HTTP server binds to. Change to 0.0.0.0 to listen on all interfaces. |
WHATSAPP_MCP_PORT | 8790 | The TCP port the server listens on. |
WHATSAPP_AUTH_DIR | .wwebjs_auth in the repository root (one level above whatsapp-mcp-api/) | Directory where the WhatsApp Web Linked Devices session (Chromium profile) is persisted. |
WHATSAPP_CHROME_EXECUTABLE | C:\Program Files\Google\Chrome\Application\chrome.exe | Absolute path to the Chrome or Chromium binary that Puppeteer will launch. |
WHATSAPP_HEADLESS | false | Set to true to run Chrome in headless mode. Useful on servers without a display. |
Setting Variables
Set the variables for your platform before starting the server withnpm start.
- PowerShell (Windows)
- Bash (Linux/macOS)
Chrome / Chromium Path
WhatsApp MCP API launches a real Chrome or Chromium browser via Puppeteer to drive the WhatsApp Web session. You must pointWHATSAPP_CHROME_EXECUTABLE to an existing browser binary on your system.
Platform defaults and typical paths:
| Platform | Typical path |
|---|---|
| Windows | C:\Program Files\Google\Chrome\Application\chrome.exe (default) |
| macOS | /Applications/Google Chrome.app/Contents/MacOS/Google Chrome |
| Linux (Chrome) | /usr/bin/google-chrome |
| Linux (Chromium) | /usr/bin/chromium or /usr/bin/chromium-browser |
WHATSAPP_CHROME_EXECUTABLE explicitly — otherwise the server will fail to launch the browser and the WhatsApp session cannot be established.
Setting WHATSAPP_HEADLESS=true tells Puppeteer to run Chrome without a visible window. This is required on headless Linux servers (e.g. a VPS or Docker container) that have no graphical display available.
Auth Directory
TheWHATSAPP_AUTH_DIR variable controls where the WhatsApp Web Linked Devices session data is stored. The server uses whatsapp-web.js’s LocalAuth strategy, which saves a full Chromium user-data profile containing the linked-device credentials.
- Default location:
whatsapp-api/.wwebjs_auth/session-default(one level above thewhatsapp-mcp-api/server directory) - The directory is created automatically on first run.
- After a successful pairing, this directory holds your linked-device credentials. The server reads it on every startup to restore the session without requiring a new pairing code.
- Do not delete this directory while you want to keep the session active. Deleting it means the Linked Device is orphaned and you will need to pair again.
- The
.wwebjs_authfolder is intentionally excluded from git (.gitignore) because it contains sensitive session tokens. Back it up separately if you need to migrate your setup to another machine.