Repository avatar
Other Tools
v0.1.5
active

zapz-mcp

io.github.zapz-api/zapz-mcp

Send WhatsApp messages and manage instances, contacts, groups and webhooks with ZapZ.

Documentation

ZapZ SDKs

Official SDKs for the ZapZ WhatsApp API. Documentation: https://zapz.dev/#/docs

LanguageFolderPackage
Node.js / TypeScript (18+)node/@zapz/sdk
Python (3.8+)python/zapz
PHP (8.1+)php/zapz/sdk
Go (1.21+)go/github.com/zapz-api/zapz-sdk/go
Java (17+)java/dev.zapz:zapz-java
C# / .NET (8+)csharp/ZapZ
Ruby (3.0+)ruby/zapz

None of them has runtime dependencies.

Extras:

How it works

  • openapi.json is the public specification, served by the API at GET /v1/openapi.json (generated from the zapz-api DTOs).
  • generator/generate.py reads the specification and generates the methods and types of each SDK (*/generated, zapz/_generated, php/src/Resources). Do not edit these files by hand.
  • The rest (HTTP, retries, errors, webhook verification) is written by hand in each SDK.

After an API change:

python3 generator/generate.py --fetch http://localhost:3056/v1/openapi.json

Tests

Each SDK has a smoke test that runs against a real API with a test key (sk_test_, nothing goes out through WhatsApp):

export ZAPZ_API_KEY=sk_test_... ZAPZ_BASE_URL=http://localhost:3056
(cd node && npm run build && npm test)
(cd python && python3 -m unittest discover -s tests)
(cd php && composer dump-autoload && php tests/smoke.php)
(cd go && go test ./...)
(cd n8n && npm run build && npm test)
(cd mcp && npm run build && npm test)
# Java, .NET and Ruby (through Docker, host network to reach the local API)
docker run --rm --network host -v "$PWD/java":/w -w /w -e ZAPZ_API_KEY -e ZAPZ_BASE_URL eclipse-temurin:17-jdk \
  sh -c 'mkdir -p /tmp/o && javac -d /tmp/o $(find src -name "*.java") && java -cp /tmp/o com.zapz.Smoke'
docker run --rm --network host -v "$PWD/csharp":/w -w /w -e ZAPZ_API_KEY -e ZAPZ_BASE_URL mcr.microsoft.com/dotnet/sdk:8.0 dotnet run --project tests/Smoke
docker run --rm --network host -v "$PWD/ruby":/w -w /w -e ZAPZ_API_KEY -e ZAPZ_BASE_URL ruby:3.3-slim ruby -Ilib test/smoke.rb

Without ZAPZ_API_KEY, only the offline tests (webhook signature) run.

Releasing

Each SDK has its own version and is released only when it changes. GitHub Actions (.github/workflows/release-*.yml) publishes an SDK when its <sdk>/vX.Y.Z tag is pushed, and each workflow fails when the tag differs from its manifest.

  1. Bump the SDKs you changed (manifests and the VERSION constant each client sends), then merge it to main:
    scripts/set-version.sh 0.1.6 node mcp
    
  2. On an up-to-date main, tag what changed (--dry-run only lists it):
    scripts/release.sh
    
    For each SDK whose folder changed since its last tag, the script pushes <sdk>/v<version in its files>. It skips SDKs with no change, and SDKs that changed but keep their version (a README fix, say). It stops when one SDK's files hold different versions or when main differs from origin/main, and pushes the tags one by one, because GitHub starts no workflow for a push that creates more than 3 tags.
TagRegistryAuthentication
node/v*, mcp/v*, n8n/v*npm (@zapz/sdk, @zapz/mcp, @zapz/n8n-nodes-zapz) and ghcr.io/zapz-api/zapz-mcpTrusted Publishing (OIDC)
python/v*PyPI (zapz)Trusted Publishing (OIDC), environment pypi
ruby/v*RubyGems (zapz)Trusted Publishing (OIDC); variable RUBYGEMS_OWNER_ID for the first push only
csharp/v*NuGet (ZapZ)Trusted Publishing (OIDC), secret NUGET_USER
php/v*Packagist (zapz/sdk) through the zapz-api/zapz-php repositorysecret PHP_SPLIT_DEPLOY_KEY
go/v*proxy.golang.org (github.com/zapz-api/zapz-sdk/go)none
java/v*Maven Central (dev.zapz:zapz-java)secrets CENTRAL_USERNAME, CENTRAL_PASSWORD, GPG_PRIVATE_KEY, GPG_PASSPHRASE
postman/v*GitHub ReleaseGITHUB_TOKEN

License

MIT

NPM
@zapz/mcp
Install Command
npm install @zapz/mcp