WhatsApp Web MCP
This server provides a local MCP interface for interacting with WhatsApp Web through Playwright, including reading chats, searching messages, exporting conversations, preparing/confirming sends, managing browser sessions, and transcribing media.
Browser/session management: open/close WhatsApp Web via Playwright, check runtime status, and set or resolve headless/headed browser policies.
Discovery and search: find contacts/chats by name, phone, JID, or query; search rendered messages by text, type, contact, date/time range, and scrolling limits.
Conversation inspection: view chat structure grouped by day/hour, inspect message details, and export rendered conversations to JSON with optional media download, transcription, and diarization.
Media processing: transcribe audio/video files manually with WhisperX, with language, model, device, and compute-type options.
Sending workflow: prepare outgoing text/media messages for a preview and token, then explicitly confirm dispatch; probe media attachment or reply-to mode without actually sending.
Capability discovery: list supported sources, paths, formats, and backends via
whatsapp_capabilitiesandwhatsapp_sources.
Allows agents to search, structure, and export authorized WhatsApp Web conversations, including media transcription and message sending with confirmation.
Click on "Deploy 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 Web MCP search for 'invoice' in my chat with John"
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 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 |
|
Identity and context |
|
Conversation content |
|
Media |
|
State and actions |
|
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 serveAuthentication 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 testsThe 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.
Available Tools
18 toolswhatsapp_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
Scored across 18 tools
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.
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.
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.
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
Related MCP Connectors
Your own WhatsApp as an MCP server: read, search and send from any MCP client.
WhatsApp MCP on your own number: read chats, search contacts, send messages.
Hosted WhatsApp MCP server: send and read messages from your own linked number. OAuth sign-in.
Free WhatsApp MCP server for ChatGPT and Claude: read and search chats, every send you approve.
Related MCP Servers
- AlicenseAqualityDmaintenanceA 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.6MIT
- FlicenseBqualityDmaintenanceRead-only MCP server for WhatsApp Web allowing listing chats and reading recent messages, without sending or mutating WhatsApp state.3-
- AlicenseNot gradedqualityDmaintenanceA local MCP server that provides a durable, searchable archive of your WhatsApp history using hybrid retrieval to navigate conversations.4MIT
- AlicenseAqualityDmaintenanceMCP 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.15MIT