Whatsapp Mcp

io.github.meharajM由 GitHub 帳號 meharajM 發布v2.0.1更新於 Oct 24, 2026

WhatsApp MCP Server - Human-in-the-loop for AI agents via WhatsApp

已驗證STDIO僅桌面效率與工作流溝通與協作

概覽

AI 產生的概覽

WhatsApp MCP 讓 AI 代理透過 WhatsApp 傳訊息給你並等待回覆,讓你在離開電腦時仍能收到確認請求或狀態更新。

可以做什麼
  • 連線與中斷 WhatsApp 工作階段,首次使用以 QR 碼登入
  • 傳送單向 WhatsApp 通知,可選擇支援 markdown 格式
  • 提出問題並阻塞等待回覆,同時提出的問題會排隊處理
  • 輪詢主動傳來的訊息,並查看連線與驗證狀態
適用情境
適合在 Cursor、Claude Desktop、Claude Code 等用戶端執行長時間或自主代理工作時使用,把核准、權限請求或提醒送到手機,不必守在 IDE 前。
執行需求
以 stdio 方式在本機執行,通常透過 npx 啟動,因此 PATH 中需有 Node.js 與 npm。需設定 WHATSAPP_TARGET_NUMBER(預設收件者 JID),並用手機掃描 QR 碼連結 WhatsApp 帳號,工作階段會存在使用者家目錄。可選擇設定 WHATSAPP_ALLOWED_NUMBERS 限制可回覆的人。
安裝前請注意
此伺服器會連結你的個人 WhatsApp 帳號,並把工作階段憑證存在本機磁碟;中斷連線會登出並使憑證失效。訊息與提問都經由 WhatsApp 傳送。在群組聊天中,除非設定 WHATSAPP_ALLOWED_NUMBERS,否則任何成員都能回覆。README 建議開啟 always allow 或 yolo 模式讓代理無人看管地執行,這會取消 IDE 的核准提示,只剩 WhatsApp 一道確認關卡。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Whatsapp Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[WhatsApp MCP Logo]

WhatsApp MCP

Human-in-the-Loop for AI Agents via WhatsApp

[npm version] [License: ISC] [MCP] [Smithery]


This is an MCP (Model Context Protocol) server that enables AI agents (like Claude or Cursor) to interact directly with you via WhatsApp. It bridges the gap between your autonomous AI and your phone, allowing for runtime confirmations, permission requests, or simple status updates while you are away from your computer.

  • AI agent messaging
  • AI agent confirmations
  • Agent interrupt system
  • AI alerts
  • MCP server
  • Cursor MCP
  • Claude Desktop MCP
  • AI notifications

Perfect for

  • Cursor
  • Claude Desktop
  • Claude Code
  • OpenCode
  • Codex
  • Autonomous AI workflows

Example

AI: Deploy to production?

WhatsApp: [YES] [NO]

You: YES

Agent continues.


🚀 Quick Start (NPX)

Since this package is published to NPM, you can run it directly via npx in your MCP configuration.

Cursor / Claude Configuration

Add this to your MCP configuration file:

json
{  "mcpServers": {    "whatsapp-mcp": {      "command": "npx",      "args": [        "-y",        "@mhrj/whatsapp-mcp"      ],      "env": {        "WHATSAPP_TARGET_NUMBER": "[email protected]"      }    }  }}

Note about Allowed Numbers: WHATSAPP_TARGET_NUMBER is the default recipient for all messages. However, if your target is a Whatsapp Group, any member of the group would be able to answer the AI by default. To restrict replies only to specific numbers (to prevent unauthorized people from answering), you can optionally add a comma-separated list of numbers as an environment variable: "WHATSAPP_ALLOWED_NUMBERS": "[email protected],[email protected]". If set, the AI will ONLY honor responses from these specific matching users.

Troubleshooting npx: executable file not found in $PATH or env: node: No such file or directory: If your IDE/Agent complains it cannot find npx or node, it's because GUI apps (like Cursor) don't inherit your terminal's $PATH. To fix this, explicitly pass your PATH in the MCP env config.

