Skip to main content
Z-

Z-API

v0.2.1API Key

WhatsApp Business API: messages, media, templates, and delivery webhooks. Your agent sends receipts, confirmations, and support responses.

27 tools1 env varsπŸ‡§πŸ‡· Brazilstable on npm

What your agent can do

Z-API gives your agent 27 tools it calls directly β€” pick the ones it needs, in Claude, Cursor, or any MCP client.

  • send_text β€” Send a text message via WhatsApp
  • send_image β€” Send an image message via WhatsApp
  • send_document β€” Send a document via WhatsApp
Example call
// Your agent calls a tool directly β€” no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("send_text", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-z-api

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "z-api": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-z-api"
      ],
      "env": {
        "ZAPI_TOKEN": "<your_zapi_token>"
      }
    }
  }
}

After restart, your agent can call any of the 27 tools below β€” try send_text first.

Environment variables Β· 1

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

ZAPI_TOKEN
requiredsecret

API key for z-api

Available tools Β· 27

Each tool is independent β€” your agent loads only what it needs to reduce context and response time.

WRITEsend_text
Send a text message via WhatsApp
WRITEsend_image
Send an image message via WhatsApp
WRITEsend_document
Send a document via WhatsApp
WRITEsend_audio
Send an audio message via WhatsApp
READget_contacts
Get all WhatsApp contacts
READcheck_number
Check if a phone number has WhatsApp
READget_profile_picture
Get profile picture URL for a phone number
READget_messages
Get messages for a phone number

Compatible frameworks

MCP is a protocol β€” any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

Run `npx -y @codespar/mcp-z-api` and add the config block above to your MCP client β€” Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
Z-API β€” MCP server Β· 27 tools | CodeSpar