Mcp Z Api

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

MCP server for Z-API — WhatsApp messaging, contacts, media

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

概覽

AI 產生的概覽

面向 Z-API 的本機 MCP 伺服器,讓助理透過 Z-API 執行個體傳送 WhatsApp 訊息與媒體,並管理聯絡人、聊天和群組。

可以做什麼
透過 Z-API 傳送 WhatsApp 文字、圖片、文件、音訊、位置和名片訊息,以及互動式按鈕和選項清單。讀取聊天和訊息,將訊息或整個聊天標記為已讀或未讀,並刪除訊息。列出和檢視聯絡人,檢查號碼是否開通 WhatsApp,取得大頭貼和聯絡人中繼資料,並新增聯絡人。建立群組、列出群組、讀取群組中繼資料和成員,並新增或移除成員。指派和列出標籤,並查詢 WhatsApp 執行個體的連線狀態。
適用情境
適合需要讓助理透過 Z-API 操作 WhatsApp 帳號的情境:傳送通知或媒體、回覆或分流聊天、管理聯絡人和群組、查看執行個體狀態。只有在你已有或打算建立 Z-API 執行個體時才值得安裝。
執行需求
以 npm 套件形式透過 npx 在本機執行,需要 Node.js。需要 Z-API 帳號(免費試用或付費方案),並透過 ZAPI_INSTANCE_ID 和 ZAPI_TOKEN 環境變數提供執行個體 ID 和權杖。需要連線至 Z-API 服務的網路存取。
安裝前請注意
ZAPI_TOKEN 和執行個體 ID 是真實 WhatsApp 帳號的憑證,請勿放入共用設定。許多工具會寫入或變更資料:傳送訊息、建立群組、新增或移除成員、新增聯絡人、標記已讀和刪除訊息。訊息和媒體會經 Z-API 傳送給第三方。README 另提到一個包含付款路由的企業版產品,不屬於此伺服器。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

@codespar/mcp-z-api

MCP server for Z-API — WhatsApp messaging platform

[npm] [License: MIT]

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

json
{  "mcpServers": {    "z-api": {      "command": "npx",      "args": ["-y", "@codespar/mcp-z-api"],      "env": {        "ZAPI_INSTANCE_ID": "your-instance-id",        "ZAPI_TOKEN": "your-token"      }    }  }}

Claude Code

bash
claude mcp add z-api -- npx @codespar/mcp-z-api

Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

json
{  "servers": {    "z-api": {      "command": "npx",      "args": ["-y", "@codespar/mcp-z-api"],      "env": {        "ZAPI_INSTANCE_ID": "your-instance-id",        "ZAPI_TOKEN": "your-token"      }    }  }}

Tools (27)

ToolPurpose
send_textSend a text message via WhatsApp
send_imageSend an image message via WhatsApp
send_documentSend a document via WhatsApp
send_audioSend an audio message via WhatsApp
get_contactsGet all WhatsApp contacts
check_numberCheck if a phone number has WhatsApp
get_profile_pictureGet profile picture URL for a phone number
get_messagesGet messages for a phone number
send_button_listSend a button list message via WhatsApp
get_statusGet WhatsApp instance connection status
create_groupCreate a WhatsApp group
get_group_metadataGet group metadata and participants
add_group_participantAdd a participant to a WhatsApp group
remove_group_participantRemove a participant from a WhatsApp group
send_locationSend a location message via WhatsApp
send_contactSend a contact card via WhatsApp
add_labelAssign a label/tag to a chat
get_labelsList all available labels/tags
read_messageMark messages as read
delete_messageDelete a message
get_contact_metadataGet metadata (name, WhatsApp display name, profile picture, status) for a single contact
add_contactsAdd one or more contacts to the WhatsApp address book.
list_chatsList all WhatsApp chats with pagination
mark_chat_as_readMark an entire chat as read or unread
list_groupsList all WhatsApp groups with pagination
send_option_listSend an interactive option list (WhatsApp native list).
send_button_actionsSend interactive action buttons (CALL, URL, REPLY).

Authentication

Z-API uses instance ID and token embedded in the request URL.

Sandbox / Testing

Z-API offers a free trial for testing. Create an account to get started.

Get your credentials

  1. Go to Z-API Developer Portal
  2. Create an account and start a free trial
  3. Get your instance ID and token
  4. Set the environment variables

Environment Variables

VariableRequiredDescription
ZAPI_INSTANCE_IDYesZ-API instance ID
ZAPI_TOKENYesZ-API instance token

Roadmap

v0.2 (planned)

  • send_sticker — Send a sticker message via WhatsApp
  • send_reaction — Send a reaction to a message
  • get_chat_history — Get full chat history with a contact
  • update_group_settings — Update group name, description, settings
  • leave_group — Leave a WhatsApp group

v0.3 (planned)

  • bulk_messaging — Send messages to multiple contacts
  • template_management — Create and manage message templates
  • catalog_products — Manage WhatsApp Business catalog products

Want to contribute? Open a PR or request a tool.

Links

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/z-api/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 分