Z API

Messaging and emailFinance and commerce

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

Your AI app calls the Z API MCP server, which does the messaging and email and finance and commerce work and sends the result back to the chat.

About Z API

Z API is a community MCP server from codespar, filed in our directory under messaging and email and finance and commerce. MCP server for Z-API, WhatsApp messaging, contacts, media.

Z API runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-z-api@0.2.2 and talks to it over standard input and output. It needs ZAPI_TOKEN set before Z API starts.

Z API is listed in the official MCP registry as io.github.codespar/mcp-z-api, version 0.2.2.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-z-api
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-z-api

How to set up Z API

  1. Install Node.js on the machine that runs your AI app, because Z API starts with npx and downloads its package on first run.
  2. Create ZAPI_TOKEN for Z API in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Z API to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Z API tools to confirm the connection.
  5. Run one read-only task with Z API first, and keep your app asking before each tool call until the results look right.

Z API compared with similar servers

  • Zenvia by codespar has fewer GitHub stars than Z API (278 against 278); both are community servers, and both run locally.
  • Whatsapp Cloud by codespar has fewer GitHub stars than Z API (278 against 278); both are community servers, and both run locally.
  • Apple Mail by patrickfreyer has fewer GitHub stars than Z API (275 against 278); both are community servers, and both run locally.

Before you connect Z API

  • Give Z API its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Z API tool call until you trust what it does with them.
  • Treat text that Z API fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Z API on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Z API

How marketing and sales teams put Z API to work, by company size. Pick the size closest to yours and start Z API on one use case.

Small business

  • A small team can have Z API summarize the inbox or channel each morning, so nothing from a customer waits until the afternoon.
  • Owners can draft replies and follow-ups with Z API and send them only after a read, keeping the personal tone customers expect.
  • A small business can ask Z API which products and customers drive margin, then plan promotions around them.
  • Z API runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can use Z API to turn long launch threads into decisions, owners and dates that land in the project tracker.
  • Sales and success teams can connect Z API so an agent drafts follow-ups after every customer call, ready to edit and send.
  • Ecommerce teams can connect Z API to tie campaigns to orders and revenue, not just clicks.
  • Start Z API on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can deploy Z API with retention and data loss rules intact, so agents summarize conversations without moving data outside policy.
  • Internal comms teams can use Z API to find what employees ask most across channels and answer it once, in the right place.
  • Enterprises should keep Z API read-only for agents, with any money movement handled by people and existing approvals.
  • Z API is a community server, so have security review the code and pin a version before Z API touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Z API README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@codespar/mcp-z-api

MCP server for Z-API, WhatsApp messaging platform

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.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
claude mcp add z-api -- npx @codespar/mcp-z-api
Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.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)

Tool Purpose
send_text Send a text message via WhatsApp
send_image Send an image message via WhatsApp
send_document Send a document via WhatsApp
send_audio Send an audio message via WhatsApp
get_contacts Get all WhatsApp contacts
check_number Check if a phone number has WhatsApp
get_profile_picture Get profile picture URL for a phone number
get_messages Get messages for a phone number
send_button_list Send a button list message via WhatsApp
get_status Get WhatsApp instance connection status
create_group Create a WhatsApp group
get_group_metadata Get group metadata and participants
add_group_participant Add a participant to a WhatsApp group
remove_group_participant Remove a participant from a WhatsApp group
send_location Send a location message via WhatsApp
send_contact Send a contact card via WhatsApp
add_label Assign a label/tag to a chat
get_labels List all available labels/tags
read_message Mark messages as read
delete_message Delete a message
get_contact_metadata Get metadata (name, WhatsApp display name, profile picture, status) for a single contact
add_contacts Add one or more contacts to the WhatsApp address book.
list_chats List all WhatsApp chats with pagination
mark_chat_as_read Mark an entire chat as read or unread
list_groups List all WhatsApp groups with pagination
send_option_list Send an interactive option list (WhatsApp native list).
send_button_actions Send 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

Variable Required Description
ZAPI_INSTANCE_ID Yes Z-API instance ID
ZAPI_TOKEN Yes Z-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

Questions about Z API

What is the Z API MCP server?

MCP server for Z-API, WhatsApp messaging, contacts, media. Z API is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Z API MCP server?

Add Z API to your AI app's MCP config with the command npx -y @codespar/mcp-z-api@0.2.2. In Claude Code, run claude mcp add --transport stdio codespar-z-api -- npx -y @codespar/mcp-z-api@0.2.2. To run Z API this way you need Node.js installed.

Does Z API need an API key?

Yes. Z API expects ZAPI_TOKEN to be set. Create the key for Z API in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Z API an official MCP server?

No. Z API is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Z API access to company data.

What license is Z API under?

Z API is released under the MIT license, according to its GitHub repository. The license covers the code of Z API; the service it connects to has its own terms.