Mcp Whatsapp Cloud

io.github.codespar由 GitHub 帳號 codespar 發布v0.2.2更新於 Oct 24, 2026

MCP server for WhatsApp Cloud API (Meta) — messages, media, and templates via Graph API

已驗證STDIO僅桌面溝通與協作商業與電商

概覽

AI 產生的概覽

面向 Meta WhatsApp Cloud API 的本機 MCP 伺服器,讓助理傳送 WhatsApp 訊息、媒體與範本並管理商業帳號。

可以做什麼
透過 Cloud API 向 WhatsApp 號碼傳送文字、範本、媒體、互動式、Flow、位置、聯絡人與表情回應訊息,以及輸入狀態和已讀回條。上傳、解析與刪除媒體資源,並可重複使用已上傳的媒體 ID 多次傳送。列出、建立與刪除 WhatsApp 商業帳號上的訊息範本。讀取與更新商業檔案,列出已註冊的電話號碼。要求並提交電話號碼驗證碼。
適用情境
適用於已擁有核准 WhatsApp 商業帳號、希望助理直接透過 Meta 處理客戶訊息、範本管理或帳號管理的商家,不需中間服務商。
執行需求
透過 npx 從 npm 套件 @codespar/mcp-whatsapp-cloud 在本機執行(需要 Node.js)。需要 Meta 系統使用者存取權杖(WHATSAPP_ACCESS_TOKEN)、電話號碼 ID(WHATSAPP_PHONE_NUMBER_ID)與 WhatsApp 商業帳號 ID(WHATSAPP_BUSINESS_ACCOUNT_ID);WHATSAPP_GRAPH_VERSION 為選用,預設 v21.0。需要連線至 Meta Graph API 的網路存取。
安裝前請注意
WHATSAPP_ACCESS_TOKEN 中的存取權杖是永久憑證,可控制該商業帳號,必須妥善保密。伺服器會向真實客戶傳送真實訊息,可能產生 Meta 對話費用,並可建立、刪除或更新範本、媒體與商業檔案。在 24 小時客戶服務視窗之外只能傳送已核准的範本。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

@codespar/mcp-whatsapp-cloud

MCP server for the WhatsApp Cloud API — Meta's official WhatsApp Business API, self-hosted on Meta infrastructure.

Direct Meta integration. No middleman, no provider markup. For merchants with an approved WhatsApp Business Account (WABA) who want Meta-direct pricing and full control over conversation, pricing category, and template lifecycle.

WhatsApp servers in this catalog

ServerWhat it isWhen to pick it
whatsapp-cloud (this)Direct Meta Cloud APILarge merchants with approved WABA; lower cost at scale, no intermediary fees
z-apiWrapper on top of Meta CloudEasy onboarding, instant QR-pair, extra helpers
evolution-apiOpen-source wrapperSelf-hosted, community-driven
take-blipBrazilian BSP wrapperEnterprise Brazil, CCaaS features
zenviaBrazilian BSP wrapperBrazil omnichannel (SMS + WhatsApp)

Tools (22)

ToolPurpose
send_text_messageSend a plain text message.
send_template_messageSend an approved message template.
send_media_messageSend an image, video, document, or audio.
send_interactive_messageSend an interactive message (reply buttons or list).
send_interactive_cta_urlSend an interactive message with a single CTA URL button.
send_interactive_flowSend a WhatsApp Flow message.
send_location_messageSend a location pin with latitude/longitude and optional name/address.
send_contacts_messageSend one or more contact cards (vCard-like).
send_reaction_messageSend an emoji reaction on a previously received/sent message.
send_typing_indicatorShow a typing indicator on a received message.
mark_message_as_readMark an incoming message as read so the sender sees the blue double-check.
upload_mediaUpload a media file and get back a media_id reusable in send_media_message.
retrieve_media_urlResolve a media_id to a short-lived downloadable URL.
delete_mediaDelete an uploaded media asset by id.
list_templatesList message templates on the WhatsApp Business Account.
create_templateSubmit a new template for Meta review.
delete_templateDelete a message template from the WABA by name.
get_business_profileRead the WhatsApp business profile (about, description, email, websites, vertical, address) for the configu...
update_business_profileUpdate the business profile on the configured phone number.
list_phone_numbersList all phone numbers registered under the WhatsApp Business Account, including display name, quality rati...
request_verification_codeRequest Meta to send a verification code to the configured phone number via SMS or voice.
verify_codeSubmit the verification code received via SMS/voice after request_verification_code.

Install

bash
npm install @codespar/mcp-whatsapp-cloud

Environment

bash
WHATSAPP_ACCESS_TOKEN="EAAG..."           # required (secret) — Meta system-user tokenWHATSAPP_PHONE_NUMBER_ID="1234567890"     # required — WABA phone number idWHATSAPP_BUSINESS_ACCOUNT_ID="9876543210" # required — WABA id (for templates)WHATSAPP_GRAPH_VERSION="v21.0"            # optional — Meta bumps quarterly

Authentication

Bearer token against the Graph API. Use a permanent system-user token from Meta Business Manager — user access tokens expire and will break production.

Authorization: Bearer <WHATSAPP_ACCESS_TOKEN>

Messaging rules (important)

  • Customer-service window — You can freely send any message type for 24h after the user last messaged you.
  • Business-initiated — Outside that window you must send an approved template. Use send_template_message with a name + language + components.
  • Templates — Create with create_template, wait for Meta approval (minutes to hours), then use.
  • Phone numbers are E.164 without the leading + (e.g. 5511999999999).

Media

Two paths:

  1. Public URL — pass link to send_media_message. Fastest, but Meta fetches on every send.
  2. Uploaded media_id — call upload_media once, reuse id on subsequent sends. Recommended for catalog assets.

Uploaded media expires after ~30 days.

Interactive messages

send_interactive_message expects a fully-formed interactive object. Example button payload:

json
{  "type": "button",  "body": { "text": "Confirma seu pedido?" },  "action": {    "buttons": [      { "type": "reply", "reply": { "id": "confirm", "title": "Confirmar" } },      { "type": "reply", "reply": { "id": "cancel", "title": "Cancelar" } }    ]  }}

See the Cloud API interactive reference for list payloads.

Run

bash
# stdio (default — for Claude Desktop, Cursor, etc)npx @codespar/mcp-whatsapp-cloud
# HTTP (for server-to-server)MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-whatsapp-cloud

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

來源:packages/communication/whatsapp-cloud/README.md,提交 d0a519a

工具

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

版本歷史

1
  1. v0.2.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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