Skip to main content
Glama

WhatsApp Web MCP

A local MCP server for reading authorized WhatsApp conversations, retrieving media, exporting bounded history and preparing confirmation-gated messages. Its 13 typed tools expose chats and messages rather than browser controls. OpenWA owns the WhatsApp Web connection; optional local processors handle audio, images and documents.

Read, inspect, then act

For a known conversation, call whatsapp_get_messages directly. Use whatsapp_find to discover a contact or search within a specified conversation. History exports include coverage information: a partial result is identified as partial, with its stopping condition, rather than presented as a complete archive.

Sending is a separate stateful operation. whatsapp_send_message prepares a preview, target and action ID. Confirmation requires the literal phrase returned by that preview and the user's explicit instruction. An action is claimed once. After dispatch, the server reloads the message before reporting sent: true. An ambiguous result consumes the action and returns delivery_unconfirmed; it is not retried automatically. Reloading proves that the backend can retrieve the outgoing message, not that its recipient has read it.

Related MCP server: whatsapp-web-mcp

Tools

Purpose

Tools

Connection and discovery

whatsapp_status, whatsapp_list_chats, whatsapp_find

Identity and context

whatsapp_get_contact, whatsapp_get_chat_info

Conversation content

whatsapp_get_message, whatsapp_get_messages, whatsapp_get_chat

Media

whatsapp_get_media, whatsapp_understand

State and actions

whatsapp_send_message, whatsapp_jobs, whatsapp_settings

Each tool accepts a typed request object. Public identifiers hide backend JIDs and session configuration. See request models and tool registration for the current contract.

Installation

Requires Python 3.11+, Node.js/npm and a Chrome/Chromium installation for OpenWA. FFmpeg and the transcription extra support audio/video; Tesseract, Poppler and LibreOffice support applicable OCR/document formats.

git clone https://github.com/KingDonRush/whatsapp-web-mcp.git
cd whatsapp-web-mcp
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e .
whatsapp-web-mcp doctor
whatsapp-web-mcp auth --profile default
whatsapp-web-mcp serve

Authentication installs exactly @open-wa/wa-automate@4.76.0 in the private data directory and applies the compatibility patches in openwa_runtime.py. Authentication displays a local QR page; the MCP does not return the QR. Subsequent operations are headless. Use auth --no-open when the browser must be opened separately in a secure local or tunneled environment. Keep the OpenWA HTTP service on loopback.

Configure an MCP client to run the virtual environment's whatsapp-web-mcp executable with args: ["serve"]. Set WHATSAPP_MCP_DATA_DIR to an absolute persistent private directory and WHATSAPP_MCP_PROFILE to the intended profile before starting. The default data directory is ~/.local/share/whatsapp-web-mcp.

Examples

Read the newest audio or voice note from a known chat:

{"request":{"chat_id":"c_12345678","types":["audio"],"period":"últimos 7 dias","limit":1}}

Pass its returned message_id to whatsapp_understand to fetch the original media and process it. Date expressions accept ISO dates and supported Brazilian Portuguese periods; see date parsing. Tool prompts and natural period parsing currently favor Portuguese, while the transport and schemas are language independent.

Export an explicitly selected conversation:

{"request":{"selector":"Example project group","period":"março de 2026"}}

Architecture and boundaries

The stdio entry point delegates to domain services. OpenWA access, history loading, media processing, artifact generation, ID registration and action persistence have separate modules. JSON records use private atomic writes; action claims use atomic renames to prevent duplicate dispatch. Path-bearing action/job identifiers are validated before accessing local files.

  • This is an unofficial WhatsApp Web integration. Upstream browser/API changes can break compatibility; the pinned runtime and its patches need maintenance.

  • Runtime profiles separate browser authentication. Run separate MCP processes with distinct data directories for separate users; domain artifacts are local process data.

  • Job listing/cancellation and repeat records exist; there is no general background worker consuming the repeat queue. A queued record is not completed work.

  • History completeness depends on what WhatsApp exposes. OCR/transcription quality depends on installed tools, models and source media.

  • Local data includes conversation content, media, credentials and diagnostics. It stays outside source control. See SECURITY.md.

Verification

python -m unittest discover -s tests -v
python -m compileall server.py whatsapp_web_mcp tests

The offline suite covers tool schemas, date ranges, history boundaries, media, action confirmation/replay, backend verification, private persistence and path traversal. Live read/send smoke tests are opt-in and skipped by default. They need an authenticated session and an explicitly configured test group; sending also requires a separate confirmation flag. Offline passing tests do not establish current live WhatsApp compatibility. No live messages were sent in this verification pass.

MIT license.

Available Tools

18 tools
whatsapp_automated_search_planC

Planeja busca automatizada por DOM/acessibilidade em WhatsApp Web.

