WhatsApp MCP Server (Baileys)
Provides controlled access to a WhatsApp account through a linked-device session, enabling reading chats and groups, sending text/media/polls/locations/contact cards, posting to channels, forwarding/editing/deleting/pinning/reacting to messages, managing groups and channels, broadcasting, scheduling messages, and handling chat/account settings.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
WhatsApp MCP Server (Baileys)
An MCP server that gives an AI agent — Muse, or any MCP-capable client — controlled access to a WhatsApp account: read chats and groups, send messages, media, polls, locations and contact cards, post to Channels (newsletters), pin/edit/delete messages, manage groups and more.
It connects through a normal linked-device session (the same mechanism as WhatsApp Web), powered by Baileys. You pair once with a QR code or pairing code; the session is stored locally and reused. Your session never leaves your machine.
Tools (45)
Messaging
Tool | What it does |
| Connection state of the WhatsApp socket |
| Send a text message to a number, group or channel |
| Send an image with an optional caption |
| Send a file as a document (optional display-size override) |
| Send a poll (2-12 options, optional multi-select) |
| Send a location pin |
| Send a contact card (vCard) |
| Forward a message natively (no download/re-upload) |
| Delete a message (for everyone where permitted) |
| Edit a sent text message |
| Pin or unpin a message in a chat or group |
| React to a message with an emoji |
| Read recent messages from the local store |
| List recent chats |
Broadcasts
Tool | What it does |
| Send one message to a list of individual chats (max 60, paced) |
| Send one message to many groups, or every group the account is in (max 60, paced) |
| Post one update to several channels at once (max 20, paced) |
Groups
Tool | What it does |
| List groups with names and JIDs |
| Full group metadata (participants, admins, settings) |
| Create a group (verifies who actually joined vs. got an invite) |
| Change the group name |
| Set the group description |
| Announce-only / locked toggles |
| Add / remove / promote / demote members |
| Disappearing messages: off / 24h / 7d / 90d |
| Join a group from an invite link |
| Leave a group |
| List / approve / reject join requests |
| Get a group's invite link |
Channels (Newsletters)
Tool | What it does |
| Resolve an invite link to JID, name and followers |
| Create a channel |
| Rename a channel / update its description |
| Set a channel's profile picture |
| Remove a channel's profile picture |
| Post text or an image update to a channel |
| Follow / unfollow / mute / unmute a channel |
| Subscriber count (identities are never exposed by WhatsApp) |
| Fetch recent channel post updates |
| List a channel's admins |
| Delete a channel permanently (owner only) |
Automation
Tool | What it does |
| Schedule a text to any chat/group/channel — once, daily or weekly |
| List the pending schedule queue |
| Cancel a scheduled message |
Chats & account
Tool | What it does |
| Archive / pin chat, mute, mark read |
| Block or unblock a number |
| Set the account's profile picture |
| Get a user/group profile picture URL |
| Export the session folder as one ZIP (backup/move) — full login inside, keep private |
Related MCP server: zaileys-mcp
Quick start
git clone https://github.com/Jalalkhan96/whatsapp-baileys-mcp.git
cd whatsapp-baileys-mcp
npm install
cp .env.example .env # optional; set WA_PHONE_NUMBER for pairing-code login1. Pair your WhatsApp (one time)
npm run pairWith
WA_PHONE_NUMBERset, a pairing code is printed: on your phone open WhatsApp → Settings → Linked devices → Link a device → Link with phone number instead → enter the code.Without it, a QR code is printed in the terminal to scan.
Keep the terminal open until it prints connected as ..., then Ctrl+C.
The session is saved to ./session (override with WA_SESSION_DIR).
2. Run the server
npm startThe server speaks MCP over stdio.
3. Connect your AI client
Muse — add .mcp.json in your project (or run Muse mcp add):
{
"mcpServers": {
"whatsapp": {
"command": "node",
"args": ["/absolute/path/to/whatsapp-baileys-mcp/src/index.js"],
"env": { "WA_SESSION_DIR": "/absolute/path/to/whatsapp-baileys-mcp/session" }
}
}
}Any other MCP client (Claude Desktop, Cursor, etc.) uses the same command/args/env shape in its MCP configuration.
Configuration
Env var | Meaning |
| Session folder (default |
| Number used for pairing-code login, e.g. |
|
|
| Comma list of JIDs/numbers allowed as send targets. Empty = allow all — set this if anyone but you can talk to the agent |
| Owner number, reported by |
| Optional proxy for the WhatsApp connection |
Every tool call is appended to a local audit.log (action + target + message
id — never message contents you did not send through the tools).
Safety notes
Use a secondary number if you can. This is an unofficial client (WhatsApp Web protocol); automated use carries a small account-restriction risk, as with any unofficial tool.
Set
WA_SEND_ALLOWLISTso the agent can only message targets you choose.Never commit or share your
session/folder — it is a full login to the account. It is in.gitignorefor a reason.You are responsible for complying with WhatsApp's Terms of Service and the privacy of the people you message.
Merged / hosted mode
src/wa-merged.js is an optional adapter: if your own host application already
owns a Baileys socket, set WA_MERGED=1 and publish the socket at
global.__WA_HOST_SOCK; the MCP tools then run on that shared connection
instead of opening a second one. One session must only ever have one live
connection — never run two copies of the same session at once.
License
MIT © Jalal Khan
Found a bug? Want an update?
Report it: open an Issue — bug reports and feature requests have ready-made templates.
Fix it yourself: fork the repo, make the change, and send a Pull Request. See CONTRIBUTING.md for the flow and ground rules.
Pairing note
Pairing uses src/pair-core.js: after you enter the code (or scan the QR),
WhatsApp closes the socket once with status 515 ("restart required"). The
engine reconnects in-process with the saved creds and finishes the pairing —
if a pairing attempt seems stuck at "connecting", update to the latest
version first.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read, summarize and send your own WhatsApp messages from AI assistants (OAuth 2.1).
Send WhatsApp messages and templates, manage chats, contacts, broadcasts and AI agents.
WhatsApp Business inbox for AI agents: read chats, reply, send approved templates.
WhatsApp for AI agents — your own number or the official Cloud API: messages, media, templates.
Related MCP Servers
- 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-
- AlicenseBqualityDmaintenanceEnables AI agents to control WhatsApp, including sending messages and media, reading chats, managing groups and communities, with QR/pairing auth and session persistence.1415 npm2MIT

GoWA MCP Serverofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents and tools to send and manage WhatsApp messages, media, statuses, and scheduled sends across multiple linked devices.MIT- AlicenseNot gradedqualityBmaintenanceGives AI agents safe access to a single WhatsApp account so they can read and search chats, receive new messages in real time, reply with quotes and typing indicators, send and download media, and react with emojis. Phone numbers stay on the server — agents only see random IDs and names — while sessions, messages and media are encrypted at rest and sending is rate-limited to protect the account.3MIT