Provides tools to automate WhatsApp Web, enabling capabilities such as sending messages, retrieving message history, listing recent chats, and managing authentication status.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WhatsApp MCP ServerSend 'I'll be there in 5 minutes' to John Appleseed"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
WhatsApp MCP Server
A local Python MCP server that automates WhatsApp Web through Playwright and exposes a small set of WhatsApp tools over stdio.
What this project does
Runs as an MCP server over stdio.
Uses Python instead of Node.
Uses Playwright with Chromium.
Persists the WhatsApp Web session under
./data/profile.
Current tools
get_auth_statuswait_until_readylist_recent_chatssend_messageget_recent_messagesshutdown_browser
send_message and get_recent_messages accept either phone_number or chat_name. chat_name works by searching the existing WhatsApp sidebar/chat list.
For larger get_recent_messages requests, the server attempts to scroll upward and load older visible history before extracting messages.
Important limitations
This project automates WhatsApp Web, not the official WhatsApp Business API.
WhatsApp Web markup changes regularly, so selectors may need maintenance.
You should use a dedicated account and review WhatsApp's terms before production use.
The repository is initialized as a Git repository on the
mainbranch.
Recommended local setup
Copy the environment file:
cp .env.example .envCreate a virtual environment:
python3 -m venv .venv
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txt
python3 -m playwright install chromiumFor local login, set
WHATSAPP_HEADLESS=falsein.env.Start the server locally:
PYTHONPATH=src python3 -m whatsapp_mcp.mainFrom your MCP client, call
get_auth_status.If a browser window opens, scan the QR code directly in that window.
Call
wait_until_ready.
Example MCP client configuration
For Claude Desktop or another MCP client, local Python execution is the recommended configuration.
{
"mcpServers": {
"whatsapp": {
"command": "/absolute/path/to/project/.venv/bin/python3",
"args": [
"-m",
"whatsapp_mcp.main"
],
"cwd": "/absolute/path/to/project",
"env": {
"PYTHONPATH": "/absolute/path/to/project/src",
"WHATSAPP_HEADLESS": "false",
"WHATSAPP_PROFILE_DIR": "/absolute/path/to/project/data/profile"
}
}
}
}Tool examples
get_auth_status
{
"name": "get_auth_status",
"arguments": {}
}send_message
{
"name": "send_message",
"arguments": {
"chat_name": "John Appleseed",
"text": "Hello from the WhatsApp MCP server"
}
}get_recent_messages
{
"name": "get_recent_messages",
"arguments": {
"chat_name": "John Appleseed",
"count": 10
}
}Project structure
.
├── docs/
├── src/whatsapp_mcp/
├── .env.example
└── pyproject.tomlDocumentation
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.