M

MCP Whatsapp Web

by mario-andreschak · io.github.mario-andreschak/mcp-whatsapp-web

WhatsApp MCP via web.js or browserless Baileys: messages, media, chats, groups and contacts

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-mario-andreschak-mcp-whatsapp-web": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-whatsapp-web"
      ],
      "env": {
        "WHATSAPP_BACKEND": "webjs",
        "BAILEYS_SESSION_DIR": "<VALUE>",
        "LOG_LEVEL": "info",
        "LOG_STDERR_LEVEL": "warn",
        "WHATSAPP_HEADLESS": "<VALUE>",
        "WHATSAPP_NO_SANDBOX": "false",
        "BROWSER_EXECUTABLE_PATH": "<VALUE>",
        "WHATSAPP_SESSION_DIR": "<VALUE>",
        "WHATSAPP_PAIRING_PHONE_NUMBER": "<VALUE>",
        "FFMPEG_PATH": "<VALUE>",
        "WA_WEB_VERSION": "<VALUE>",
        "HEALTH_CHECK_INTERVAL_MS": "60000",
        "TOOL_READY_TIMEOUT_MS": "45000",
        "MCP_HTTP_PORT": "<VALUE>",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_OAUTH": "<VALUE>"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-mario-andreschak-mcp-whatsapp-web": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-whatsapp-web"
      ],
      "env": {
        "WHATSAPP_BACKEND": "webjs",
        "BAILEYS_SESSION_DIR": "<VALUE>",
        "LOG_LEVEL": "info",
        "LOG_STDERR_LEVEL": "warn",
        "WHATSAPP_HEADLESS": "<VALUE>",
        "WHATSAPP_NO_SANDBOX": "false",
        "BROWSER_EXECUTABLE_PATH": "<VALUE>",
        "WHATSAPP_SESSION_DIR": "<VALUE>",
        "WHATSAPP_PAIRING_PHONE_NUMBER": "<VALUE>",
        "FFMPEG_PATH": "<VALUE>",
        "WA_WEB_VERSION": "<VALUE>",
        "HEALTH_CHECK_INTERVAL_MS": "60000",
        "TOOL_READY_TIMEOUT_MS": "45000",
        "MCP_HTTP_PORT": "<VALUE>",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_OAUTH": "<VALUE>"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-mario-andreschak-mcp-whatsapp-web": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-whatsapp-web"
      ],
      "env": {
        "WHATSAPP_BACKEND": "webjs",
        "BAILEYS_SESSION_DIR": "<VALUE>",
        "LOG_LEVEL": "info",
        "LOG_STDERR_LEVEL": "warn",
        "WHATSAPP_HEADLESS": "<VALUE>",
        "WHATSAPP_NO_SANDBOX": "false",
        "BROWSER_EXECUTABLE_PATH": "<VALUE>",
        "WHATSAPP_SESSION_DIR": "<VALUE>",
        "WHATSAPP_PAIRING_PHONE_NUMBER": "<VALUE>",
        "FFMPEG_PATH": "<VALUE>",
        "WA_WEB_VERSION": "<VALUE>",
        "HEALTH_CHECK_INTERVAL_MS": "60000",
        "TOOL_READY_TIMEOUT_MS": "45000",
        "MCP_HTTP_PORT": "<VALUE>",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_OAUTH": "<VALUE>"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-mario-andreschak-mcp-whatsapp-web": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-whatsapp-web"
      ],
      "env": {
        "WHATSAPP_BACKEND": "webjs",
        "BAILEYS_SESSION_DIR": "<VALUE>",
        "LOG_LEVEL": "info",
        "LOG_STDERR_LEVEL": "warn",
        "WHATSAPP_HEADLESS": "<VALUE>",
        "WHATSAPP_NO_SANDBOX": "false",
        "BROWSER_EXECUTABLE_PATH": "<VALUE>",
        "WHATSAPP_SESSION_DIR": "<VALUE>",
        "WHATSAPP_PAIRING_PHONE_NUMBER": "<VALUE>",
        "FFMPEG_PATH": "<VALUE>",
        "WA_WEB_VERSION": "<VALUE>",
        "HEALTH_CHECK_INTERVAL_MS": "60000",
        "TOOL_READY_TIMEOUT_MS": "45000",
        "MCP_HTTP_PORT": "<VALUE>",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_OAUTH": "<VALUE>"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-mario-andreschak-mcp-whatsapp-web": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-whatsapp-web"
      ],
      "env": {
        "WHATSAPP_BACKEND": "webjs",
        "BAILEYS_SESSION_DIR": "<VALUE>",
        "LOG_LEVEL": "info",
        "LOG_STDERR_LEVEL": "warn",
        "WHATSAPP_HEADLESS": "<VALUE>",
        "WHATSAPP_NO_SANDBOX": "false",
        "BROWSER_EXECUTABLE_PATH": "<VALUE>",
        "WHATSAPP_SESSION_DIR": "<VALUE>",
        "WHATSAPP_PAIRING_PHONE_NUMBER": "<VALUE>",
        "FFMPEG_PATH": "<VALUE>",
        "WA_WEB_VERSION": "<VALUE>",
        "HEALTH_CHECK_INTERVAL_MS": "60000",
        "TOOL_READY_TIMEOUT_MS": "45000",
        "MCP_HTTP_PORT": "<VALUE>",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_OAUTH": "<VALUE>"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-mario-andreschak-mcp-whatsapp-web": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-whatsapp-web"
      ],
      "env": {
        "WHATSAPP_BACKEND": "webjs",
        "BAILEYS_SESSION_DIR": "<VALUE>",
        "LOG_LEVEL": "info",
        "LOG_STDERR_LEVEL": "warn",
        "WHATSAPP_HEADLESS": "<VALUE>",
        "WHATSAPP_NO_SANDBOX": "false",
        "BROWSER_EXECUTABLE_PATH": "<VALUE>",
        "WHATSAPP_SESSION_DIR": "<VALUE>",
        "WHATSAPP_PAIRING_PHONE_NUMBER": "<VALUE>",
        "FFMPEG_PATH": "<VALUE>",
        "WA_WEB_VERSION": "<VALUE>",
        "HEALTH_CHECK_INTERVAL_MS": "60000",
        "TOOL_READY_TIMEOUT_MS": "45000",
        "MCP_HTTP_PORT": "<VALUE>",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_OAUTH": "<VALUE>"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
WHATSAPP_BACKEND No WhatsApp backend: webjs uses a persistent browser profile; baileys connects without a browser and requires separate pairing Default: webjs
BAILEYS_SESSION_DIR No Baileys credentials and synchronized history directory (default: <working directory>/baileys-sessions). Use a private absolute path, owned by one server process.
LOG_LEVEL No Log level for the log file (logs/mcp-whatsapp.log) Default: info
LOG_STDERR_LEVEL No Log level for stderr (visible in most MCP client logs) Default: warn
WHATSAPP_HEADLESS No webjs only: set to false to show the browser window instead of running headless
WHATSAPP_NO_SANDBOX No webjs only: explicitly disable the browser sandbox for containers that require it. The sandbox is enabled by default. Default: false
BROWSER_EXECUTABLE_PATH No webjs only: browser executable. Chrome and Edge are auto-detected; set this to use a specific browser. Chrome/Edge is required for sending videos and GIFs.
WHATSAPP_SESSION_DIR No webjs only: persistent browser profile directory (default: <working directory>/whatsapp-sessions)
WHATSAPP_PAIRING_PHONE_NUMBER No Phone number pairing: when set (international, symbol-free format, e.g. 4915112345678), an 8-character pairing code is logged to stderr on startup instead of relying on the QR code
FFMPEG_PATH No Path to an ffmpeg binary (only needed to override the ffmpeg installed automatically via the ffmpeg-static npm package)
WA_WEB_VERSION No webjs only: pin the WhatsApp Web version if a WhatsApp-side update breaks the client.
HEALTH_CHECK_INTERVAL_MS No webjs only: connection health check interval in milliseconds (<=0 disables) Default: 60000
TOOL_READY_TIMEOUT_MS No How long tool calls wait for the WhatsApp client to become ready before erroring Default: 45000
MCP_HTTP_PORT No When set, additionally exposes the MCP endpoint at http://127.0.0.1:<port>/mcp (Streamable HTTP) from the same process
MCP_HTTP_HOST No Bind address for the HTTP endpoint (do not expose publicly; the endpoint controls your personal WhatsApp account) Default: 127.0.0.1
MCP_OAUTH No Enable OAuth for the HTTP endpoint: /mcp requires a bearer token and clients authenticate via a browser page showing the WhatsApp QR code / pairing form

Similar servers