Logo WhatsApp MCP Extended

WhatsApp MCP Extended

Cộng đồng
FelixIsaac

Actively maintained WhatsApp MCP — 26 tools, webhooks, anti-ban, Docker, self-healing. Drop-in for abandoned lharries/whatsapp-mcp.

Nhà phát hànhFelixIsaac
Kho mãwhatsapp-mcp-extended
Ngôn ngữGo
Bản fork
28
Sao
41
Công cụ có sẵn
0
Phương thức truyền tảistdio, streamable-http
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    WhatsApp MCP Extended cung cấp các chức năng MCP cho các ứng dụng khách AI và tác nhân AI tương thích.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Mẫu cấu hình có thể sao chép ngay

    Dùng các đoạn cấu hình mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Mức độ quan tâm của cộng đồng đến kho mã

    41 sao và 28 bản fork từ kho mã được liên kết.

WhatsApp MCP Extended

An extended Model Context Protocol (MCP) server for WhatsApp with a toolset-gated, agent-facing surface for messaging, search, media, group management, webhooks, presence, and more.

Built on AdamRussak/whatsapp-mcp (webhooks, containers) which forked lharries/whatsapp-mcp (original). Extended with reactions, message editing, polls, group management, presence, newsletters, and more.

WhatsApp MCP

What's New (vs Original)

FeatureOriginalExtended
MCP Tools1226 default / 15 lean
Reactions-✅
Edit/Delete Messages-✅
Group Management-✅
Polls-✅
History Sync-✅
Presence/Online Status-✅
Newsletters-✅
Webhooks-✅
Custom Nicknames-✅

Architecture

┌─────────────────────┐     ┌─────────────────────┐     ┌─────────────────────┐
│   whatsapp-bridge   │     │   whatsapp-mcp      │     │   whatsapp-web-ui   │
│   (Go + whatsmeow)  │◄────│   (Python + MCP)    │     │   (HTML/JS SPA)     │
│   Port: 8080        │     │   Port: 8081        │     │   Port: 8090        │
└─────────────────────┘     └─────────────────────┘     └─────────────────────┘
         │                           │
         ▼                           ▼
    ┌─────────────────────────────────────┐
    │           SQLite (store/)           │
    │  messages.db │ whatsapp.db          │
    └─────────────────────────────────────┘

Quick Start

Docker (Recommended)

bash
git clone https://github.com/felixisaac/whatsapp-mcp-extended
cd whatsapp-mcp-extended

docker network create n8n_n8n_traefik_network
docker-compose up -d

# Scan QR code to authenticate
docker-compose logs -f whatsapp-bridge

Claude Desktop / Cursor Integration

Add to your MCP config (claude_desktop_config.json or Cursor settings):

json
{
  "mcpServers": {
    "whatsapp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/whatsapp-mcp-extended/whatsapp-mcp-server", "python", "main.py"]
    }
  }
}

Security & Safety Gate (Allowlist)

To restrict outgoing message delivery to a specified set of allowed contacts or groups (useful for dev environments or enterprise privacy gates), set WHATSAPP_ALLOWLIST_JIDS:

bash
# Allow sending only to specific phone numbers or group JIDs (comma-separated)
WHATSAPP_ALLOWLIST_JIDS=1234567890,9876543210@s.whatsapp.net,1203630123456789@g.us

MCP Tools

Version 0.4.0 exposes the full curated MCP surface by default for compatibility. Users who want a leaner agent context can opt into smaller toolsets.

Default toolsets:

bash
WHATSAPP_MCP_TOOLSETS=all

Lean recommended toolsets:

bash
WHATSAPP_MCP_TOOLSETS=core,send,media

Toolsets:

ToolsetDefaultTools
coreYesSearch/read tools, contact context, group info, profile picture
sendYessend_message, send_reaction, create_poll
mediaYessend_file, send_audio_message, download_media
historyNorequest_history
contacts_writeNomanage_nickname
message_adminNoedit_message, delete_message, mark_read
groupsNomanage_group
presenceNoset_presence, subscribe_presence
account_adminNoget_blocklist, manage_blocklist
newsletterNomanage_newsletter

You can also expose individual tools with WHATSAPP_MCP_TOOLS=manage_group,delete_message.

Breaking change in 0.2.0: older narrow tools are no longer exposed to the agent. Use the merged replacements below.

Migration:

PreferReplaces
get_contact_contextget_contact_details, get_direct_chat_by_contact, get_contact_chats, get_last_interaction
manage_nicknameset_nickname, get_nickname, remove_nickname, list_nicknames
manage_groupcreate_group, add_group_members, remove_group_members, promote_to_admin, demote_admin, leave_group, update_group
get_blocklist, manage_blocklistget_blocklist, block_user, unblock_user
manage_newsletterfollow_newsletter, unfollow_newsletter, create_newsletter

