WhatsApp MCP Server

WhatsApp MCP Server

A self-hosted Model Context Protocol (MCP) server that bridges WhatsApp Web to Poke via Server-Sent Events (SSE).

Category
Visit Server

README

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


Quick Start

1. Clone and build

git clone <your-repo>
cd whatsapp-mcp-server
docker compose up --build

2. Scan the QR code

Watch the container logs for a terminal QR code:

docker compose logs -f

Open WhatsApp on your phone → Linked DevicesLink 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

  1. Go to https://poke.com/integrations/new

  2. Choose MCP / SSE integration

  3. Enter the SSE URL:

    http://<your-server-ip>:3000/sse
    
  4. Save. Poke will open the SSE stream and discover all four tools automatically.


MCP Tools

Tool Description Inputs
read_chats List recent chats contact_name? (string), limit? (1–100, default 20)
send_message Send a message recipient_id (string), message_body (string)
search_messages Search message bodies query (string)
list_contacts All contacts with IDs (none)

Recipient ID format

send_message accepts either:

  • Full serialized ID: 923001234567@c.us
  • Plain international number: 923001234567

Endpoints

Endpoint Method Purpose
/health GET Liveness check + WA status
/qr GET Returns QR as JSON (for custom UIs)
/sse GET SSE stream — register this in Poke
/messages?sessionId= POST MCP message endpoint (used by SDK)

Configuration

Set via environment variables or edit docker-compose.yml:

Variable Default Description
PORT 3000 HTTP port
SESSION_PATH /app/session WhatsApp session storage path
NODE_ENV production Node environment

Session Persistence

The WhatsApp session is stored in a named Docker volume:

volumes:
  whatsapp_session:
    driver: local

To 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 /data

Production Tips

  • Reverse proxy: Put Nginx/Caddy in front with HTTPS so Poke connects over https://yourdomain.com/sse
  • Firewall: 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 files
  • Re-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 logsdocker 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)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured