Labsco
Rohit678 logo

Whatsapp MCP

โ˜… 2

from 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:

ToolDescription
send_messageSend a message to a contact
read_messagesRead recent messages from a chat
list_chatsList recent chats with previews
search_contactsSearch 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.mjs

Use 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.json

License

MIT