Add it to Claude Code
claude mcp add whatsapp-mcp-stream -- docker run -i --rm -p 3003:3003 loglux/whatsapp-mcp-streamMake your agent remember this setup
whatsapp-mcp-stream's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- Bidirectional media flow with upload and download capabilities
- Web-based admin UI for QR code authentication and runtime settings
- Comprehensive tools for managing contacts, chats, and group metadata
- Advanced group auditing tools to find overlaps and missing contacts
- Support for idempotency keys in message and media sending
Tools 26
get_qr_codeGet the latest WhatsApp QR code as an image for authentication.check_auth_statusCheck if the WhatsApp client is authenticated and ready.logoutLogout from WhatsApp and clear the current session.search_contactsSearch contacts by name or phone number.resolve_contactResolve a contact by name or phone number.get_contact_by_idGet contact details by JID.get_profile_picGet profile picture URL for a JID.get_group_infoGet group metadata and participants by group JID.list_chatsList chats with metadata and optional last message.get_chat_by_idGet chat metadata by JID.list_groupsList group chats only.get_direct_chat_by_contact_numberResolve a direct chat JID by phone number.get_chat_by_contactResolve a contact by name or phone number and return chat metadata.analyze_group_overlapsFind members that appear across multiple groups.find_members_without_direct_chatFind group members with no direct chat.find_members_not_in_contactsFind group members missing from contacts.run_group_auditRun combined group audit as one routine operation.list_messagesGet messages from a specific chat.search_messagesSearch messages by text.get_message_by_idGet a specific message by ID.get_message_contextGet recent messages around a specific message.get_last_interactionGet the most recent message for a JID.send_messageSend a text message to a person or group.send_mediaSend media (image/video/document/audio).download_mediaDownload media from a message.pingHealth check tool.Environment Variables
MEDIA_DIRDirectory for storing media filesSETTINGS_PATHPath to the settings JSON fileMCP_BASE_URLBase URL for the MCP endpointTry it
Original README from loglux/whatsapp-mcp-stream
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
/mcp - Engine: Baileys
- Admin UI: QR, status, logout, runtime settings
- Media: upload endpoints +
/mediahosting + MCP download tool
Quick Start (Docker)
# build and run
docker compose build
docker compose up -d
The server will be available at:
- Admin UI:
http://localhost:3003/admin - MCP endpoint:
http://localhost:3003/mcp - Media files:
http://localhost:3003/media/<filename>
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, 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-gateway
Media 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.
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-RPCinitialize- Use the returned
mcp-session-idheader for subsequent requests POST /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:mcp
Optional custom target:
MCP_BASE_URL=http://localhost:3003 npm run smoke:mcp
MCP Tools
Auth
| Tool | Description |
|---|---|
get_qr_code |
Get the latest WhatsApp QR code as an image for authentication. |
check_auth_status |
Check if the WhatsApp client is authenticated and ready. |
logout |
Logout from WhatsApp and clear the current session. |
Contacts
| Tool | Description |
|---|---|
search_contacts |
Search contacts by name or phone number. |
resolve_contact |
Resolve a contact by name or phone number (best matches). |
get_contact_by_id |
Get contact details by JID. |
get_profile_pic |
Get profile picture URL for a JID. |
get_group_info |
Get group metadata and participants by group JID. |
Chats
| Tool | Description |
|---|---|
list_chats |
List chats with metadata and optional last message. |
get_chat_by_id |
Get chat metadata by JID. |
list_groups |
List group chats only. |
get_direct_chat_by_contact_number |
Resolve a direct chat JID by phone number. |
get_chat_by_contact |
Resolve a contact by name or phone number and return chat metadata. |
analyze_group_overlaps |
Find members that appear across multiple groups. |
find_members_without_direct_chat |
Find group members with no direct chat. |
find_members_not_in_contacts |
Find group members missing from contacts. |
run_group_audit |
Run combined group audit as one routine operation. |
Messages
| Tool | Description |
|---|---|
list_messages |
Get messages from a specific chat. |
search_messages |
Search messages by text (optionally scoped to a chat). |
get_message_by_id |
Get a specific message by ID (jid:id). |
get_message_context |
Get recent messages around a specific message. |
get_last_interaction |
Get the most recent message for a JID. |
send_message |
Send a text message to a person or group. Supports optional idempotency_key. |
Media
| Tool | Description |
|---|---|
send_media |
Send media (image/video/document/audio). Supports optional idempotency_key. |
download_media |
Download media from a message. |
Utility
| Tool | Description |
|---|---|
ping |
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.