mcp-whatsapp
MCP server that connects AI agents to WhatsApp using the multi-device API, enabling messaging, group management, and more as a regular user.
README
mcp-whatsapp
<div align="center">
WhatsApp MCP Server — connect AI agents to WhatsApp as a regular user.
</div>
Overview
MCP (Model Context Protocol) server that connects AI agents to WhatsApp through the multi-device API. Works as a regular WhatsApp user — not a business bot.
Built with Baileys, Bun, and TypeScript.
⚠️ Disclaimer: This project uses an unofficial WhatsApp API. Your account could be restricted or banned by WhatsApp. Use a secondary phone number. We are not responsible for any account actions taken by WhatsApp.
Features
- 🔌 MCP Protocol — works with Claude Desktop, Cursor, and any MCP client
- 💬 Messages — send, read, edit, delete, forward, react, polls, star
- 📎 Media — images, videos, documents, stickers, voice notes, audio, locations, contacts
- 👥 Groups — create, manage members, promote/demote admins, invite links, settings
- 🏘️ Communities — create, link/unlink groups, manage members
- 📢 Channels — create, follow/unfollow, mute newsletters
- 🏷️ Labels — label chats and messages (WhatsApp Business)
- 🔒 Privacy — last seen, profile photo, online status, read receipts, group add
- 👤 Profile — update name, status, picture, business profiles, call links
- 🗂️ Chats — list, search, archive, mute, pin, mark read, disappearing messages
- 🔐 Machine-bound sessions — encrypted with hardware ID, useless if copied to another device
- 📦 Single binary — no Node.js, no npm, just download and run
Quick Start
Download binary
Grab the latest release for your platform from GitHub Releases.
# Linux
chmod +x mcp-whatsapp-linux-x64
./mcp-whatsapp-linux-x64
# macOS
chmod +x mcp-whatsapp-darwin-arm64
./mcp-whatsapp-darwin-arm64
Build from source
git clone https://github.com/gridmint/mcp-whatsapp.git
cd mcp-whatsapp
bun install
bun run build
./mcp-whatsapp
Connect to Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"whatsapp": {
"command": "/path/to/mcp-whatsapp"
}
}
}
Tools (77)
Messages (10)
| Tool | Description |
|---|---|
send_message |
Send text with optional quote/reply |
send_image |
Send an image with optional caption |
send_document |
Send a file/document |
send_reaction |
React to a message with emoji |
read_messages |
Read recent messages from a chat |
delete_message |
Delete a message for everyone |
edit_message |
Edit a sent message |
forward_message |
Forward a message to another chat |
create_poll |
Create a poll with multiple options |
star_message |
Star or unstar a message |
Chats (7)
| Tool | Description |
|---|---|
list_chats |
List all conversations |
get_chat_info |
Get chat/group details |
search_messages |
Search messages by keyword |
archive_chat |
Archive or unarchive a chat |
mute_chat |
Mute or unmute notifications |
pin_chat |
Pin or unpin a chat |
mark_as_read |
Mark all messages as read |
Contacts (5)
| Tool | Description |
|---|---|
check_number |
Check if number is on WhatsApp |
get_profile_picture |
Get profile picture URL |
get_status |
Get contact's about/status text |
block_contact |
Block or unblock a contact |
set_presence |
Set online/offline/typing status |
Groups (13)
| Tool | Description |
|---|---|
create_group |
Create a new group |
get_group_metadata |
Get full group info & participants |
update_group_subject |
Change group name |
update_group_description |
Change group description |
add_group_members |
Add members to a group |
remove_group_members |
Remove members from a group |
promote_group_admin |
Promote members to admin |
demote_group_admin |
Demote admins to members |
leave_group |
Leave a group |
get_group_invite_link |
Get group invite link |
revoke_group_invite |
Revoke and regenerate invite link |
join_group_via_invite |
Join group using invite code |
update_group_settings |
Update who can send/edit info |
Media (7)
| Tool | Description |
|---|---|
send_video |
Send video (or GIF) |
send_sticker |
Send a sticker |
send_voice |
Send voice note (with waveform) |
send_audio |
Send audio file |
send_location |
Send a location pin |
send_contact |
Send a contact card (vCard) |
download_media |
Download media from a message |
Channels / Newsletters (6)
| Tool | Description |
|---|---|
create_newsletter |
Create a WhatsApp Channel |
get_newsletter_info |
Get channel metadata |
follow_newsletter |
Subscribe to a channel |
unfollow_newsletter |
Unsubscribe from a channel |
mute_newsletter |
Mute channel notifications |
unmute_newsletter |
Unmute channel notifications |
Privacy (7)
| Tool | Description |
|---|---|
get_privacy_settings |
Get current privacy settings |
update_last_seen_privacy |
Who sees your last seen |
update_profile_picture_privacy |
Who sees your profile photo |
update_status_privacy |
Who sees your about/status |
update_read_receipts_privacy |
Toggle blue ticks |
update_groups_add_privacy |
Who can add you to groups |
update_online_privacy |
Who sees when you're online |
Communities (11)
| Tool | Description |
|---|---|
create_community |
Create a new community |
get_community_metadata |
Get community info |
community_fetch_groups |
List linked groups |
community_create_group |
Create a group in a community |
community_link_group |
Link existing group to community |
community_unlink_group |
Unlink a group |
community_update_subject |
Update community name |
community_update_description |
Update community description |
leave_community |
Leave a community |
community_add_members |
Add members |
community_remove_members |
Remove members |
Labels (4)
| Tool | Description |
|---|---|
add_chat_label |
Add label to a chat |
remove_chat_label |
Remove label from a chat |
add_message_label |
Add label to a message |
remove_message_label |
Remove label from a message |
Profile & Misc (6)
| Tool | Description |
|---|---|
update_profile_name |
Change your display name |
update_profile_status |
Change your about text |
update_profile_picture |
Change your profile photo |
get_business_profile |
Get business profile info |
create_call_link |
Create audio/video call link |
set_disappearing_messages |
Toggle disappearing messages |
Status (1)
| Tool | Description |
|---|---|
get_connection_status |
Connection state + rate limit stats |
Rate Limiting
Built-in sliding-window rate limiter protects your account from bans:
- Global: 30 write operations per minute
- Per-chat: 10 write operations per minute
- Read operations (list, search, get) are not rate-limited
- Exceeding limits returns a clear error with retry timing
Authentication
On first run, a QR code is displayed in the terminal. Scan it with WhatsApp on your phone:
- Open WhatsApp → Settings → Linked Devices → Link a Device
- Scan the QR code
Session is saved to ~/.mcp-whatsapp/auth/ — you won't need to scan again unless you log out.
Security
Session files are encrypted at rest (AES-256-GCM). By default, the encryption key is derived from your machine's hardware ID — no configuration needed.
- ✅ On your machine — works automatically, no extra steps
- ❌ Copied to another machine — can't decrypt, must scan QR again
- ❌ Stolen backup — encrypted, useless without the original hardware
Optionally, set your own encryption key via environment variable:
export MCP_WHATSAPP_SESSION_KEY=my-secret-key
This is useful for Docker containers, CI, or when you want to control the key yourself. If set, it takes priority over the machine ID.
Additional recommendations:
- Use a secondary phone number — your main account stays safe
- Check Linked Devices in WhatsApp periodically
- Keep your machine secure (disk encryption, strong passwords)
Development
bun install # install dependencies
bun run dev # run in development mode
bun run lint # check code with Biome
bun run lint:fix # auto-fix lint issues
bun run format # format code
bun test # run tests
Roadmap
- [x]
Group management(v0.2.0) - [x]
Stickers, GIFs, voice messages(v0.2.0) - [x]
Newsletters/Channels(v0.2.0) - [x]
Privacy settings(v0.2.0) - [x]
Polls(v0.2.0) - [x]
Community management(v0.3.0) - [x]
Business features (labels)(v0.3.0) - [x]
Profile management(v0.3.0) - [x]
Call link creation(v0.3.0) - [x]
Disappearing messages(v0.3.0) - [ ] Status/Stories (view and post)
- [ ] Product catalogs
- [ ] Rate limiting (ban protection)
License
MIT — see LICENSE.
Related
- mcp-telegram — Telegram MCP server by the same team
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。