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 分