MCP WhatsApp

MCP WhatsApp

Enables sending messages, images, documents and more on WhatsApp directly from any MCP-compatible AI, with tools for chat management, groups, and webhooks.

Category
访问服务器

README

<div align="center">

📱 MCP WhatsApp

Send messages, images, documents and more on WhatsApp — directly from any AI.

Python MCP License: MIT Stars

Works with Claude, Gemini, Cursor, Windsurf, Continue.dev and any MCP-compatible AI.

100% Open Source and MIT Licensed.

</div>


✨ 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"

No code. No manual API calls. Just ask.


🚀 Quick Start (3 steps)

Step 1 — Clone and start WuzAPI

git clone https://github.com/YOUR_USER/mcp-whatsapp
cd mcp-whatsapp
docker compose up -d

That's it — WuzAPI starts automatically on http://localhost:7143 with message history enabled. ✅

The included docker-compose.yml sets everything up for you.
Default admin token: admin123 (change via WUZAPI_ADMIN_TOKEN env var).

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 my WhatsApp with token mytoken123"

Magic: The server will automatically create the user in WuzAPI for you (Plug & Play). No manual dashboard work required! 🪄


🔑 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 admin token — default is admin123
  3. Go to Users → Create User, enter any name and choose a token.

"Configure my WhatsApp with token myusertoken"

💡 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.server

Then ask Claude to configure:

"Configure my WhatsApp: token=abc123, url=http://localhost:7143"

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: "Configure my WhatsApp with token abc123"
Claude: ✅ Configuration saved! Now use whatsapp_connect() to connect.

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

IMPORTANT: This project uses an unofficial WhatsApp API. Use it at your own risk.

To ensure your account stays safe and you remain compliant with global data laws (LGPD/GDPR), please follow these guidelines:

  1. Avoid Spam: Do not use this tool for bulk messaging or automated marketing. Excessive automated activity is the #1 cause of WhatsApp account bans.
  2. Privacy Guardrails: By default, this server includes masking for sensitive information (PII) like CPFs, Credit Cards, and Emails (when WUZAPI_PRIVACY_MODE=true).
  3. Audit Logs: All tool calls are logged in logs/audit_privacy.log. This is essential for transparency and accountability.
  4. Token Safety: Never share your WUZAPI_TOKEN or WUZAPI_ADMIN_TOKEN. These grant full access to your messages.
  5. AI Autonomy: Be careful when giving the AI "autonomy" to send messages. Always review the output if the AI is performing high-stakes tasks.
  6. Terms of Service: Be aware that using unofficial APIs violates WhatsApp's Terms of Service. This tool is intended for personal productivity and research.

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


<div align="center">

Built with ❤️ for the MCP ecosystem

If this project helped you, please ⭐ star it!

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选