WhatsApp MCP Stream
Provides tools for interacting with WhatsApp, including authentication via QR code, managing contacts, chats, and groups, sending and receiving text and media messages, and searching messages.
Click on "Install 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 StreamSend a WhatsApp message to Mom saying I'll be late"
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 Stream
A WhatsApp MCP server built around Streamable HTTP transport, using Baileys for WhatsApp connectivity, with a web admin UI and bidirectional media flow (upload + download).
Key points:
Transport: Streamable HTTP at
/mcpEngine: Baileys
Admin UI: QR, status, logout, runtime settings, chat history viewer
Media: upload endpoints +
/mediahosting + MCP download tool
Quick Start (Docker)
# build and run
docker compose build
docker compose up -dThe server will be available at:
Admin UI:
http://localhost:3003/adminMCP endpoint:
http://localhost:3003/mcpMedia files:
http://localhost:3003/media/<filename>
Related MCP server: lingtai-whatsapp
DNS on hosts with --iptables=false
On some NAS / hardened hosts (e.g. Synology with dockerd --iptables=false), Docker's embedded DNS proxy (127.0.0.11) has no iptables DNAT rules and refuses connections inside containers.
Fix: copy resolv.conf.example to resolv.conf and add a volume override:
cp resolv.conf.example resolv.confThen add to a local docker-compose.override.yml (not committed):
services:
mcp-whatsapp:
volumes:
- ./resolv.conf:/etc/resolv.conf:rodocker compose up picks up the override automatically.
Runtime Settings
Settings can be edited in the admin UI and are persisted to SETTINGS_PATH (defaults to MEDIA_DIR/settings.json).
Admin UI
Admin console with runtime settings, QR linking, chat history viewer, export, and status.
Supported settings:
media_public_base_urlupload_max_mbupload_enabledmax_files_per_uploadrequire_upload_tokenupload_tokenauto_download_mediaauto_download_max_mb
Authentication
Built-in authentication is not implemented yet. In production, use a gateway that enforces auth. This project works well behind authmcp-gateway:
https://github.com/loglux/authmcp-gatewayMedia Upload API
Base64 JSON:
curl -X POST http://localhost:3003/api/upload \
-H "Content-Type: application/json" \
-d {filename:photo.jpg,mime_type:image/jpeg,data:<base64>}Multipart (recommended for large files):
curl -X POST http://localhost:3003/api/upload-multipart \
-F "file=@/path/to/file.jpg"Both return url and (if configured) publicUrl.
Sending Local Files via send_media
The ./files/ directory in the project root is bind-mounted into the container at /app/files. Drop any file there and reference it immediately — no container restart needed:
# On host:
cp report.pdf /path/to/whatsapp-mcp-stream/files/
# In send_media:
media_path: /app/files/report.pdfFor a URL source, pass media_url directly to send_media or stage_media — the server downloads the file itself without base64.
Upload Auth (Optional)
If require_upload_token=true, provide a token with either:
x-upload-token: <token>Authorization: Bearer <token>
MCP Transport
The server exposes Streamable HTTP at /mcp.
Typical flow:
POST /mcpwith JSON-RPCinitializeUse the returned
mcp-session-idheader for subsequent requestsPOST /mcpfor tool calls
Note: clients must send Accept: application/json, text/event-stream on initialize.
Smoke Test
Quick regression smoke for MCP tools:
npm run smoke:mcpOptional custom target:
MCP_BASE_URL=http://localhost:3003 npm run smoke:mcpMCP Tools
Auth
Tool | Description |
| Get the latest WhatsApp QR code as an image for authentication. |
| Check if the WhatsApp client is authenticated and ready. |
| Logout from WhatsApp and clear the current session. |
Contacts
Tool | Description |
| Search contacts by name or phone number. |
| Resolve a contact by name or phone number (best matches). |
| Get contact details by JID. |
| Get profile picture URL for a JID. |
| Get group metadata and participants by group JID. |
Chats
Tool | Description |
| List chats with metadata and optional last message. |
| Get chat metadata by JID. |
| List group chats only. |
| Resolve a direct chat JID by phone number. |
| Resolve a contact by name or phone number and return chat metadata. |
| Find members that appear across multiple groups. |
| Find group members with no direct chat. |
| Find group members missing from contacts. |
| Run combined group audit as one routine operation. |
Messages
Tool | Description |
| Get messages from a specific chat. |
| Search messages by text (optionally scoped to a chat). |
| Get a specific message by ID ( |
| Get recent messages around a specific message. |
| Get the most recent message for a JID. |
| Send a text message to a person or group. Supports optional |
Media
Tool | Description |
| Send media (image/video/document/audio). Accepts |
| Save a file to the server's media directory and return its local path. Use the returned |
| Download media from a message. |
Utility
Tool | Description |
| Health check tool. |
Recovery Notes
This service contains an intentional recovery workaround for Baileys/WhatsApp session-state corruption.
Why it exists:
In production we observed cases where the container stayed alive and MCP still answered, but the WhatsApp session was functionally broken.
The most common indicators were Baileys errors like
failed to find key ... to decode mutationandfailed to sync state from version.In that state, a manual container restart often restored service.
Current behavior:
On app-state corruption signals, the service first tries a soft recovery with
forceResync().If the same class of failure repeats within a time window, it escalates to an internal WhatsApp client restart.
On disconnects such as
Connection Terminated, the service schedules a disconnect watchdog and escalates to an internal restart if the socket does not return toopenin time.The reconnect lifecycle is guarded against nested lock deadlocks, so disconnect recovery can complete without requiring a manual container restart.
Recent production observations show repeated socket disconnects (
428 Connection Terminated,503 Stream Errored) being auto-recovered back toopen.A dedicated
/healthzendpoint reports503only when the service is genuinely stuck outside the allowed recovery window.Docker health checks use
/healthz, so the container is restarted only after in-process recovery has had a chance to work.
These recovery mechanisms reduce operator intervention and improve resilience against common WhatsApp/Baileys session failures.
License
MIT
Persistence
Chats and messages are persisted to a local SQLite database stored in the session volume.
Environment variables:
Variable | Default | Description |
|
| SQLite database path for chats/messages persistence. |
|
| Enable detailed WhatsApp event logs. |
|
| Write raw Baileys event stream to a file for deep debugging. |
|
| File path for the event stream log. |
|
| Enable reconnect safety net after force resync. |
|
| Delay before reconnect after force resync (ms). |
|
| Minimum delay between automatic app-state recoveries. |
|
| Time window used to count repeated app-state corruption failures. |
|
| Number of soft recoveries before escalating to an internal restart. |
|
| Grace period during recovery/disconnect before |
|
| How long to wait after a socket close before the disconnect watchdog forces reconnect/restart. |
|
| Comma-separated disconnect status codes that should escalate straight to an internal restart watchdog. |
|
| Suppress exact duplicate |
|
| How long completed |
|
| Max in-memory entries for message index ( |
|
| Max in-memory entries for message key index ( |
|
| Race the WhatsApp client initialise against this deadline; set to |
|
| Max parallel auto-downloads. Auto-download runs through an in-process bounded queue so a burst of inbound media cannot saturate the I/O. |
|
| Max queued auto-download jobs. Excess is dropped FIFO (oldest first) with a warning log; recent messages stay prioritised. |
|
| Use direct JSON responses for Streamable HTTP POST requests by default. Set to |
Additional transport diagnostics:
/mcpPOST requests now log request lifecycle events inlogs/mcp-whatsapp.logthis includes request entry, transport dispatch,
transport.handleRequestcompletion, and HTTPfinish/closeuse these logs to determine whether latency happens before the response leaves
whatsapp-mcp-streamor after that on the gateway/client side
Chat History API
Browse stored chats and messages via:
GET /api/chats?limit=50&offset=0&q=<search> — paginated chat list, optionally filtered by name.
GET /api/chats/:jid/messages?limit=50&offset=0 — paginated messages for a chat (newest first).
Both endpoints are used by the Chats tab in the admin UI.
Export
Export a chat (JSON + optional downloaded media) via:
GET /api/export/chat/:jid?include_media=true
If include_media=true, the ZIP includes files already downloaded via download_media. It does not fetch missing media from WhatsApp.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables WhatsApp automation through MCP protocol, allowing users to manage sessions, send messages, handle groups/communities, and access contacts through natural language interactions with AI agents.11

lingtai-whatsappofficial
AlicenseNot gradedqualityFmaintenanceMCP server for interacting with the official Meta WhatsApp Business Platform/Cloud API, enabling sending messages, managing contacts, templates, and handling webhook callbacks.Apache 2.0- AlicenseNot gradedqualityDmaintenanceEnables sending messages, managing templates, uploading media, and configuring webhooks for WhatsApp Business via the MCP protocol.105MIT
- AlicenseNot gradedqualityCmaintenanceIntegrates WhatsApp with AI agents, enabling message sending, chat search, media sharing, approval workflows, and activity summaries via any MCP client.1Apache 2.0
Related MCP Connectors
Search, document and execute authenticated API calls across 700+ apps via one MCP server
Give AI agents real phone numbers, messages, and voice calls via MCP.
Instagram, WhatsApp and Messenger DMs through official Meta Business APIs.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BusinessNone/WhatsAppMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server