WhatsApp MCP
Drives the user's own WhatsApp Web session in Chrome to read and search chats, contacts, and messages, start new chats, send text, files and contact cards, pin chats and messages, receive incoming messages, and answer them through template, draft or fully automatic auto-reply profiles with per-contact scoping, active hours, cooldowns and rate limits.
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
Use WhatsApp Web in your own Chrome profile as a Python library, a CLI, a REST API, or an MCP server. An AI assistant (Claude Code or any MCP client) can read and search chats, contacts, and messages, start new chats, send text, files, and contact cards, pin chats and messages, receive incoming messages, and answer them through auto-reply profiles.
The work is done by the official WhatsApp Web that you logged into with its QR code. This package does not reimplement the WhatsApp protocol and never holds a password or account key. Every command runs inside the WhatsApp Web client in your Chrome tab, through WhatsApp Web's own modules.
Up and running
git clone https://github.com/alfa-yohannis/whatsapp-mcp
cd whatsapp-mcp
./whatsapp install # Windows: whatsapp.cmd installIn Chrome, open
chrome://extensions, turn on Developer mode, click Load unpacked, and choose thewhatsapp_mcp/extensionfolder.Open WhatsApp Web in that profile and scan its QR code with your phone if asked (WhatsApp > Linked devices > Link a device).
Check with
./whatsapp status, which should end withlogged_in.Connect Claude Code:
claude mcp add whatsapp -- "$PWD/whatsapp" mcp.For auto-reply, open the side panel from the extension's popup, create a profile, link contacts, and press Dry run or Run.
The full walkthrough, with screenshots and troubleshooting, is in docs/UP-AND-RUNNING.md.
Related MCP server: WhatsApp MCP Server
How it works
Claude Code / CLI / REST API / your Python program
│ WhatsAppClient: TCP 127.0.0.1 + token from the bridge card
▼
native messaging host (whatsapp_mcp/host.py, started by Chrome)
│ native messaging (stdio)
▼
WhatsApp MCP Chrome extension (whatsapp_mcp/extension/)
│ chrome.scripting, MAIN world
▼
bridge.js in https://web.whatsapp.com/ → WhatsApp Web modules (WAWebCollections, ...)Incoming messages travel the other way: the bridge listens to WhatsApp Web's
message collection, the extension forwards each message to the host, and the
host broadcasts it to subscribed clients (the MCP server, whatsapp watch,
GET /events, and the auto-reply service).
An extension is needed because Chrome 136+ ignores DevTools remote debugging on
the default profile directory, and Chrome 137+ ignores --load-extension. With
an extension, WhatsApp MCP works in the same Chrome profile you use every day.
Requirements
Python 3.10 or newer
Google Chrome (Linux, Windows, or macOS)
WhatsApp on your phone, to link WhatsApp Web with its QR code
For draft and auto replies: the Claude Code CLI (
claude)
Installation
git clone https://github.com/alfa-yohannis/whatsapp-mcp
cd whatsapp-mcp
./whatsapp install # Windows: whatsapp.cmd installThe ./whatsapp launcher installs the package and its dependencies on first
run: into $WHATSAPP_VENV when set, into ~/venv when it exists, or into
.venv in this directory. install registers the native messaging host with
Chrome (a manifest file on Linux and macOS, an HKCU registry key on Windows)
and prints how to load the extension. Do this once in the Chrome profile where
WhatsApp Web is logged in:
Open
chrome://extensions.Turn on Developer mode.
Click Load unpacked and choose the
whatsapp_mcp/extensiondirectory.Check that the extension ID is
cboalnfagfemagdelpgjlafpbcjngiom.
The extension attaches itself to an open WhatsApp Web tab. Its toolbar icon shows the host and login status, with buttons to open WhatsApp Web and the auto-reply side panel.
Then check:
./whatsapp statusIf WhatsApp Web is not logged in, scan the QR code in the WhatsApp Web tab with your phone: WhatsApp > Linked devices > Link a device. Logging in is always done by you; nothing in this package touches the QR code.
Chrome and its profiles
When Chrome is not running, ./whatsapp open (the open_whatsapp tool)
starts it and opens WhatsApp Web. The profile used is:
the one requested (
--profile "Profile 3"or its display name), orWHATSAPP_CHROME_PROFILEin.env;otherwise the most recently used profile, preferring profiles that already have the WhatsApp MCP extension.
./whatsapp profiles lists every profile with a masked email, when it was
last active, and which one will be picked.
Using it
MCP (Claude Code)
claude mcp add whatsapp -- /path/to/whatsapp-mcp/whatsapp mcpTo get incoming messages pushed into a Claude Code session as channel
notifications, add the server to your project's .mcp.json and start:
claude --dangerously-load-development-channels server:whatsappClaude Code channels are a research preview. Without them, incoming messages
are still available through the incoming_messages tool. By default only
messages from saved contacts are pushed (WHATSAPP_NOTIFY_FROM). Every tool is
listed in docs/MCP.md.
CLI
./whatsapp chats --search alice
./whatsapp messages "Alice Example" --limit 20
./whatsapp search "faculty meeting"
./whatsapp send Alice --text "Hello" --text "Did you arrive?" # dry run
./whatsapp send Alice --text "Hello" --send # for real
./whatsapp send-files Alice report.pdf photo.jpg --caption "Here you go"
./whatsapp watch # incoming messagesEvery command is in docs/CLI.md.
REST API
./whatsapp api # http://127.0.0.1:8000, interactive docs at /docsEndpoints are in docs/API.md.
Python library
from whatsapp_mcp import WhatsAppClient, list_chats, send_message
client = WhatsAppClient()
print(list_chats(client, search="alice"))
plan = send_message(client, "Alice", ["Hello"]) # dry run
send_message(client, "Alice", ["Hello"], send=True) # for realAuto-reply
Reply profiles decide how incoming messages are answered. Contacts and profiles are many to many: one profile ("Students", "Family") covers many contacts, a contact (or group) can carry several profiles, and the highest priority wins. Each profile has a mode:
Mode | What happens |
| fixed text with |
| the Claude CLI writes a reply from the profile's instructions; it waits for your approval |
| the Claude CLI writes the reply and it is sent right away |
A profile also has a scope (only linked contacts, any saved contact, or everyone), active hours and days, a per-chat cooldown, and a switch for groups (off by default). A global limit caps replies per hour.
Manage profiles in the extension's side panel (toolbar icon > Auto-reply
profiles), with ./whatsapp replies ..., the MCP tools, or the REST API. Then
start the service with the buttons at the top of the side panel: Dry run
to try your profiles (every reply becomes a draft), Run to answer for real,
Stop to stop. The service runs inside the native messaging host, so it
works whenever Chrome is open, and Run is remembered when Chrome restarts. The
same controls exist elsewhere:
./whatsapp service start --dry-run # like Dry run in the side panel
./whatsapp service start # like Run
./whatsapp service status # running or not, counts, recent activity
./whatsapp service stop # like Stop
./whatsapp service # run it in this terminal instead, until Ctrl+COnly one service runs at a time (an OS file lock), so no reply goes out twice.
Draft and auto replies are written by Claude Haiku (WHATSAPP_REPLY_MODEL).
Incoming messages are untrusted text. The reply writer runs
claude -p --tools "" --strict-mcp-config, so it has no tools and no MCP
servers: it can only return text, and that text only goes to the chat the
message came from. Drafts wait in the side panel, ./whatsapp replies drafts,
or the list_replies tool until you approve or reject them.
Sending is always a dry run first
Everything that writes to WhatsApp (send_message, send_files,
send_contacts, pin_chat, pin_message, approve_draft) is a dry run by
default. What comes back is a summary: the chat that was found (name and id),
the content, and the files. Sending only happens with send=True (CLI:
--send), and it goes to that resolved chat id, not to whatever name was
typed. A name that matches several chats is rejected with the list of choices.
If a command went out but its answer was lost, the result is UncertainResult
(MCP: sent=true, ok=false) and it is never retried automatically, so a
message is not sent twice.
Settings
Copy .env.example to .env and fill in only what you need. Settings that are
safe to share can also go in whatsapp.yaml (see whatsapp.yaml.example).
Precedence: configure() in code, the environment, .env, whatsapp.yaml,
then the default.
Setting | Default | Purpose |
| most recently used | Chrome profile to open |
| found automatically | path of the Chrome program |
| OS default | Chrome user data directory |
|
| replaces a leading 0 in phone numbers |
| empty | REST API bearer token |
|
|
|
|
| desktop notifications from the MCP server |
|
| pause between messages in one send |
|
| largest file accepted |
|
| time zone of dates in the output |
|
| Claude CLI used by draft and auto profiles |
|
| model the Claude CLI uses for replies |
|
| auto-reply limit across all chats |
Security and limits
Bridge cards (host port and token) and the reply database live in the user's state directory with mode 0600:
~/.local/state/whatsapp-mcp(Linux),~/Library/Application Support/whatsapp-mcp(macOS),%LOCALAPPDATA%\whatsapp-mcp(Windows).The host only listens on 127.0.0.1. Without
WHATSAPP_API_TOKENthe REST API only serves this computer.Reading messages through this package does not mark them as read.
Incoming message content is written by other people. The assistant is told to treat it as data, never as instructions.
WhatsApp does not officially support automating a personal account, and bulk sending can get a number banned. Keep volumes low.
WhatsApp Web can change at any time. If its internal modules are renamed, fix
whatsapp_mcp/extension/bridge.jsand run./whatsapp reload.
Layout
whatsapp Linux/macOS launcher
whatsapp.cmd Windows launcher
whatsapp_mcp/
extension/ Chrome extension (manifest, background.js, bridge.js, relay.js, popup, side panel)
host.py native messaging host
whatsapp_client.py WhatsAppClient and errors
chrome.py the Chrome program, its profiles, and launching it
install.py host registration for Chrome
status.py check_login and open_whatsapp
chat.py, contacts.py, messages.py, attachments.py
autoreply.py reply profiles, contact links, drafts, the engine, and the service
writes.py WriteResult (dry run and send)
cli.py, api.py, mcp_server.py
docs/ UP-AND-RUNNING.md, MCP.md, CLI.md, API.md, images/
examples/ ready-to-run examples
tests/ unit tests (./whatsapp test)License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Read, summarize and send your own WhatsApp messages from AI assistants (OAuth 2.1).
WhatsApp CRM for AI agents: search contacts, read chats, manage the sales pipeline, send messages.
WhatsApp for Claude, ChatGPT or any AI agent: search, reply and send. Personal or Business API.
Your own WhatsApp in Claude and ChatGPT: read chats, draft replies, send messages you approve.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to control WhatsApp, including sending messages and media, reading chats, managing groups and communities, with QR/pairing auth and session persistence.1416 npm2MIT
- 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.4MIT
- AlicenseNot gradedqualityNot gradedmaintenanceLets AI assistants read, search, and send messages from a linked WhatsApp account, with full-text search, media handling, and contact and group management.GPL 3.0
- AlicenseNot gradedqualityBmaintenanceWA MCP is a hosted WhatsApp MCP server. It connects your own WhatsApp number to Claude, Claude Code, ChatGPT, Grok Bot, Cursor or any MCP client. Free plan with no time limit, nothing to install.MIT