Inputs: contact_query, message_query, source_ids, date_from, +4 more. Returns: object

whatsapp_browser_closeC

Fecha uma sessao Playwright aberta pelo MCP.

Inputs: session_id. Returns: object

whatsapp_browser_openC

Abre WhatsApp Web via Playwright em modo headless/headed e retorna screenshot/QR quando solicitado.

Inputs: category, process, browser_mode, login_mode, +4 more. Returns: object

whatsapp_browser_policyC

Resolve politica headless/headed para uma operacao sem persistir overrides.

Inputs: category, process, browser_mode, login_mode. Returns: object

whatsapp_browser_runtime_statusA

Mostra disponibilidade de Playwright/Chrome e sessoes de browser abertas.

Inputs: no named parameters. Returns: object

whatsapp_capabilitiesA

Mostra caminhos, formatos e backends suportados por este MCP.

Inputs: no named parameters. Returns: object

whatsapp_chat_structureC

Mostra estrutura do chat por dia/hora usando mensagens renderizadas no WhatsApp Web.

Inputs: contact_name, phone, jid, query, +12 more. Returns: object

whatsapp_confirm_send_messageC

Confirma uma mensagem preparada. Nao despacha sem backend Web/UI verificado.

Inputs: token (required), confirmation_text (required), user_already_confirmed, dispatch, +3 more. Returns: object

whatsapp_export_conversationC

Exporta conversa renderizada do WhatsApp Web para JSON, com midia/transcricao quando possivel.

Inputs: contact_name, phone, jid, query, +20 more. Returns: object

whatsapp_find_contactsD

Lista ou procura contatos/chats pelo WhatsApp Web DOM, sem SQLite.

Inputs: query, name, phone, jid, +5 more. Returns: object

whatsapp_prepare_send_messageB

Prepara envio de texto/midia, mas nao envia. Retorna token que exige confirmacao explicita.

Inputs: recipient_name, recipient_phone, recipient_jid, message_text, +4 more. Returns: object

whatsapp_probe_reply_to_messageC

Entra no modo resposta nativo do WhatsApp Web e cancela sem enviar.

Inputs: recipient_name, recipient_phone, recipient_jid, reply_to, +4 more. Returns: object

whatsapp_probe_send_mediaB

Anexa uma midia ate o preview e fecha sem enviar. Usado para validar Web UI por tipo.

Inputs: recipient_name, recipient_phone, recipient_jid, send_item, +4 more. Returns: object

whatsapp_search_messagesC

Busca mensagens renderizadas no WhatsApp Web por contato, texto, tipo e intervalo.

Inputs: contact_name, phone, jid, query, +11 more. Returns: object

whatsapp_select_contextC

Seleciona contato/conversa pelo WhatsApp Web DOM.

Inputs: query, name, phone, jid, +5 more. Returns: object

whatsapp_set_browser_policyC

Persiste default headless/headed global, por categoria, ou por processo dentro da categoria.

Inputs: category, process, browser_mode, login_mode, +1 more. Returns: object

whatsapp_sourcesC

Mostra fontes disponiveis. Apenas WhatsApp Web e anunciado.

Inputs: no named parameters. Returns: object

whatsapp_transcribe_fileC

Transcreve arquivo manualmente com WhisperX, incluindo video via audio extraido.

Inputs: file_path (required), out_dir, backend, language, +9 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 18 tools

    Disambiguation5/5

    Each tool has a distinct purpose, from browser management to message preparation and confirmation. The 'probe' tools simulate actions without sending, clearly differentiating from actual send operations. There is no ambiguity between tools.

    Naming Consistency4/5

    All tools share the 'whatsapp_' prefix, and most follow a verb_noun pattern (e.g., export_conversation, find_contacts). A few tools use noun phrases (e.g., whatsapp_automated_search_plan, whatsapp_capabilities) but the overall pattern is predictable and readable.

    Tool Count4/5

    With 18 tools, the server covers a broad but scoped domain of WhatsApp Web automation. Each tool has a clear role, from browser lifecycle to message handling and media probing. The number is reasonable and not excessive.

    Completeness4/5

    The tool set covers core workflows: browser control, contact/chat selection, message sending (with prepare and confirm), search, structure, and media transcription. Minor gaps like direct read without search are acceptable given the automated interaction focus.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A Python-based MCP server that automates WhatsApp Web using Playwright to manage chats and messages. It enables users to list conversations, send messages, and retrieve history through a local browser automation interface.
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A local MCP server that provides a durable, searchable archive of your WhatsApp history using hybrid retrieval to navigate conversations.
      4
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that turns WhatsApp into agent-callable tools, enabling search contacts, send/receive messages, read chats, handle media, and monitor calls via the WhatsApp Web multi-device protocol.
      15
      MIT