Server data from the Official MCP Registry
MCP server for WhatsApp via whatsapp-web.js: send/receive messages, media, chats, groups, contacts
MCP server for WhatsApp via whatsapp-web.js: send/receive messages, media, chats, groups, contacts
Valid MCP server (2 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.
4 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Set these up before or after installing:
Environment variable: LOG_LEVEL
Environment variable: LOG_STDERR_LEVEL
Environment variable: WHATSAPP_HEADLESS
Environment variable: BROWSER_EXECUTABLE_PATH
Environment variable: WHATSAPP_SESSION_DIR
Environment variable: WHATSAPP_PAIRING_PHONE_NUMBER
Environment variable: FFMPEG_PATH
Environment variable: WA_WEB_VERSION
Environment variable: HEALTH_CHECK_INTERVAL_MS
Environment variable: TOOL_READY_TIMEOUT_MS
Environment variable: MCP_HTTP_PORT
Environment variable: MCP_HTTP_HOST
Environment variable: MCP_OAUTH
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-mario-andreschak-mcp-whatsapp-web": {
"env": {
"LOG_LEVEL": "your-log-level-here",
"MCP_OAUTH": "your-mcp-oauth-here",
"FFMPEG_PATH": "your-ffmpeg-path-here",
"MCP_HTTP_HOST": "your-mcp-http-host-here",
"MCP_HTTP_PORT": "your-mcp-http-port-here",
"WA_WEB_VERSION": "your-wa-web-version-here",
"LOG_STDERR_LEVEL": "your-log-stderr-level-here",
"WHATSAPP_HEADLESS": "your-whatsapp-headless-here",
"WHATSAPP_SESSION_DIR": "your-whatsapp-session-dir-here",
"TOOL_READY_TIMEOUT_MS": "your-tool-ready-timeout-ms-here",
"BROWSER_EXECUTABLE_PATH": "your-browser-executable-path-here",
"HEALTH_CHECK_INTERVAL_MS": "your-health-check-interval-ms-here",
"WHATSAPP_PAIRING_PHONE_NUMBER": "your-whatsapp-pairing-phone-number-here"
},
"args": [
"-y",
"mcp-whatsapp-web"
],
"command": "npx"
}
}
}From the project's GitHub README.
A Model Context Protocol (MCP) server for WhatsApp Web, implemented in TypeScript. This project is a TypeScript port of the original whatsapp-mcp repository.
With this MCP server, you can:
MCP_HTTP_PORT to additionally expose http://127.0.0.1:<port>/mcp, or run HTTP-only with --http)request_pairing_code tool, or automatically printed to stderr at startup via WHATSAPP_PAIRING_PHONE_NUMBER), and an optional OAuth flow for HTTP clients (MCP_OAUTH=true) where the browser authorization page shows the WhatsApp QR code — unlinking WhatsApp revokes tokens so clients automatically re-authenticateThis MCP server consists of:
FFmpeg is bundled automatically via the ffmpeg-static npm package — no manual installation needed. You can point the FFMPEG_PATH environment variable at your own binary to override it.
Clone this repository
git clone https://github.com/mario-andreschak/mcp-whatsapp-web.git
cd mcp-whatsapp-web
Install dependencies
npm install
Build the project
npm run build
Configure environment variables (optional)
Copy the example environment file and modify as needed:
cp .env.example .env
You can adjust logging levels, pin the WhatsApp Web version, or override the auto-detected browser (BROWSER_EXECUTABLE_PATH) and ffmpeg binary (FFMPEG_PATH) if needed. WHATSAPP_HEADLESS=false shows the browser window (debugging aid), and WHATSAPP_SESSION_DIR relocates the session/browser-profile directory (useful for running multiple instances or isolated test runs).
FLUJO provides a streamlined installation process:
https://github.com/mario-andreschak/mcp-whatsapp-webFLUJO will automatically handle the cloning, dependency installation, and building process for you.
npm start
This will start the MCP server using stdio transport by default, which is suitable for integration with Claude Desktop or similar applications.
Important: After starting the server for the first time, you must authenticate with WhatsApp by using the
get_qr_codetool and scanning the QR code with your phone. See the Authentication section for detailed instructions.
npm run dev
This starts the server in development mode with TypeScript watch mode and automatic server restarts.
npm run debug
This launches the MCP Inspector tool, which provides a web interface for testing and debugging your MCP server. The inspector allows you to:
Create a configuration file for Claude Desktop:
{
"mcpServers": {
"whatsapp": {
"command": "node",
"args": [
"PATH_TO/dist/index.js"
]
}
}
}
Replace PATH_TO with the absolute path to the repository.
Save this as claude_desktop_config.json in your Claude Desktop configuration directory:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonRestart Claude Desktop
Create a configuration file for Cursor:
{
"mcpServers": {
"whatsapp": {
"command": "node",
"args": [
"PATH_TO/dist/index.js"
]
}
}
}
Replace PATH_TO with the absolute path to the repository.
Save this as mcp.json in your Cursor configuration directory:
~/.cursor/mcp.json%USERPROFILE%\.cursor\mcp.jsonRestart Cursor
The first time you run the server, you'll need to authenticate with WhatsApp:
get_qr_code tool to generate a QR code
Your session will be saved locally in the whatsapp-sessions directory and will be reused automatically on subsequent runs. If you don't authenticate using the QR code, you won't be able to use any WhatsApp functionality.
You can check your current authentication status and manage your session:
check_auth_status tool to verify if you're currently authenticatedlogout tool to log out from your current sessionget_qr_code tool to authenticate with a new QR codeThis is particularly useful when:
get_qr_code- Get the QR code for WhatsApp Web authenticationcheck_auth_status- Check if you're currently authenticated with WhatsApplogout- Log out from WhatsApp and clear the current sessionsearch_contacts- Search for contacts by name or phone numberget_contact- Get information about a specific contactlist_chats- List available chats with metadataget_chat- Get information about a specific chatget_direct_chat_by_contact- Find a direct chat with a specific contactlist_messages- Retrieve messages with optional filtersget_message- Get a specific message by IDsend_message- Send a text message to a chatsend_file- Send a file (image, video, document) to a chatsend_audio_message- Send an audio message (voice note)download_media- Download media from a messageThis MCP server uses Puppeteer to control Chrome browsers for WhatsApp Web connectivity. The server includes a robust browser process management system to prevent orphaned Chrome processes.
The server automatically:
.chrome-pids.jsonIf you notice orphaned Chrome processes that weren't automatically cleaned up, you can use the included cleanup utility:
npm run cleanup-browsers
This utility will:
src/index.ts- Entry pointsrc/server.ts- MCP server implementationsrc/services/whatsapp.ts- WhatsApp Web servicesrc/tools/- Tool implementations for various WhatsApp featuressrc/types/- TypeScript type definitionssrc/utils/- Utility functionsnpm run build- Build the TypeScript codenpm run dev- Run in development mode with watchnpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run cleanup-browsers- Detect and clean up orphaned Chrome browser processesnpm test - Run the unit test suite (fast, no browser needed)npm run test:watch - Run unit tests in watch mode during developmentnpm run test:e2e - Build, then run end-to-end tests (spawns the real server incl. a headless browser)check_auth_status to verify)logout tool first, then request a new QR codecheck_auth_status to confirm your authentication statusnpm run cleanup-browsers to detect and clean up orphaned processesps aux | grep chrome to check for orphaned processesMIT
This project is a TypeScript port of the original whatsapp-mcp by lharries.
Be the first to review this server!
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption