MCP Hub
Back to servers

WhatsApp MCP Stream

An MCP server that enables interaction with WhatsApp using the Baileys library and Streamable HTTP transport. It supports managing contacts, chats, and messages, while providing a web admin UI for QR code authentication and media handling.

Updated
Feb 18, 2026

WhatsApp MCP Stream

CI

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 + /media hosting + 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).

Supported settings:

  • media_public_base_url
  • upload_max_mb
  • upload_enabled
  • max_files_per_upload
  • require_upload_token
  • upload_token

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:

  1. POST /mcp with JSON-RPC initialize
  2. Use the returned mcp-session-id header for subsequent requests
  3. POST /mcp for tool calls

MCP Tools

Auth

ToolDescription
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.

Contacts

ToolDescription
search_contactsSearch contacts by name or phone number.
get_contact_by_idGet contact details by JID.

Chats

ToolDescription
list_chatsList chats with metadata and optional last message.
get_chat_by_idGet chat metadata by JID.
get_direct_chat_by_contact_numberResolve a direct chat JID by phone number.

Messages

ToolDescription
list_messagesGet messages from a specific chat.
get_message_by_idGet a specific message by ID (jid: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.

Media

ToolDescription
send_mediaSend media (image/video/document/audio).
download_mediaDownload media from a message.

Utility

ToolDescription
pingHealth check tool.

License

MIT

Reviews

No reviews yet

Sign in to write a review