Skip to main content
Glama

šŸ“± MCP WhatsApp

An open-source MCP server for connecting compatible AI assistants to WhatsApp through WuzAPI.

Python MCP License: MIT Stars

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-reader

The 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 -d

WuzAPI 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 .env private. 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.server

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

  1. Open http://localhost:7143 → click Admin Mode

  2. Enter the WUZAPI_ADMIN_TOKEN value from your private .env

  3. Go 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 mcp add whatsapp -s user -- \
  /path/to/.venv/bin/python -m mcp_whatsapp.server

Then 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.json

  • macOS: ~/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.server

  • Env vars: WUZAPI_BASE_URL, WUZAPI_TOKEN


šŸ› ļø Available Tools (30+)

Category

Tools

āš™ļø Setup

whatsapp_configure

šŸ”— Session

whatsapp_connect, whatsapp_disconnect, whatsapp_status, whatsapp_get_qrcode, whatsapp_health

šŸ’¬ Messages

whatsapp_send_text, whatsapp_send_image, whatsapp_send_document, whatsapp_send_audio, whatsapp_send_video, whatsapp_send_sticker, whatsapp_send_location, whatsapp_send_contact, whatsapp_send_link, whatsapp_send_buttons, whatsapp_send_list, whatsapp_send_poll

šŸ“„ Chat

whatsapp_get_chats, whatsapp_get_unread_messages, whatsapp_get_messages, whatsapp_reply_message, whatsapp_delete_message, whatsapp_react, whatsapp_mark_read, whatsapp_download_media, whatsapp_search_messages, whatsapp_forward_message

šŸ‘¤ Users

whatsapp_get_user_info, whatsapp_get_contacts, whatsapp_search_contacts, whatsapp_check_phones, whatsapp_get_avatar

šŸ‘„ Groups

whatsapp_list_groups, whatsapp_get_group_info, whatsapp_create_group, whatsapp_update_group_participants, whatsapp_get_group_invite_link

šŸ”” Webhook

whatsapp_set_webhook

šŸ“¢ Newsletter

whatsapp_get_newsletter_messages, whatsapp_subscribe_newsletter

šŸ” Admin

whatsapp_admin_list_users, whatsapp_admin_create_user, whatsapp_admin_delete_user


šŸ’” 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 +5511999998888

Sending 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?

5511999998888

āœ… Brazil (DDD 11)

14155552671

āœ… USA (415)

+5511999998888

āŒ Remove the +

011999998888

āŒ 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 is false when 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 .env private. 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.

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes

  4. 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 tools
whatsapp_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_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_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

    B3.4/5.0

    Scored across 37 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables 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
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Integrates WhatsApp with AI agents, enabling message sending, chat search, media sharing, approval workflows, and activity summaries via any MCP client.
      1
      Apache 2.0