Messaging

ToolDescription
send_messageSend text message (supports optional quoted_message_id to reply/quote)
send_fileSend image/video/document
send_audio_messageSend voice message
download_mediaDownload received media
send_reactionReact to message with emoji
edit_messageEdit sent message
delete_messageDelete/revoke message
mark_readMark messages as read (blue ticks), or as played for voice messages (receipt_type="played")

Chats & Messages

ToolDescription
list_chatsList all chats
get_chatGet chat by JID
list_messagesSearch messages with filters
get_message_contextGet messages around a specific message
request_historyRequest older message history

Contacts

ToolDescription
search_contactsSearch by name/phone
list_all_contactsList all contacts
get_contact_contextFull contact info, related chats, and last interaction
manage_nicknameSet/get/remove/list custom nicknames

Groups

ToolDescription
get_group_infoGroup metadata & participants
manage_groupCreate/update/leave groups and manage members/admins
create_pollCreate poll in chat

Presence & Profile

ToolDescription
set_presenceSet online/offline status
subscribe_presenceSubscribe to contact's presence
get_profile_pictureGet profile picture URL
get_blocklistList blocked users
manage_blocklistBlock/unblock users

Newsletters (Channels)

ToolDescription
manage_newsletterFollow, unfollow, or create channels

Design Philosophy: Lean Transport Primitives

whatsapp-mcp-extended is engineered according to the Unix Philosophy:

  • Do One Thing Well: Be a rock-solid, production-grade transport layer to WhatsApp (socket lifecycle, messaging CRUD, media downloads, reactions, group administration, webhooks, and safety allowlists).
  • Composable Primitives: High-level AI features (voice-to-text transcription, vector database semantic recall, LLM summarizers) are kept modular. whatsapp-mcp-extended returns clean, raw media file paths (download_media) and message arrays (list_messages) so AI agents (Claude Code, Cursor, OpenCode, Codex) can chain them with specialized sidecars or plugins.

🔌 Plugins & Extensions

Reference plugins and recipes are available in the plugins/ directory:

  • plugins/transcribe_voice_notes.py: Local voice note transcription using mlx-whisper or Whisper.
  • plugins/semantic_recall.py: Multilingual semantic search over message history using sentence-transformers.
  • All-in-One Fork: Users looking for a pre-packaged ML bundle can check out @simonseifert's fork.

Response data prioritizes complete context with minimal interpretation. See METADATA_PHILOSOPHY.md for:

  • Why we include raw data instead of pre-computed signals
  • How we reduce token waste for consuming LLMs
  • Response structure examples (Messages, Chats, Contacts)
  • Design rules: raw facts, countable metrics, exclude nulls

TL;DR: Get all contact info in one response instead of repeated queries. LLM infers tone, urgency, relationships from raw data + metrics.

Webhook System

Real-time HTTP webhooks for incoming messages with:

  • Triggers: all, chat_jid, sender, keyword, media_type
  • Matching: exact, contains, regex
  • Security: HMAC-SHA256 signatures
  • Retry: Exponential backoff

Access the web UI at http://localhost:8090

Development

Manual Setup

bash
# Bridge (Go 1.25+)
cd whatsapp-bridge && go run main.go

# MCP Server (Python 3.11+)
cd whatsapp-mcp-server && uv sync && uv run python main.py

# Web UI
cd whatsapp-web-ui && npm install && npm run dev

Pre-build Checks

bash
cd whatsapp-mcp-server
uv run python check.py  # Catches errors before docker build

Updating whatsmeow

When you see Client outdated (405) errors:

bash
cd whatsapp-bridge
go get -u go.mau.fi/whatsmeow@latest
go mod tidy
docker-compose build whatsapp-bridge
docker-compose up -d whatsapp-bridge

Ports

ServicePortDescription
Bridge API8080 (→8180)REST API
MCP Server8081Streamable HTTP transport
Web UI8090Chat, contacts, and webhook management

Configuration

Environment variables for the bridge (set in .env or docker-compose.yaml):

VariableDefaultDescription
API_KEY(required)Bearer token for all authenticated API calls
PRESENCE_PING_ENABLEDtrueSet false to stop broadcasting "online" to contacts
PRESENCE_PING_INTERVAL20mHow often to ping presence. Accepts Go duration strings (20m, 1h). Keep ≥20m to avoid bot fingerprinting
HISTORY_SYNC_DAYS_LIMIT365Days of history to sync on first link
HISTORY_SYNC_SIZE_MB5000Max history sync size
STORAGE_QUOTA_MB10240Device storage quota
API_PORT8080Bridge HTTP port (internal)

