
Whatsapp MCP
โ 2from Rohit678
A WhatsApp MCP (Model Context Protocol) server that connects your WhatsApp account with AI agents, enabling automated messaging, contact search, and chat interaction through LLMs.
๐ฅ๐ฅ๐ฅโ VerifiedFreeQuick setup
WhatsApp MCP + CLI
A WhatsApp integration that works in two ways:
- MCP Server โ lets AI assistants like Claude control WhatsApp directly
- CLI Tool โ send/read WhatsApp messages from your terminal
Built on whatsapp-web.js.
Features
- Send WhatsApp messages by contact name or phone number
- Read recent messages from any chat
- List all recent chats with previews
- Search contacts by name
- Works as an MCP server (Claude, etc.) or standalone CLI
MCP Server (for Claude / AI assistants)
The MCP server exposes 4 tools over stdio:
| Tool | Description |
|---|---|
send_message | Send a message to a contact |
read_messages | Read recent messages from a chat |
list_chats | List recent chats with previews |
search_contacts | Search contacts by name |
Configure in Claude Code
Add to your .mcp.json or Claude Code MCP settings:
Copy & paste โ that's it
{
"mcpServers": {
"whatsapp": {
"command": "node",
"args": ["C:/path/to/whatsapp-cli/mcp-server.mjs"]
}
}
}Run manually
Copy & paste โ that's it
node mcp-server.mjsUse Cases
- AI-powered WhatsApp assistant โ plug into Claude or any MCP-compatible AI to read and send messages hands-free
- WhatsApp automation โ build bots, auto-responders, or notification systems
- Terminal messaging โ send/read WhatsApp messages without opening your phone
- Business notifications โ send automated WhatsApp alerts from scripts or cron jobs
Project Structure
Copy & paste โ that's it
โโโ index.js # CLI entry point
โโโ mcp-server.mjs # MCP server (for AI assistants)
โโโ src/
โ โโโ client.js # WhatsApp client setup
โ โโโ commands/
โ โโโ auth.js # QR code authentication
โ โโโ send.js # Send message command
โ โโโ read.js # Read messages command
โ โโโ list-chats.js # List chats command
โโโ package.jsonLicense
MIT
Copy & paste โ that's it
npm installSetup
1. Install dependencies
Copy & paste โ that's it
npm install2. Authenticate WhatsApp
Copy & paste โ that's it
node index.js authScan the QR code with your WhatsApp mobile app. Your session is saved locally โ you only need to do this once.
CLI Usage
Send a message
Copy & paste โ that's it
node index.js send --to "John Doe" --message "Hey!"
# or by phone number
node index.js send --to 919876543210 --message "Hey!"Read messages
Copy & paste โ that's it
node index.js read --from "John Doe" --count 20List chats
Copy & paste โ that's it
node index.js list-chats --count 10Requirements
- Node.js 18+
- A WhatsApp account (personal or business)
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.