MCP WhatsApp
This MCP server lets an AI assistant manage WhatsApp via WuzAPI, including session setup, messaging, media, chat history, contacts, groups, and admin operations.
Configure WuzAPI credentials and check service/session status.
Connect/disconnect, get QR code, force sync, reset session, and get current date/time.
Send text, images, documents, audio, video, locations, contacts, links, replies, and polls.
Read chats and recent/unread/search messages; mark messages read, react, forward, delete, and download media.
Look up user info, search contacts, get messages by contact name, and verify phone numbers on WhatsApp.
List/get/create groups, add/remove participants, and get group invite links.
Perform WuzAPI admin actions such as list/create/delete users and enable history (requires admin token).
Enables sending and receiving WhatsApp messages, images, documents, and more, along with managing chats, groups, contacts, and media through the WhatsApp API.
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., "@MCP WhatsApp Send a message to +5511999998888 saying I'll be late"
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.
š± MCP WhatsApp
An open-source MCP server for connecting compatible AI assistants to WhatsApp through WuzAPI.
Designed for MCP-compatible clients, including Claude Code and compatible editor integrations. Client support depends on the MCP capabilities and configuration available in each application.
Public MCP server source available under the MIT License.
⨠What can you do?
Just talk to your AI naturally:
"Send a message to +5511999998888 saying the meeting is postponed"
"Send the invoice.pdf to the Clients group"
"Get the last 20 messages from my support chat"
"Create a group called 'Team Sprint' with these numbers"
Once configured, supported actions can be requested through an MCP-compatible assistant. Some actions modify WhatsApp data or send messages, so review permissions and requests carefully.
Important: This project integrates with WuzAPI, an unofficial WhatsApp Web interface. It is not the official WhatsApp Business Platform or a Meta-approved integration. Account restrictions and compatibility changes are possible. See the Security & Responsible Use section below.
Related MCP server: MCP WPPConnect Server
WhatsApp Reader (read-only)
This repository includes the open-source mcp-whatsapp-reader entry, which registers query-only tools separately from the full MCP. It does not include or expose the commercial WhatsApp Reader skill workflows; those are distributed in the Agensi ZIP.
python -m pip install -e .
mcp-whatsapp-readerThe Reader does not expose pairing, sending, deletion, session changes, or administration. Pair and synchronize using a separately controlled setup process before connecting the Reader. The WuzAPI user token itself is not inherently read-only. See docs/reader-install.md for local setup.
The creator's local package builder (python scripts/package_whatsapp_reader.py) reads the private, Git-ignored skill source and writes dist/whatsapp-reader.zip; neither source nor ZIP is part of the public Git history.
š Quick Start (3 steps)
Step 1 ā Clone and start WuzAPI
git clone https://github.com/gabriellopesdesouza2002/mcp-whatsapp.git
cd mcp-whatsapp
# PowerShell: Copy-Item .env.example .env
# macOS/Linux: cp .env.example .env
# Edit .env and configure separate random tokens plus persistent encryption/HMAC keys
docker compose up -dWuzAPI is bound to 127.0.0.1:7143 by the included Compose configuration. Before starting it, set WUZAPI_ADMIN_TOKEN, WUZAPI_TOKEN, WUZAPI_GLOBAL_ENCRYPTION_KEY and WUZAPI_GLOBAL_HMAC_KEY in your local .env file, as documented in the Reader installation guide. Keep the encryption/HMAC keys persistent across restarts.
Keep
.envprivate. Never expose the WuzAPI port publicly or commit tokens.
Step 2 ā Install the MCP server
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux / macOS
source .venv/bin/activate
pip install -e .Step 3 ā Register with Claude Code (global, one-time)
# Windows (replace with your absolute path)
claude mcp add whatsapp -s user -- C:\path\to\mcp-whatsapp\.venv\Scripts\python.exe -m mcp_whatsapp.server
# Linux / macOS (replace with your absolute path)
claude mcp add whatsapp -s user -- /path/to/mcp-whatsapp/.venv/bin/python -m mcp_whatsapp.serverRestart Claude, then just ask:
Configure the local WhatsApp integration using the credentials already stored in my private configuration.
The full MCP includes setup tools, but pairing and authorization still require care. Avoid putting live tokens into chat messages.
š Manual Configuration (Optional)
If you prefer to use the dashboard, it is available at http://localhost:7143.
Open
http://localhost:7143ā click Admin ModeEnter the
WUZAPI_ADMIN_TOKENvalue from your private.envGo to Users ā Create User, enter any name and choose a token.
Keep configuration and token values in your private local environment, not in shared chats or screenshots.
š” Two tokens, two purposes:
User token ā sends/receives messages ā this is what you use daily
Admin token ā manages users ā only needed for
whatsapp_admin_*tools
š Connect to Your AI
Claude Code (recommended)
claude mcp add whatsapp -s user -- \
/path/to/.venv/bin/python -m mcp_whatsapp.serverThen ask Claude to configure:
Configure my locally hosted WhatsApp connection (using local credentials).
Claude Desktop
Add to claude_desktop_config.json:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"whatsapp": {
"command": "/path/to/mcp-whatsapp/.venv/bin/python",
"args": ["-m", "mcp_whatsapp.server"],
"env": {
"WUZAPI_BASE_URL": "http://localhost:7143",
"WUZAPI_TOKEN": "your_token_here"
}
}
}
}Cursor / Windsurf / Continue.dev
Add to your editor's MCP config file:
{
"mcpServers": {
"whatsapp": {
"command": "/path/to/mcp-whatsapp/.venv/bin/python",
"args": ["-m", "mcp_whatsapp.server"],
"env": {
"WUZAPI_BASE_URL": "http://localhost:7143",
"WUZAPI_TOKEN": "your_token_here"
}
}
}
}Any other MCP-compatible AI
Transport: stdio (standard)
Command:
python -m mcp_whatsapp.serverEnv vars:
WUZAPI_BASE_URL,WUZAPI_TOKEN
š ļø Available Tools (30+)
Category | Tools |
āļø Setup |
|
š Session |
|
š¬ Messages |
|
š„ Chat |
|
š¤ Users |
|
š„ Groups |
|
š Webhook |
|
š¢ Newsletter |
|
š Admin |
|
š” Usage Examples
First-time setup
You: "Check my local WhatsApp configuration"
Claude: [reports configured connection settings or requests a local setup step]
You: "Connect my WhatsApp"
Claude: [generates QR Code ā scan with your phone]
You: "Check if WhatsApp is connected"
Claude: ā
Connected as +5511999998888Sending messages
You: "Send 'Hello!' to +5511999998888"
You: "Send the file report.pdf to the Sales group"
You: "Send my location to +5511987654321"
You: "React with š to the last message in chat 5511999998888@s.whatsapp.net"Managing groups
You: "List all my WhatsApp groups"
You: "Create a group 'Project X' with +5511111111111 and +5522222222222"
You: "Get the invite link for group 120363XXXXXXXX@g.us"š Phone Number Format
WhatsApp via WuzAPI uses numbers without the + prefix:
Format | Valid? |
| ā Brazil (DDD 11) |
| ā USA (415) |
| ā Remove the |
| ā Use country code |
š Project Structure
mcp-whatsapp/
āāā pyproject.toml # Python project config
āāā .env.example # Environment variables template
āāā src/
āāā mcp_whatsapp/
āāā server.py # MCP server with all tools
āāā wuzapi_client.py # Async HTTP client for WuzAPIš”ļø Security & Responsible Use
Unofficial integration: This project connects to WuzAPI, not to Meta's official WhatsApp Business Platform. It is not endorsed by Meta. Using an unofficial interface may lead to instability, restrictions, or account loss. Consider the official platform for business-critical integrations.
Consent and appropriate use: Avoid unsolicited bulk messaging and automated outreach. Respect applicable platform rules and obtain consent where required.
Privacy mode: The full MCP supports regex-based masking of common identifiers when
WUZAPI_PRIVACY_MODE=true; its runtime fallback isfalsewhen the variable is unset. Masking is limited and does not guarantee anonymization or legal compliance. The Reader applies additional masking to its text responses.Audit behavior: The full MCP configures local logging at
logs/audit_privacy.log; the Reader entry does not enable that logger by default. Logging and masking do not automatically satisfy LGPD/GDPR obligations.Protect credentials: Keep the WuzAPI admin and user tokens, encryption keys, and local
.envprivate. Do not paste real tokens into AI prompts or commit them to Git.Limit agent permissions: Use the separate read-only Reader for history queries when sending or administrative features are unnecessary. Its tools are read-only, but the underlying WuzAPI user token itself is not inherently read-only.
Review sensitive operations: Confirm recipients and content before letting an agent send messages, share files, administer groups, or change sessions. Data sent to an AI provider is governed by that provider's processing terms.
š¤ Contributing
Contributions are welcome! Feel free to open issues and pull requests.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes
Open a Pull Request
š License
This project is open-source and available under the MIT License.
Built with ā¤ļø for the MCP ecosystem
If this project helped you, please ā star it!
Available Tools
37 toolswhatsapp_adminB
WuzAPI admin operations. action: 'list_users'|'create_user'|'delete_user'|'enable_history'. Requires admin token.
Inputs: action (required), name, token, confirmed. Returns: result
whatsapp_check_phonesB
Check if phone numbers are on WhatsApp. phones: list, country code, no '+'.
Inputs: phones (required). Returns: result
whatsapp_configureC
Save WuzAPI credentials. Run once to set up. token: user token. admin_token: optional, for admin tools.
Inputs: token (required), base_url, admin_token. Returns: result
whatsapp_connectA
Connect to WhatsApp. Shows QR code if not yet paired ā scan with phone.
Inputs: no named parameters. Returns: result
whatsapp_create_groupC
Create a WhatsApp group. name: group name. participants: list of phone numbers, no '+'.
Inputs: name (required), participants (required). Returns: result
whatsapp_delete_messageA
Delete a message. ā ļø DESTRUCTIVE. confirmed=True required ā always ask user first. everyone: revoke for all.
Inputs: phone (required), message_id (required), everyone, confirmed. Returns: result
whatsapp_disconnectA
Logout from WhatsApp. ā ļø DESTRUCTIVE. confirmed=True required ā always ask user first.
Inputs: confirmed. Returns: result
whatsapp_download_mediaC
Download media from a message (image/audio/video/doc). phone: chat. message_id: target msg.
Inputs: phone (required), message_id (required). Returns: result
whatsapp_force_syncA
Force full history sync by reconnecting. Use when messages are missing. Wait ~30s after.
Inputs: no named parameters. Returns: result
whatsapp_forward_messageC
Forward a message to another chat. message_id: original msg. to_phone: number or group JID.
Inputs: message_id (required), to_phone (required). Returns: result
whatsapp_get_chatsA
List all active WhatsApp chats with last message info.
Inputs: no named parameters. Returns: result
whatsapp_get_datetimeA
Get current date and time (Brazil/SĆ£o Paulo). Use to know today's date before comparing message timestamps.
Inputs: no named parameters. Returns: result
whatsapp_get_group_infoC
Get group details. group_jid: group identifier (e.g. 120363...@g.us).
Inputs: group_jid (required). Returns: result
whatsapp_get_group_invite_linkB
Get invite link for a group. group_jid: group identifier.
Inputs: group_jid (required). Returns: result
whatsapp_get_messagesB
Get recent messages from a chat, sorted by timestamp. phone: no '+'. count: default 20.
Inputs: phone (required), count. Returns: result
whatsapp_get_messages_by_contact_nameB
Get messages from a contact by name/nickname. only_today: filter today only. limit: default 20.
Inputs: name (required), only_today, limit. Returns: result
whatsapp_get_qrcodeA
Get QR code image for WhatsApp pairing. Scan with phone to connect.
Inputs: no named parameters.
whatsapp_get_unread_messagesB
Get recent incoming messages across all chats (from others, not sent by you). limit: default 20.
Inputs: limit. Returns: result
whatsapp_get_user_infoA
Get WhatsApp profile (name, about) for a number. phone: no '+'. For own session use whatsapp_status.
Inputs: phone (required). Returns: result
whatsapp_list_groupsA
List all WhatsApp groups.
Inputs: no named parameters. Returns: result
whatsapp_mark_readC
Mark messages as read. phone: chat number. message_ids: list of IDs.
Inputs: phone (required), message_ids (required). Returns: result
whatsapp_reactA
React to a message with emoji. phone: chat number. message_id: target msg. emoji: e.g. 'š'.
Inputs: phone (required), message_id (required), emoji (required). Returns: result
whatsapp_reply_messageB
Reply quoting a message. phone: no '+'. message: reply text. quoted_message_id: original msg ID.
Inputs: phone (required), message (required), quoted_message_id (required). Returns: result
whatsapp_reset_sessionA
Reset WhatsApp session completely ā logout + wipe message history + clear media + fresh QR. ā ļø DESTRUCTIVE. confirmed=True required.
Inputs: confirmed. Returns: result
whatsapp_search_contactsA
Search contacts by name or nickname. Falls back to recent chat history when not found in phone book.
Inputs: query (required). Returns: result
whatsapp_search_messagesB
Search messages by keyword across all synced history. query: term. limit: default 50.
Inputs: query (required), limit. Returns: result
whatsapp_send_audioC
Send audio via WhatsApp. phone: no '+'. audio_url: public URL.
Inputs: phone (required), audio_url (required). Returns: result
whatsapp_send_contactB
Send contact card (vCard) via WhatsApp. phone: recipient no '+'. contact_name/contact_phone: contact to share.
Inputs: phone (required), contact_name (required), contact_phone (required). Returns: result
whatsapp_send_documentB
Send document/file via WhatsApp. phone: no '+'. document_url: public URL. filename/caption: optional.
Inputs: phone (required), document_url (required), filename, caption. Returns: result
whatsapp_send_imageC
Send image via WhatsApp. phone: no '+'. image_url: public URL. caption: optional.
Inputs: phone (required), image_url (required), caption. Returns: result
whatsapp_send_linkB
Send link with preview via WhatsApp. phone: no '+'. url: link. text: optional message.
Inputs: phone (required), url (required), text. Returns: result
whatsapp_send_locationC
Send location via WhatsApp. phone: no '+'. latitude/longitude: coords. name: optional label.
Inputs: phone (required), latitude (required), longitude (required), name. Returns: result
whatsapp_send_pollB
Send poll. phone: no '+' or group JID. question: poll text. options: list of choices. max_answers: default 1.
Inputs: phone (required), question (required), options (required), max_answers. Returns: result
whatsapp_send_textA
Send WhatsApp text. phone: country code, no '+' (e.g. 5511999998888). message: text content.
Inputs: phone (required), message (required). Returns: result
whatsapp_send_videoC
Send video via WhatsApp. phone: no '+'. video_url: public URL. caption: optional.
Inputs: phone (required), video_url (required), caption. Returns: result
whatsapp_statusA
Get WhatsApp session status (connected/disconnected/QR pending) and WuzAPI service health.
Inputs: no named parameters. Returns: result
whatsapp_update_group_participantsC
Add or remove group participants. action: 'add'|'remove'. participants: phone list, no '+'.
Inputs: group_jid (required), participants (required), action. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 37 tools
Most tools have clearly distinct purposes (e.g., send_text vs send_image, get_chats vs get_messages), but some pairs like whatsapp_get_messages and whatsapp_get_unread_messages could cause minor confusion due to overlapping functionality. Overall, the set is well-disambiguated.
All tool names follow a consistent 'whatsapp_verb_noun' pattern in snake_case (e.g., whatsapp_send_text, whatsapp_get_chats). There are no deviations or mixed conventions, making the naming predictable and easy to understand.
With 37 tools, the server covers a broad range of WhatsApp functionality, but the count is high compared to typical MCP servers. Some consolidation (e.g., a generic send_media tool) could reduce complexity. The count is borderline but still reasonable for the domain.
The tool set covers core operations: messaging (text, media, polls), group management, search, and admin tasks. Minor gaps exist, such as missing edit_message or typing indicators, but the surface is largely complete for most WhatsApp automation use cases.
Maintenance
Related MCP Connectors
WhatsMCP connects Claude and other MCP-compatible AI agents directly to WhatsApp. Send and receive text, images, documents, and voice notes; manage groups (create, add/remove members, promote admins); look up contacts and profiles; follow channels; and read call and message history ā all through a standard MCP interface. For voice use cases, WhatsMCP offers SIP-based calling plans (inbound-only, or full inbound/outbound) so AI voice agents can answer and place WhatsApp calls, plus low-latency WebSocket integrations with voice agent providers like ElevenLabs. Multiple WhatsApp accounts can be paired and managed per workspace, with webhook support for real-time inbound message delivery to your own infrastructure.
Drive WhatsApp from any MCP client: pair devices, send text and media, manage contacts and groups.
Send WhatsApp messages and templates, manage chats, contacts, broadcasts and AI agents.
Give your AI agent its own real WhatsApp number: buy numbers and reply to chats over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with WhatsApp through a Model Context Protocol server, supporting sending text messages, contacts, links, and locations via standardized tools.6MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables WhatsApp automation through MCP protocol, allowing users to manage sessions, send messages, handle groups/communities, and access contacts through natural language interactions with AI agents.5 npm-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to send WhatsApp messages, templates, and retrieve media through the WhatsApp Cloud API. Provides webhook handling and seamless integration with Meta's WhatsApp Business platform.23ISC
- AlicenseNot gradedqualityCmaintenanceIntegrates WhatsApp with AI agents, enabling message sending, chat search, media sharing, approval workflows, and activity summaries via any MCP client.1Apache 2.0