Quick Commands

After running setup.ps1 once, use the Makefile for day-to-day operations:

bash
make status          # check connection state (connected, needs_pairing, jid)
make pair PHONE=+60123456789   # pair via 8-digit phone code — no QR scan needed
make pairing-status  # check pairing code progress
make pair-reset      # reset pairing state if previous attempt timed out
make reconnect       # force reconnect (no re-pairing)
make logs            # tail bridge logs
make sync-venv       # re-sync Python venv (fix missing module errors)
make open-ui         # open web UI in browser (QR scan, webhooks, contacts)

Session Reliability

Session lifetime rules (WhatsApp-enforced, cannot be changed):

  • Primary phone must connect to WhatsApp at least every 14 days
  • The bridge companion device must be active at least every 30 days
  • WebSocket idle disconnects after ~30 min (auto-reconnects, no re-pairing needed)

What causes permanent logout (requires re-scanning QR):

  • Phone offline >14 days
  • Manual unlink from phone (Settings → Linked Devices)
  • WhatsApp detects suspicious activity / protocol fingerprinting
  • WhatsApp app update that forces re-authentication

Account risk: This is a third-party bridge using an unofficial API. Use a dedicated non-personal number. WhatsApp has been aggressively detecting and banning automation tools since 2025. For business-critical use, the WhatsApp Business API is the only compliant path.

If the bridge goes unhealthy (needs re-pairing):

bash
make status          # check: needs_pairing=true means re-pair required
make pair PHONE=+60123456789   # preferred: 8-digit code, no QR scan
# or: open http://127.0.0.1:8090 and scan QR

You can also configure a webhook to receive logged_out events so you're alerted immediately when the session is revoked.

Troubleshooting

Bridge needs re-pairing after restart

The bridge stores credentials in store/whatsapp.db. If that file exists but the bridge still shows QR, WhatsApp revoked the session server-side (check your phone → Settings → Linked Devices). Re-pair using make pair PHONE=+60... or open http://127.0.0.1:8090.

Messages Not Delivering

If API returns success but messages show single checkmark:

bash
docker-compose restart whatsapp-bridge
docker-compose logs --tail=10 whatsapp-bridge
# Should see: "✓ Connected to WhatsApp!"

QR Code Issues

bash
# Option 1: phone number code (no QR scan needed)
make pair PHONE=+60123456789

# Option 2: scan QR via web UI
open http://127.0.0.1:8090

# Option 3: terminal QR
docker-compose logs -f whatsapp-bridge

MCP server fails to start (missing module)

bash
make sync-venv   # re-runs uv sync in whatsapp-mcp-server/

Check bridge health

bash
curl http://127.0.0.1:8180/api/health
# connected: true/false
# needs_pairing: true means QR/code scan required (not just a reconnect)
# disconnected_for: how long it's been offline

Credits

Fork chain:

  • lharries/whatsapp-mcp - Original MCP server (12 tools)
  • AdamRussak/whatsapp-mcp - Added webhooks, container split, webhook UI
  • This repo - Added reactions, edit/delete, groups, polls, presence, newsletters, and a curated MCP tool surface

Libraries:

Community Acknowledgements

Several forks independently solved real problems and their ideas have been incorporated into this repo. Credit where it's due:

ContributorWhat they figured out
simonseifertOptional on-device voice transcription (mlx-whisper) & multilingual semantic search (sentence-transformers); direct_path DB column tracking for CDN fallback; inline Image content blocks
bitterdevWhatsApp LID addressing resolution (GetAltJID()), mapping <id>@lid recipients to phone JIDs to prevent server error 463
domdomeggSecurity scan workflow fixes and .gitleaks.toml allowlist configuration
lauditeMedia captions in ExtractTextContent(); quoted/reply context in webhooks; @mention auto-detection
kasperpeulenContact name resolution priority chain (FullName > PushName > FirstName > Business)
CoriatelFirst working /api/download implementation with manual HKDF/AES-CBC decryption
jedijashwaReactions silently failing fix (wrong sender JID lookup); extended MIME type support
slarrainLID JID normalization — diagnosed conversation-splitting bug

If you've forked this repo and built something useful, open a PR or issue — good ideas deserve to flow upstream.

License

MIT License - see LICENSE file.

Cài đặt

TypingMind
{
  "mcpServers": {
    "whatsapp-mcp-extended": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/whatsapp-mcp-extended/whatsapp-mcp-server",
        "python",
        "main.py"
      ]
    }
  }
}

Dùng MCP WhatsApp MCP Extended với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối WhatsApp MCP Extended, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. Bạn có thể chạy MCP ngay trên thiết bị của mình hoặc kết nối qua URL của máy chủ MCP từ xa.

