WhatsApp MCP Server
Provides tools to interact with WhatsApp, including sending messages, listing chats, searching messages, and managing contacts through WhatsApp Web.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WhatsApp MCP Serversend a message to +923001234567 saying Hello"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
WhatsApp MCP Server for Poke
A self-hosted Model Context Protocol (MCP) server that bridges WhatsApp Web to Poke via Server-Sent Events (SSE).
Architecture
WhatsApp Web ──(Puppeteer)──▶ whatsapp-web.js
│
WhatsAppManager
│
MCP Tools (4 tools)
│
Express SSE Transport
│
http://localhost:3000/sse
│
◀── Poke ──▶Stack: Node.js · TypeScript · @modelcontextprotocol/sdk · whatsapp-web.js · Puppeteer · Docker
Related MCP server: WhatsApp MCP
Quick Start
1. Clone and build
git clone <your-repo>
cd whatsapp-mcp-server
docker compose up --build2. Scan the QR code
Watch the container logs for a terminal QR code:
docker compose logs -fOpen WhatsApp on your phone → Linked Devices → Link a Device → scan the QR.
The session is saved in a Docker volume (whatsapp_session) and persists across restarts.
3. Verify the server is ready
curl http://localhost:3000/health
# {"status":"ok","whatsapp":{"ready":true,"qrPending":false}}4. Register in Poke
Choose MCP / SSE integration
Enter the SSE URL:
http://<your-server-ip>:3000/sseSave. Poke will open the SSE stream and discover all four tools automatically.
MCP Tools
Tool | Description | Inputs |
| List recent chats |
|
| Send a message |
|
| Search message bodies |
|
| All contacts with IDs | (none) |
Recipient ID format
send_message accepts either:
Full serialized ID:
923001234567@c.usPlain international number:
923001234567
Endpoints
Endpoint | Method | Purpose |
| GET | Liveness check + WA status |
| GET | Returns QR as JSON (for custom UIs) |
| GET | SSE stream — register this in Poke |
| POST | MCP message endpoint (used by SDK) |
Configuration
Set via environment variables or edit docker-compose.yml:
Variable | Default | Description |
|
| HTTP port |
|
| WhatsApp session storage path |
|
| Node environment |
Session Persistence
The WhatsApp session is stored in a named Docker volume:
volumes:
whatsapp_session:
driver: localTo back it up:
docker run --rm \
-v whatsapp-mcp-server_whatsapp_session:/data \
-v $(pwd):/backup \
alpine tar czf /backup/session-backup.tar.gz -C /data .To restore:
docker run --rm \
-v whatsapp-mcp-server_whatsapp_session:/data \
-v $(pwd):/backup \
alpine tar xzf /backup/session-backup.tar.gz -C /dataProduction Tips
Reverse proxy: Put Nginx/Caddy in front with HTTPS so Poke connects over
https://yourdomain.com/sseFirewall: Only expose port 3000 to trusted IPs or hide behind a reverse proxy
Logs:
docker compose logs -f whatsapp-mcp— structured JSON logs rotated at 10 MB × 3 filesRe-authentication: If WhatsApp logs out, delete the session volume and restart to get a fresh QR
Troubleshooting
Container crashes with error while loading shared libraries: libnss3.so
→ The Dockerfile installs libnss3 automatically. Rebuild: docker compose build --no-cache
QR not appearing in logs
→ docker compose logs -f — give it 30–60 s to start Chromium
WhatsApp client is not ready
→ Hit /health to check status, then /qr to retrieve the current QR if pending
Poke can't reach the SSE URL → Make sure port 3000 is accessible from Poke's servers (check firewall / security groups)
This server cannot be deployed
Maintenance
Related MCP Connectors
Your own WhatsApp as an MCP server: read, search and send from any MCP client.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
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.
Related MCP Servers
- AlicenseCqualityFmaintenanceA Model Context Protocol server that connects your personal WhatsApp account to AI agents like Claude, enabling them to search messages, view contacts, retrieve chat history, and send messages via WhatsApp.73 npm74ISC
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables interaction with WhatsApp through local stdio or remote HTTP/SSE connections. It allows users to send messages, manage groups, and access chat history using natural language.35 npm3MIT
- FlicenseNot gradedqualityNot gradedmaintenanceA self-hosted MCP server that connects AI clients to WhatsApp via the WAHA HTTP API. It enables users to manage sessions, search contacts, and send or receive messages and media directly through natural language interfaces.18 npm-
- AlicenseNot gradedqualityAmaintenanceA self-hosted WhatsApp bridge that exposes a stdio MCP server with ~20 tools for reading conversations, sending messages, managing groups, contacts, and aliases, enabling AI agents to operate WhatsApp directly.2MIT