WhatsApp MCP Server
Provides tools to automate WhatsApp Web, enabling capabilities such as sending messages, retrieving message history, listing recent chats, and managing authentication status.
Click on "Deploy 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 Server Send '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.
Related MCP server: MCP Playwright Server
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
Available Tools
6 toolsget_auth_statusB
Open WhatsApp Web if needed and report whether login is complete.
Inputs: no named parameters.
get_recent_messagesC
Read recent messages from a chat identified by either a phone number or a chat name.
Inputs: phone_number, chat_name, limit, count.
list_recent_chatsC
List the most recent chats visible in WhatsApp Web.
Inputs: limit.
send_messageC
Send a WhatsApp message using either a phone number or an existing chat name.
Inputs: text (required), phone_number, chat_name.
shutdown_browserA
Close the browser context and stop the WhatsApp automation session.
Inputs: no named parameters.
wait_until_readyB
Wait until WhatsApp Web is fully authenticated and ready for use.
Inputs: timeout_seconds.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap: authentication status, message retrieval, chat listing, message sending, session shutdown, and readiness waiting. The descriptions make it unambiguous which tool to use for each task.
All tools follow a consistent verb_noun pattern (e.g., get_auth_status, send_message, shutdown_browser) with snake_case throughout. The naming is predictable and readable across all six tools.
Six tools is well-scoped for a WhatsApp automation server, covering core operations like authentication, messaging, chat management, and session control without being too sparse or bloated. Each tool earns its place in the workflow.
The toolset covers essential WhatsApp Web operations (authentication, messaging, chat listing) and session lifecycle (shutdown, readiness). Minor gaps might include advanced features like media handling or group management, but core workflows are well-supported.
Maintenance
Related MCP Connectors
Your own WhatsApp as an MCP server: read, search and send from any MCP client.
WhatsApp MCP on your own number: read chats, search contacts, send messages.
Free WhatsApp MCP server for ChatGPT and Claude: read and search chats, every send you approve.
Drive WhatsApp from any MCP client: pair devices, send text and media, manage contacts and groups.
Related MCP Servers
- AlicenseCqualityBmaintenanceA comprehensive MCP server that provides powerful web automation tools using Playwright, enabling web scraping, testing, and browser interaction through natural language commands.3815MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI-powered browser automation, web scraping, and testing using Playwright across Chromium, Firefox, and WebKit. It allows users to perform actions like navigation, clicking, typing, and taking screenshots through natural language interfaces.24 npmMIT
- AlicenseBqualityCmaintenanceAn MCP server that enables interaction with WhatsApp using the Baileys library and Streamable HTTP transport. It supports managing contacts, chats, and messages, while providing a web admin UI for QR code authentication and media handling.4285MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables AI to control WhatsApp Web via Puppeteer Stealth for reading and sending messages. It features human-like interaction patterns and anti-ban protections to securely manage chats and communications through natural language.313 npmMIT