About Zapo
Zapo is an MCP server published by vinikjkkj in the Security category: 🧩 Lightweight, high-performance TypeScript library for the WhatsApp Web protocol, built for multi-session scale, low memory usage, zero-copy hot paths, and full control over auth, transport, Signal, app state, and media. Conduid read 9 tools from its source: call, eval, events, events_clear, inspect, lifecycle and 3 more. No package is published for it, so it installs from a source checkout.
The repository has 303 stars and 98 forks, is licensed MIT, and its last commit was on 26 Nov 2026. The latest release is v1.12.0 (16 Nov 2026). It follows v1.11.0 (28 Oct 2026), and the 5 most recent releases go back to v1.8.2 (30 Aug 2026). It passes all 5 static checks Conduid ran on the repository. Its topics include e2ee, multi-device, multi-session, signal-protocol, whatsapp and whatsapp-api.
Install
git clone https://github.com/vinikjkkj/zapoTools (9)
callResolve a dotted path on a root object and either return the value or call it as a function with the given args. Roots: "client" (default) = WaClient instance; "lib" = the zapo-js module namespace (pure helpers like parsePhoneJid/isGroupJid/normalizeRecipientJid, the WA_* constants, the proto namespace at "proto.*", and createStore). Examples: { path: "connect" } -> client.connect(); { path: "group.create", args: [...] } -> client.group.create(...); { root: "lib", path: "parsePhoneJid", args: ["+5511999999999"] }; { root: "lib", path: "WA_DEFAULTS" } returns the constants object. Args are decoded recursively: { "$bytes": "<base64>" } -> Uint8Array, { "$bigint": "<digits>" } -> BigInt. Result is encoded the same way for transport. Pass `noAwait: true` to fire-and-forget when the function returns a long-running Promise (e.g. client.connect() blocks until pairing finishes); the tool returns immediately and you observe the outcome via `events`/`logs`.| Parameter | Type | Description |
|---|---|---|
| args | array | Positional arguments. Each item is decoded (e.g. $bytes/$bigint markers). |
| noAwait | boolean | When true, invoke the function and return immediately without awaiting its Promise. Useful for client.connect() during pairing. Rejections are logged via the runtime logger. |
| path * | string | Dotted property path. Examples: "sendMessage", "group.metadata", "proto.Message.create" (under root="lib"). |
| root | string | "client" (default) walks WaClient instance; "lib" walks the zapo-js module namespace (no client init needed). |
| session | any |
evalExecute arbitrary JS in the MCP runtime with `client` (the WaClient for the selected `session`, default session when omitted) and `lib` (zapo-js module namespace) in scope. **Disabled by default**: requires `MCP_EVAL_ENABLED=1` in the MCP process env, otherwise every call is rejected. The source is wrapped in an async function – top-level `await` works. Use `return <expr>` to surface a value; the result is encoded for JSON ($bytes / $bigint markers). Use `globalThis.<key> = ...` to persist state between eval calls (e.g. stash an unregister callback returned by registerIncomingStanzaFilter). When `noAwait: true`, fire-and-forget – the call returns immediately and rejections go to the runtime logger.| Parameter | Type | Description |
|---|---|---|
| noAwait | boolean | Fire-and-forget mode. Defaults to false. |
| session | any | |
| source * | string | JavaScript statements. Wrapped as `async function (client, lib) { <source> }`. |
eventsRead recent buffered WaClient events. Filter by types and/or sequence id. Use this to wait for QR codes, pairing codes, incoming messages, group events, etc. Each event has a monotonic seq – pass `since: <seq>` next call to fetch only newer ones. Use `q` for case-insensitive substring search across `type + JSON.stringify(payload)`; `regex: true` to treat `q` as a regex pattern (case-insensitive).| Parameter | Type | Description |
|---|---|---|
| drain | boolean | If true, returned events are removed from the buffer. |
| limit | number | Max events to return (default 50). |
| q | string | Filter by substring (case-insensitive) of the event type + stringified payload. |
| regex | boolean | Treat `q` as a regex pattern (case-insensitive). |
| session | any | |
| since | number | Return only events with seq > since. |
| types | array | Event type filter, e.g. ["auth_qr","auth_pairing_code","connection","message"]. Empty/omitted = all types. |
events_clearClear a session's event buffer (default session when `session` is omitted). Returns the number of events dropped.| Parameter | Type | Description |
|---|---|---|
| session | any |
inspectList the properties and methods reachable at a path on the chosen root. Roots: "client" (default) = WaClient instance + coordinators; "lib" = the zapo-js module namespace (use { root: "lib" } to see exported helpers, WA_* constants, "proto", "createStore", etc.). Returns own + inherited members up to (but excluding) Object.prototype, with origin class name.| Parameter | Type | Description |
|---|---|---|
| includeEventEmitter | boolean | Include EventEmitter-inherited methods (on/off/emit/etc). Default false. |
| path | string | Dotted path. Empty/omitted = the root itself. |
| root | string | "client" (default) inspects WaClient; "lib" inspects the zapo-js module namespace. |
| session | any |
lifecycleManage a WaClient session (default session when `session` is omitted). Actions: "status" reports config, the resolved session, whether its client is created, its state, and a summary of every live session; "start" creates the session client (no connect); "destroy" disconnects + drops that session and frees its slot (next call recreates it). The shared store stays open for the other sessions - only `restart` with mode "process_exit" tears the whole process (and store) down.| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| session | any |
logsRead recent buffered log entries from the WaClient/MCP runtime logger. Each entry has a monotonic seq, timestampMs, level, message and optional context object. Pass `since: <seq>` to fetch only newer entries on the next call. Logs are also written to stderr and (if MCP_LOG_FILE is set) appended to that file as JSONL. Use `q` for case-insensitive substring search across the message + stringified context; `regex: true` to treat `q` as a regex pattern (case-insensitive).| Parameter | Type | Description |
|---|---|---|
| drain | boolean | If true, returned entries are removed from the buffer. |
| levels | array | Filter by levels, e.g. ["warn","error"]. Empty/omitted = all. |
| limit | number | Max entries to return (default 100). |
| q | string | Substring (case-insensitive) matched against `message + JSON.stringify(context)`. |
| regex | boolean | Treat `q` as a regex pattern (case-insensitive). |
| session | string | Keep only log lines emitted by this session (matched on context.session). Omit to return every line, including untagged server/global logs. |
| since | number | Return only entries with seq > since. |
logs_clearClear the entire log buffer (stderr + log file are unaffected). Returns the number of entries dropped.restartRestart runtime state. "soft" (default): disconnect + drop one session's WaClient (default session when `session` is omitted), clear its event buffer + the shared log buffer, reset seq counters; the process stays alive and the next tool call recreates the client from the same config - code changes loaded into the Node module cache are NOT picked up. Other sessions and the shared store are left untouched. "process_exit": disconnect EVERY session, destroy the shared store, then exit with code 0 so a supervisor (nodemon, Claude Code respawn-on-reconnect, etc.) starts a fresh process. With no supervisor, reconnect the MCP server manually (e.g. /mcp in Claude Code) for the next tool call to land. The exit is scheduled ~150ms after the response is sent so the JSON-RPC reply has time to flush.| Parameter | Type | Description |
|---|---|---|
| mode | string | "soft" (default) keeps the process; "process_exit" terminates the process so a supervisor can respawn it. |
| session | any |
Security checks
- ✓README presentThe repository's README runs to about 945 words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedA lockfile pins dependency versions.
- ✓No dynamic code executionScanned 676 source files and found no eval, dynamic Function or shell execution.
1 check has not been run yet.
Releases
README
The repository's README runs to about 945 words, fetched 12 days ago. The original in the repository is authoritative.
Read full README