WhatsApp MCP Server
The WhatsApp MCP Server enables programmatic interaction with the WhatsApp desktop application on macOS via AppleScript automation. With this server, you can:
Send Messages to Contacts: Send text messages to specific contacts using the
send-whatsapp-messagetool (requirescontactNameandmessageparameters)Check WhatsApp Status: Verify if the WhatsApp application is running using the
check-whatsapp-statustoolList Recent Contacts: Retrieve information about recently contacted people, though functionality is limited due to WhatsApp's privacy protections
Leverages macOS-specific AppleScript automation to control the WhatsApp desktop application for sending messages and checking status without direct UI interaction.
Enables programmatic interaction with the WhatsApp desktop application on macOS, allowing for sending messages to contacts and checking the application's status through AppleScript automation.
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 a WhatsApp message to Mom saying I'll be home in 30 minutes"
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
Overview
The WhatsApp MCP (Model Context Protocol) server is a Node.js application that enables programmatic interaction with the WhatsApp desktop application on macOS. Using AppleScript automation, it provides a simple interface for sending messages and checking WhatsApp status without requiring direct interaction with the WhatsApp UI.
Related MCP server: claude-whatsapp-mcp
Features
1. Send Messages to Contacts
Send text messages to specific contacts in your WhatsApp contact list:
Messages are delivered through your connected WhatsApp desktop application
Supports proper formatting of messages including line breaks
Uses AppleScript to automate the WhatsApp desktop interface
2. Check WhatsApp Status (WIP)
Verify if the WhatsApp application is currently running:
Returns the current running status of WhatsApp
Helps prevent errors when attempting to send messages
3. List Recent Contacts (WIP)
Due to WhatsApp's privacy protections, this feature provides limited functionality:
Informs users about WhatsApp's privacy limitations
Requires exact contact names for messaging
Technical Implementation
Built With
@modelcontextprotocol/sdk - MCP server and stdio transport
Zod - Schema validation
Node.js built-in modules (child_process, util, fs)
AppleScript for macOS automation
Architecture
Uses the Model Context Protocol (MCP) for standardized tool communication
Employs stdio transport for communication
Executes AppleScript commands to interact with the WhatsApp desktop application
Implements comprehensive error logging for debugging
Requirements
macOS operating system
WhatsApp desktop application installed
Node.js v14.0.0 or higher
Internet connection
Installation
# Clone the repository
git clone https://github.com/yourusername/whatsapp-mcp-server.git
# Navigate to the project directory
cd whatsapp-mcp-server
# Install dependencies
npm installUsage
Starting the Server
node index.jsIntegrating with Claude
To enable Claude to use the WhatsApp MCP server, follow these steps:
Set up your MCP server
Install and configure the WhatsApp MCP server as described above
Ensure the server is running properly on your local machine
Configure Claude Desktop with your MCP tools
Modify your
claude_desktop_config.jsonfile to include the WhatsApp MCP toolsThis file is typically located in your Claude Desktop application configuration directory
Add the following configuration to register your WhatsApp MCP tools:
{
"mcpServers": [
{
"name": "whatsapp-mcp",
"transport": {
"command": "node",
"args": ["path/to/your/index.js"]
}
}
]
}Test the Integration
Create a test conversation with Claude
Ask Claude to send a WhatsApp message to a test contact
Verify that the message is sent successfully through the WhatsApp desktop app
MCP Tools Available
1. send-whatsapp-message
Sends a message to a specified WhatsApp contact.
Parameters:
contactName: Full name of the contact as it appears in WhatsAppmessage: Content of the message to send
Example usage (via MCP client):
const response = await client.invoke("send-whatsapp-message", {
contactName: "John Doe",
message: "Hello, how are you today?"
});2. check-whatsapp-status
Checks if the WhatsApp application is currently running.
No parameters required.
Example usage (via MCP client):
const response = await client.invoke("check-whatsapp-status", {});3. list-recent-contacts
Provides information about WhatsApp's privacy limitations for contact listing.
No parameters required.
Example usage (via MCP client):
const response = await client.invoke("list-recent-contacts", {});Implementation Details
AppleScript Automation
The server uses AppleScript to automate the WhatsApp desktop application:
Activates the WhatsApp application
Uses keyboard shortcuts to navigate the interface
Searches for contacts by name
Selects contacts using down arrow navigation
Types and sends messages
Error Handling
Comprehensive error handling and logging:
Console error output
File-based logging in
~/Library/Logs/whatsapp-mcp/Graceful handling of AppleScript execution errors
Process-level exception handling
Using WhatsApp MCP Tools with Claude
Once you've integrated the WhatsApp MCP tools with Claude, you can use natural language to instruct Claude to:
Send Messages
Example prompts:
"Send a WhatsApp message to John saying I'll be 10 minutes late for our meeting"
"Message Sarah on WhatsApp with the following text: Here's the document you requested"
"Send 'Happy birthday!' to Mom on WhatsApp"
Check WhatsApp Status
Example prompts:
"Is WhatsApp running on my computer?"
"Check if WhatsApp is active"
"Verify WhatsApp status before sending a message"
Get Contact Information
Example prompts:
"Can you list my recent WhatsApp contacts?"
"Show me who I've messaged recently on WhatsApp"
Claude will use the appropriate MCP tool based on your request and provide feedback on the result.
Limitations
Works only on macOS due to AppleScript dependency
Requires WhatsApp desktop application to be installed
Contact selection may be affected by WhatsApp UI changes
Limited access to WhatsApp's contact list due to privacy protections
Requires proper configuration of Claude to access your local MCP tools
Security Considerations
The server interacts with your personal WhatsApp account
Messages are sent from your account and appear as sent by you
Use in trusted environments only
License
MIT
Disclaimer
This project is not affiliated with WhatsApp Inc. or Meta Platforms, Inc. Use at your own discretion and in accordance with WhatsApp's terms of service.
Available Tools
3 toolscheck-whatsapp-statusB
Check if WhatsApp is currently running
Inputs: no named parameters.
list-recent-contactsB
List recently contacted people on WhatsApp (simplified)
Inputs: no named parameters.
send-whatsapp-messageC
Send a message to a contact on WhatsApp
Inputs: contactName (required), message (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: checking WhatsApp status, listing recent contacts, and sending messages. There is no overlap in functionality, making it easy for an agent to select the correct tool without confusion.
The tools follow a consistent verb-noun pattern with hyphens (e.g., check-whatsapp-status, list-recent-contacts, send-whatsapp-message). However, the use of hyphens instead of underscores is a minor deviation from common snake_case conventions, but it remains readable and predictable.
With only 3 tools, the server feels thin for managing WhatsApp interactions, as it lacks operations like reading messages, managing groups, or handling media. While the tools cover basic actions, the scope is limited, making it borderline appropriate for a comprehensive WhatsApp integration.
The toolset is significantly incomplete for a WhatsApp server, missing essential CRUD operations such as reading incoming messages, replying to messages, managing contacts or groups, and handling attachments. This will likely cause agent failures when trying to perform common WhatsApp tasks beyond the basic ones provided.
Related MCP Connectors
WhatsApp for Claude, ChatGPT or any AI agent: search, reply and send. Personal or Business API.
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Send WhatsApp messages from your own number, read the replies and send login codes.
I send and manage WhatsApp Web messages through your linked session
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Node.js application that connects WhatsApp Web with AI models through the Model Context Protocol, enabling automated messaging, contact management, and group chat functionality through AI-driven workflows.37 npm46MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to interact with WhatsApp for reading messages, sending replies, and searching contacts through the Model Context Protocol. It uses whatsapp-web.js to facilitate local connection management with QR code authentication and session persistence.4MIT
- AlicenseAqualityDmaintenanceEnables sending iMessages or SMS messages via the macOS Messages app using osascript. No Full Disk Access required, and never reads your message history.1MIT
- AlicenseAqualityCmaintenanceMCP server that gives AI agents read and write access to WhatsApp on macOS, reading local chat history offline and sending messages via pre-filled drafts with explicit user confirmation.8MIT