
A powerful bridge between WhatsApp Web and AI models using the Model Context Protocol (MCP). This project enables AI models like Claude to interact with WhatsApp through a standardized interface,...
概览
A powerful bridge between WhatsApp Web and AI models using the Model Context Protocol (MCP). This project enables AI models like Claude to interact with WhatsApp through a standardized interface, making it easy to automate and enhance WhatsApp interactions programmatically. WhatsApp Web MCP provides a seamless integration between WhatsApp Web and AI models by: - Creating a standardized interface through the Model Context Protocol (MCP) - Offering MCP Server access to WhatsApp functionality - Providing flexible deployment options through SSE or Command modes - Supporting both direct WhatsApp client integration and API-based connectivity : This tool is for testing purposes only and should not be used in production environments. This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at whatsapp.com.
README
以下为原文 README 节选,完整内容请查看原文。
WhatsApp Web MCP
A powerful bridge between WhatsApp Web and AI models using the Model Context Protocol (MCP). This project enables AI models like Claude to interact with WhatsApp through a standardized interface, making it easy to automate and enhance WhatsApp interactions programmatically.
Overview
WhatsApp Web MCP provides a seamless integration between WhatsApp Web and AI models by:
- Creating a standardized interface through the Model Context Protocol (MCP)
- Offering MCP Server access to WhatsApp functionality
- Providing flexible deployment options through SSE or Command modes
- Supporting both direct WhatsApp client integration and API-based connectivity
Disclaimer
IMPORTANT: This tool is for testing purposes only and should not be used in production environments.
Disclaimer from WhatsApp Web project:
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at whatsapp.com. “WhatsApp” as well as related names, marks, emblems and images are registered trademarks of their respective owners. Also it is not guaranteed you will not be blocked by using this method. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn’t be considered totally safe.
Installation
-
Clone the repository:
git clone https://github.com/pnizer/wweb-mcp.git cd wweb-mcp -
Install globally or use with npx:
# Install globally npm install -g . # Or use with npx directly npx . -
Build with Docker:
docker build . -t wweb-mcp:latest
Configuration
Command Line Options
| 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 | - | '' |
API Key Authentication
When running in API mode, the WhatsApp API server requires authentication using an API key. The API key is automatically generated when you start the WhatsApp API server and is displayed in the logs:
WhatsApp API key: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
安装
npx wweb-mcp -m mcp -s local -c api -t command --api-base-url http://localhost:3001/api --api-key 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef配置
{
"mcpServers": {
"whatsapp": {
"command": "npx",
"args": [
"wweb-mcp",
"-m", "mcp",
"-s", "local",
"-c", "api",
"-t", "command",
"--api-base-url", "http://localhost:3001/api",
"--api-key", "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
]
}
}
}