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 分