Cách 1: Dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Thiết lập trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Thiết lập trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh thiết lập trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Để tiến trình tiếp tục chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Để tiến trình tiếp tục chạy trong cửa sổ Terminal khi bạn dùng các công cụ MCP.
3

Thêm WhatsApp MCP Extended làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của WhatsApp MCP Extended.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "whatsapp-mcp-extended": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của WhatsApp MCP Extended, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của WhatsApp MCP Extended.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện trên TypingMind dùng các công cụ MCP đã bật với mô hình AI đã chọn
Bạn có thể dùng WhatsApp MCP Extended giúp tôi làm việc này không?
WhatsApp MCP Extended
Được. Tôi đọc rồi.
Đây là kết quả tôi tìm được bằng WhatsApp MCP Extended.

Cách 2: Thêm URL máy chủ MCP

Dùng cách này khi WhatsApp MCP Extended đã chạy trên máy chủ từ xa hoặc nhóm của bạn muốn có một trình kết nối dùng chung cho nhiều người dùng.

1

Mở mục Trình kết nối MCP

Trong TypingMind, vào Plugin, mở mục Trình kết nối MCP, rồi chọn Thêm URL.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Vào mục Plugin.
  3. Mở mục Trình kết nối MCP.
  4. Nhấp vào Thêm URL.
Biểu mẫu Thêm URL máy chủ MCP tùy chỉnh của TypingMind
2

Dán URL máy chủ

Nhập URL máy chủ MCP từ nhà cung cấp vào trường URL máy chủ. Thêm tên kết nối, mô tả, biểu tượng, header HTTP tùy chỉnh hoặc cài đặt ứng dụng khách OAuth nếu máy chủ yêu cầu.

  1. Dán URL máy chủ MCP từ nhà cung cấp vào trường URL máy chủ.
  2. Nhập tên kết nối cho WhatsApp MCP Extended.
  3. Thêm mô tả và biểu tượng nếu bạn muốn dễ nhận biết kết nối hơn.
  4. Thêm header HTTP tùy chỉnh hoặc thông tin ứng dụng khách OAuth nếu máy chủ yêu cầu xác thực.
3

Tạo kết nối

Nhấp vào Tạo kết nối, sau đó quay lại danh sách Plugin và xác nhận kết nối MCP mới đang hoạt động.

  1. Nhấp vào Tạo kết nối.
  2. Quay lại danh sách trình kết nối MCP.
  3. Xác nhận kết nối WhatsApp MCP Extended hiển thị trạng thái đang hoạt động.
  4. Làm mới danh sách plugin nếu kết nối chưa xuất hiện ngay.
4

Đổi mô hình mà không cần kết nối lại

Bắt đầu cuộc trò chuyện với mô hình bạn thích, bật các công cụ của WhatsApp MCP Extended trong mục Plugin và chuyển sang mô hình khác khi cần. Kết nối MCP vẫn sẵn dùng trong không gian làm việc TypingMind.

  1. Bắt đầu cuộc trò chuyện mới trong TypingMind.
  2. Chọn mô hình AI bạn muốn dùng.
  3. Bật các công cụ của WhatsApp MCP Extended trong mục Plugin.
  4. Yêu cầu mô hình dùng công cụ khi cần.
  5. Chuyển sang mô hình AI khác và tiếp tục dùng kết nối MCP hiện có.
Cuộc trò chuyện trên TypingMind dùng các công cụ MCP đã bật với mô hình AI đã chọn
Bạn có thể dùng WhatsApp MCP Extended giúp tôi làm việc này không?
WhatsApp MCP Extended
Được. Tôi đọc rồi.
Đây là kết quả tôi tìm được bằng WhatsApp MCP Extended.

Câu hỏi thường gặp

Máy chủ MCP WhatsApp MCP Extended dùng để làm gì?

WhatsApp MCP Extended là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP WhatsApp MCP Extended với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng WhatsApp MCP Extended với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP WhatsApp MCP Extended với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối WhatsApp MCP Extended, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP WhatsApp MCP Extended với TypingMind?

Bạn có thể kết nối WhatsApp MCP Extended trong TypingMind bằng trình kết nối MCP cục bộ hoặc bằng cách thêm URL máy chủ MCP từ xa. Dùng trình kết nối cục bộ khi máy chủ cần truy cập tệp, ứng dụng hoặc tài nguyên riêng trên thiết bị của bạn; dùng URL máy chủ khi máy chủ MCP được lưu trữ từ xa.

MCP WhatsApp MCP Extended cung cấp những công cụ nào trong TypingMind?

WhatsApp MCP Extended cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP WhatsApp MCP Extended không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu WhatsApp MCP Extended yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