What loglux/whatsapp-mcp-stream MCP server does
loglux/whatsapp-mcp-stream MCP server exposes WhatsApp operations through an MCP endpoint at /mcp. It uses Baileys for the WhatsApp connection and includes a browser-based administration page at /admin for QR authentication, connection status, logout, runtime settings, and chat history.
The tool set covers the main objects an agent may need to work with: contacts, individual and group chats, messages, and media. It can search or resolve contacts, inspect chat metadata, list messages, search message text, retrieve message context, and send text or media. Group-oriented tools can identify overlapping members, members without direct chats, and members absent from contacts, or run those checks together as a group audit.
Chat and message data are stored in a local SQLite database located in the session volume. Media can move in both directions: the server can receive uploaded files, send media from a path, URL, or base64 content, and download media from a WhatsApp message.
How it works
The service uses Streamable HTTP rather than a local stdio process. An MCP client first sends an initialize request to /mcp, including Accept: application/json, text/event-stream, then uses the returned mcp-session-id for later tool calls.
WhatsApp authentication begins with get_qr_code; check_auth_status reports whether the client is ready. Once authenticated, tools address contacts and chats using identifiers such as WhatsApp JIDs. send_message handles text, while send_media accepts media_path, media_url, or base64 media_content. Optional idempotency keys are supported for both sending operations.
For larger files or repeated sends, stage_media stores a file in the server media directory and returns a path for later use. The HTTP API also supports JSON base64 uploads and multipart uploads. Uploaded or hosted files can be exposed through /media, depending on configuration.
Setup and configuration
The documented Docker startup path is docker compose build followed by docker compose up -d. After startup, the default admin address is http://localhost:3003/admin, the MCP endpoint is http://localhost:3003/mcp, and hosted media uses http://localhost:3003/media/<filename>.
Runtime settings are editable in the admin UI and saved to SETTINGS_PATH, which defaults to a file under MEDIA_DIR. Supported settings control the public media URL, upload size and count limits, upload enablement, optional upload-token enforcement, and automatic media downloads and their size limit.
loglux/whatsapp-mcp-stream MCP server does not implement built-in authentication. A production deployment should place it behind an authentication gateway. If upload-token enforcement is enabled, upload requests can provide the token through x-upload-token or an Authorization: Bearer header.
On hosts where Docker runs with --iptables=false, the repository documents an optional mounted resolv.conf workaround for container DNS resolution. The service also provides /healthz for health checks and includes recovery handling for several Baileys synchronization and disconnect failures.
Tools and capabilities
- Authenticate, check readiness, and log out of WhatsApp.
- Search, resolve, and inspect contacts, profile pictures, groups, and chats.
- List, search, retrieve, and inspect message context.
- Send text to people or groups.
- Send image, video, document, and audio media.
- Stage files, download message media, and run a ping health check.
- Audit group membership relationships and contact coverage.
- Persist chats and messages in SQLite.
Limitations and notes
The service requires a WhatsApp session to be authenticated before account data or sending operations can work. Its built-in web interface manages linking and operational settings, but it is not an access-control layer. Protect the MCP and administration endpoints externally when exposing them beyond a trusted network.
The recovery logic can attempt resynchronization or restart the internal WhatsApp client when session-state corruption or disconnect conditions recur. The documented behavior still includes health reporting and Docker restart integration for cases that remain unhealthy.
Media upload behavior depends on the configured limits and whether uploads are enabled. For large files, multipart upload or a server-side path avoids putting the entire file into base64 content.