The WhatsApp Web MCP server allows you to integrate WhatsApp with AI models through the Model Context Protocol (MCP). It creates a standardized interface for programmatic interaction with WhatsApp, enabling automated messaging, contact management, and group chat functionality through AI-driven workflows.
git clone https://github.com/pnizer/wweb-mcp.git
cd wweb-mcp
# Install globally
npm install -g .
# Or use with npx directly
npx .
docker build . -t wweb-mcp:latest
Option | Alias | Description | Choices | Default |
---|---|---|---|---|
--mode |
-m |
Run mode | mcp , whatsapp-api |
mcp |
--mcp-mode |
-c |
MCP connection mode | standalone , api |
standalone |
--transport |
-t |
MCP transport mode | sse , command |
sse |
--sse-port |
-p |
Port for SSE server | - | 3002 |
--api-port |
- | Port for WhatsApp API server | - | 3001 |
--auth-data-path |
-a |
Path to store authentication data | - | .wwebjs_auth |
--auth-strategy |
-s |
Authentication strategy | local , none |
local |
--api-base-url |
-b |
API base URL for MCP when using api mode | - | http://localhost:3001/api |
--api-key |
-k |
API key for WhatsApp Web REST API when using api mode | - | '' |
Create a webhook.json
file in your authentication data directory to receive incoming WhatsApp messages:
{
"url": "https://your-webhook-endpoint.com/incoming",
"authToken": "your-optional-authentication-token",
"filters": {
"allowedNumbers": ["+1234567890", "+0987654321"],
"allowPrivate": true,
"allowGroups": false
}
}
npx wweb-mcp --mode whatsapp-api --api-port 3001
npx wweb-mcp --mode mcp --mcp-mode standalone --transport sse --sse-port 3002
# First, start the WhatsApp API server
npx wweb-mcp --mode whatsapp-api --api-port 3001
# Then, start the MCP server with the API key from the logs
npx wweb-mcp --mode mcp --mcp-mode api --api-base-url http://localhost:3001/api --api-key YOUR_API_KEY --transport sse --sse-port 3002
Tool | Description | Parameters |
---|---|---|
get_status |
Check WhatsApp client connection status | None |
send_message |
Send messages to WhatsApp contacts | number : Phone number to send tomessage : Text content to send |
search_contacts |
Search for contacts by name or number | query : Search term to find contacts |
get_messages |
Retrieve messages from a specific chat | number : Phone number to get messages fromlimit (optional): Number of messages to retrieve |
get_chats |
Get a list of all WhatsApp chats | None |
create_group |
Create a new WhatsApp group | name : Name of the groupparticipants : Array of phone numbers to add |
add_participants_to_group |
Add participants to an existing group | groupId : ID of the groupparticipants : Array of phone numbers to add |
get_group_messages |
Retrieve messages from a group | groupId : ID of the grouplimit (optional): Number of messages to retrieve |
send_group_message |
Send a message to a group | groupId : ID of the groupmessage : Text content to send |
search_groups |
Search for groups by name, description, or member names | query : Search term to find groups |
get_group_by_id |
Get detailed information about a specific group | groupId : ID of the group to get |
download_media_from_message |
Download media from a message | messageId : ID of the message containing media to download |
send_media_message |
Send a media message to a WhatsApp contact | number : Phone number to send tosource : Media source with URI schemecaption (optional): Text caption for the media |
Endpoint | Method | Description | Parameters |
---|---|---|---|
/api/status |
GET | Get WhatsApp connection status | None |
/api/contacts |
GET | Get all contacts | None |
/api/contacts/search |
GET | Search for contacts | query : Search term |
/api/chats |
GET | Get all chats | None |
/api/messages/{number} |
GET | Get messages from a chat | limit (query): Number of messages |
/api/send |
POST | Send a message | number : Recipientmessage : Message content |
/api/send/media |
POST | Send a media message | number : Recipientsource : Media source URLcaption (optional): Text caption |
/api/messages/{messageId}/media/download |
POST | Download media from a message | None |
Endpoint | Method | Description | Parameters |
---|---|---|---|
/api/groups |
GET | Get all groups | None |
/api/groups/search |
GET | Search for groups | query : Search term |
/api/groups/create |
POST | Create a new group | name : Group nameparticipants : Array of numbers |
/api/groups/{groupId} |
GET | Get detailed group information | None |
/api/groups/{groupId}/messages |
GET | Get messages from a group | limit (query): Number of messages |
/api/groups/{groupId}/participants/add |
POST | Add members to a group | participants : Array of numbers |
/api/groups/send |
POST | Send a message to a group | groupId : Group IDmessage : Message content |
Start WhatsApp API server:
npx wweb-mcp -m whatsapp-api -s local
Scan the QR code with your WhatsApp mobile app
Add the following to your Claude Desktop configuration:
{
"mcpServers": {
"whatsapp": {
"command": "npx",
"args": [
"wweb-mcp",
"-m", "mcp",
"-s", "local",
"-c", "api",
"-t", "command",
"--api-base-url", "http://localhost:3001/api",
"--api-key", "YOUR_API_KEY_FROM_LOGS"
]
}
}
}
Start WhatsApp API server in Docker:
docker run -i -p 3001:3001 -v wweb-mcp:/wwebjs_auth --rm wweb-mcp:latest -m whatsapp-api -s local -a /wwebjs_auth
Scan the QR code with your WhatsApp mobile app
Add the following to your Claude Desktop configuration:
{
"mcpServers": {
"whatsapp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"wweb-mcp:latest",
"-m", "mcp",
"-s", "local",
"-c", "api",
"-t", "command",
"--api-base-url", "http://host.docker.internal:3001/api",
"--api-key", "YOUR_API_KEY_FROM_LOGS"
]
}
}
}
Restart Claude Desktop
It's not possible to start wweb-mcp in command standalone mode on Claude because Claude opens more than one process, multiple times, and each wweb-mcp needs to open a puppeteer session that cannot share the same WhatsApp authentication. Because of this limitation, we've split the app into MCP and API modes to allow for proper integration with Claude.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.