json
      "env": {        "PATH": "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin",        "WHATSAPP_TARGET_NUMBER": "[email protected]"      }

Authentication (First time only)

The very first time you use the MCP server, it needs to authenticate with WhatsApp Web:

  1. Call the connect tool via your Agent, or just use any WhatsApp tool normally. If the session is not authenticated yet, the server will trigger authentication automatically.
  2. The tool result will return the QR code image directly in MCP content so modern clients can render it inline.
  3. If your client does not render inline images, the server also tries to write a local fallback HTML page under ~/.whatsapp-mcp/qr.html.
  4. Open WhatsApp on your phone -> Linked Devices -> Link a Device, and scan the QR.
  5. The authentication session is saved to your home directory (~/.whatsapp-mcp/baileys_auth_info), so you don't need to scan it again across restarts.

Remote "Auto-Pilot" Workflow (Skip IDE Prompts)

To make your AI agent run fully autonomously and only ask for permissions/guidance via WhatsApp (allowing you to step away from your computer):

  1. Remove IDE Security Blockers: When your agent (like Cursor or Claude) asks for permission to run a command or read a file, select Always Allow (or enable "yolo" mode in settings). This gives the agent the mechanical freedom to operate without pausing indefinitely for a UI click.
  2. Add a .cursorrules (or system prompt) file: You must explicitly instruct the AI to use WhatsApp whenever it reaches a logical decision point. Create a .cursorrules file in your project root with this exact prompt:
markdown
# Human-in-the-Loop via WhatsAppYou are connected to the user via the `whatsapp-mcp` server. Whenever you are about to make significant/destructive changes, run a deployment, or whenever you need the user's permission/opinion to proceed with a plan, you MUST use the `ask_question` tool to ask the user on WhatsApp. DO NOT simply ask for confirmation in the IDE chat interface. You must wait for the `ask_question` tool to return the user's WhatsApp reply before proceeding with your task.

With these two steps, the AI will proactively proactively use the ask_question tool to beam its logical permission requests directly to your phone instead of freezing in the IDE.

Features & Tools

  • connect: Connects to the WhatsApp network. If not logged in, returns a native QR image in the tool result and may also provide a local HTML fallback.
  • disconnect: Completely logs out of WhatsApp and invalidates the session credentials.
  • send_message: Sends a one-way notification. Supports optional WhatsApp markdown mapping (*bold*). If the server is not connected yet, it auto-triggers authentication first.
  • ask_question: Sends a prompt and blocks execution until a reply is received (with a timeout). Concurrent questions are smartly queued and tagged with references. If the server is not connected yet, it auto-triggers authentication first.
  • get_incoming_messages: Polls unsolicited inbound WhatsApp messages so agents that do not support server-side sampling can still retrieve them.
  • get_status: Provides agent connection state monitoring, including auth state such as connected, connecting, or qr_pending.
  • Server instructions + prompt: The server exports built-in workflow instructions and a whatsapp-autopilot prompt so clients can guide agents toward connect-first and WhatsApp-first behavior.

Local Development

If you'd like to run it locally from source:

  1. Clone the repository and npm install
  2. npm run build
  3. Link via absolute path instead of npx.

License

This project is licensed under the ISC License.

Third-Party Licenses

This project utilizes the following open-source libraries:


Discoverability keywords

  • Human in the loop AI
  • AI approvals
  • Runtime approvals
  • Agent notifications
  • Agent approval workflow
  • Cursor WhatsApp integration
  • Claude WhatsApp integration
  • Autonomous agents
  • Cursor power users
  • Remote workers

What problem does this solve?

  • AI agents often get blocked waiting for approvals/questions when you step away from the IDE.
  • WhatsApp MCP notifies you and collects confirmations from your phone so agents can continue safely.

Who it's for

  • Cursor agent / Claude Desktop users
  • Solo builders shipping agentic workflows
  • DevOps & automation teams needing runtime approvals

來源:README.md,提交 e8629a2

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v2.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分