Whatsapp MCP logo

Whatsapp MCP

Connects AI agents to WhatsApp for notifications, human approvals, replies, and connection-state checks.

Install Whatsapp MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mhrj/whatsapp-mcp"
      ],
      "env": {
        "WHATSAPP_TARGET_NUMBER": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

whatsapp-mcp MCP server connects MCP clients such as Cursor and Claude Desktop to a WhatsApp account over stdio. Agents can send notifications, ask blocking questions that wait for a WhatsApp reply, retrieve incoming messages, and monitor authentication state. It supports QR linking or phone-number pairing codes, with credentials saved locally for later restarts. Reach for it when an agent needs human approval, guidance, or status communication away from the development environment.

Use cases

  • Request deployment approval from a phone
  • Send agent status notifications
  • Collect human guidance during autonomous workflows
  • Poll unsolicited WhatsApp messages
  • Check WhatsApp authentication state

Key features

  • WhatsApp messaging over MCP stdio
  • Blocking questions with reply matching
  • QR and phone-number pairing authentication
  • Inbound message polling
  • Connection and authentication status reporting
  • Queued concurrent questions

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 77d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 17d ago via OSV.dev · @mhrj/whatsapp-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads637Package downloads in the last 30 days.
Last commitTodayMost recent push to the default branch.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Whatsapp MCP works

What whatsapp-mcp does

whatsapp-mcp gives an AI agent a WhatsApp channel for human-in-the-loop workflows. The agent can notify a user, request a decision before continuing, collect unsolicited inbound messages, and inspect whether the WhatsApp connection is ready. A typical use is asking for approval before a deployment or other significant change, then continuing after the user replies from their phone.

The server communicates with MCP clients through stdio and targets a configured WhatsApp chat. It is intended for clients including Cursor, Claude Desktop, Claude Code, and Codex, as well as other MCP clients that can launch stdio servers.

How it works

The MCP client starts the server and invokes its WhatsApp tools. If the account is not authenticated, the server begins the linking process automatically. QR authentication returns an image in MCP content and may also create a fallback HTML page at ~/.whatsapp-mcp/qr.html. Phone-number authentication returns a pairing code instead.

After linking, credentials are stored under ~/.whatsapp-mcp/baileys_auth_info, allowing later launches to reuse the session. ask_question waits for a response and supports queued concurrent questions. Replies are matched using quoted-message references or [Qn] labels; when neither is available, the server falls back to first-in, first-out matching.

Setup and configuration

Install through the published npm package with npx in the MCP client configuration:

config.json
{
  "mcpServers": {
    "whatsapp-mcp": {
      "command": "npx",
      "args": ["-y", "@mhrj/whatsapp-mcp"],
      "env": {
        "WHATSAPP_TARGET_NUMBER": "1234567890@s.whatsapp.net"
      }
    }
  }
}

WHATSAPP_TARGET_NUMBER is required and supplies the default chat for send_message and ask_question. Set AGENT_WHATSAPP_PHONE_NUMBER to use phone-number pairing by default; otherwise, QR linking is used. WHATSAPP_PAIRING_PHONE_NUMBER is a deprecated compatibility alias. For group targets ending in @g.us, configure WHATSAPP_ALLOWED_NUMBERS with the individual sender JIDs permitted to answer.

GUI applications may not inherit the terminal PATH. If the client cannot find npx or node, add an explicit PATH entry to the server environment. Start authentication by calling connect, or invoke another WhatsApp tool and let it trigger authentication.

Tools and capabilities

  • connect links the WhatsApp account and returns a QR image or pairing code when authentication is needed. It accepts optional phoneNumber or phone_number arguments for a one-off pairing request.
  • disconnect logs out and invalidates the stored session credentials.
  • send_message sends a one-way notification and supports limited WhatsApp markdown mapping such as *bold*.
  • ask_question sends a prompt, waits for a reply, and applies a timeout. Multiple pending questions are queued and tagged with references.
  • get_incoming_messages polls inbound messages that were not replies to a pending question.
  • get_status reports connection and authentication states including connected, connecting, qr_pending, and pairing_pending.

The server also exposes workflow instructions and a whatsapp-autopilot prompt to encourage connect-first and WhatsApp-first agent behavior.

Limitations and notes

WhatsApp linking is required before messaging can work. Group chats require an allowlist through WHATSAPP_ALLOWED_NUMBERS; the server refuses to start without one when the target is a group. Agents must be instructed to use ask_question at decision points if approvals should happen in WhatsApp rather than in the client interface. When several questions are pending, users should quote the relevant message or include its question label to avoid ambiguous reply matching.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Whatsapp MCP

whatsapp-mcp is an MCP server that connects AI agents to WhatsApp through a configured chat. Its main tools send notifications, ask blocking questions, retrieve incoming messages, connect or disconnect the account, and report connection status. It supports QR authentication and phone-number pairing for human-in-the-loop workflows.

Install it through `npx` by adding `@mhrj/whatsapp-mcp` as the MCP server command in your client configuration. Set `WHATSAPP_TARGET_NUMBER` to the destination WhatsApp chat JID, then call `connect` or another WhatsApp tool to begin authentication.

Authenticate by scanning the QR image returned by `connect`, or set `AGENT_WHATSAPP_PHONE_NUMBER` to use phone-number pairing codes. QR linking opens WhatsApp's Linked Devices flow, while pairing-code authentication requires entering the returned code on the phone.

Yes. Call `ask_question` to send a prompt and block until a WhatsApp reply arrives or the request times out. Pending questions are queued and labeled, and replies can be matched by quoted message, question label, or FIFO order.

Yes. Cursor can launch whatsapp-mcp as a stdio MCP server using `npx`. Add the server command and its arguments to Cursor's MCP configuration, set the target chat environment variable, and ensure the GUI process can find `npx` through its configured `PATH`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewWhatsapp MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/whatsapp-mcp?style=directory)](https://allmcps.com/mcp/whatsapp-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/whatsapp-mcp"><img src="https://allmcps.com/api/badge/whatsapp-mcp?style=directory" alt="Whatsapp MCP on AllMCPs" /></a>