WhatsApp MCP Server
by jlucaso1
This is a Model Context Protocol (MCP) server for WhatsApp, built with TypeScript and using the `@whiskeysockets/baileys` library. It allows you to connect your personal WhatsApp account to an AI agent enabling it to interact with your WhatsApp data.
Last updated: N/A
What is WhatsApp MCP Server?
This server allows you to connect your personal WhatsApp account to an AI agent (like Anthropic Claude or Cursor) via the Model Context Protocol (MCP). It enables the AI agent to search messages, contacts, list chats, retrieve message history, and send messages on your behalf.
How to use WhatsApp MCP Server?
After installing the server and configuring your AI client with the correct path to the server's main.ts
file, you can interact with your WhatsApp data through the AI agent's interface. Ask the agent to perform actions like searching contacts or sending messages, and the server will handle the communication with WhatsApp.
Key features of WhatsApp MCP Server
search_contacts: Search for contacts by name or phone number.
list_messages: Retrieve message history for a specific chat, with pagination.
list_chats: List your chats, sortable, filterable, paginated, with optional last message details.
get_chat: Get detailed information about a specific chat.
get_message_context: Retrieve messages before and after a specific message ID for context.
send_message: Send a text message to a specified recipient JID (user or group).
Use cases of WhatsApp MCP Server
Allow an AI agent to summarize recent conversations with a specific contact.
Enable an AI agent to search for information within your WhatsApp message history.
Automate sending messages based on specific triggers or conditions.
Integrate WhatsApp communication into AI-powered workflows.
FAQ from WhatsApp MCP Server
How do I fix QR code issues?
How do I fix QR code issues?
Check the console output for the quickchart.io
URL and open it manually. Ensure you scan the QR code promptly with your phone's WhatsApp app.
What do I do if I get logged out?
What do I do if I get logged out?
Stop the server, delete the ./auth_info/
directory, and restart the server (node src/main.ts
) to get a new QR code.
What if my messages are out of sync?
What if my messages are out of sync?
Stop the server, delete both ./auth_info/
and ./data/
directories, then restart the server to re-authenticate and resync history.
How do I troubleshoot MCP connection problems?
How do I troubleshoot MCP connection problems?
Double-check the command
and args
(especially the {{PATH_TO_REPO}}
) in your claude_desktop_config.json
or mcp.json
. Ensure the path is absolute and correct. Verify Node.js is correctly installed and in your system's PATH. Check the AI client's logs and this server's logs (mcp-logs.txt
) for errors.
What if I get errors sending messages?
What if I get errors sending messages?
Ensure the recipient JID is correct (e.g., [email protected]
for users, [email protected]
for groups). Check wa-logs.txt
for specific errors from Baileys.