wappmeow-mcp-server
v1.2.2MCP server exposing @eduh_dev021/wappmeow WaClient as dynamic tools for end-to-end testing
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
call
Resolve 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 @eduh_dev021/wappmeow 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.…
| Parameter | Type | Description |
|---|---|---|
path * | string | Dotted property path. Examples: "sendMessage", "group.metadata", "proto.Message.create" (under root="lib"). |
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. |
root | string | "client" (default) walks WaClient instance; "lib" walks the @eduh_dev021/wappmeow module namespace (no client init needed). |
session | string | Target WaClient session id. Omit to use the default session (MCP_SESSION_ID). Any other id lazily spins up an additional session that shares the same store / auth backend (rows are scoped per session… |
inspect
List the properties and methods reachable at a path on the chosen root. Roots: "client" (default) = WaClient instance + coordinators; "lib" = the @eduh_dev021/wappmeow 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 @eduh_dev021/wappmeow module namespace. |
session | string | Target WaClient session id. Omit to use the default session (MCP_SESSION_ID). Any other id lazily spins up an additional session that shares the same store / auth backend (rows are scoped per session… |
events
Read 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 | string | Target WaClient session id. Omit to use the default session (MCP_SESSION_ID). Any other id lazily spins up an additional session that shares the same store / auth backend (rows are scoped per session… |
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_clear
Clear a session's event buffer (default session when `session` is omitted). Returns the number of events dropped.
| Parameter | Type | Description |
|---|---|---|
session | string | Target WaClient session id. Omit to use the default session (MCP_SESSION_ID). Any other id lazily spins up an additional session that shares the same store / auth backend (rows are scoped per session… |
logs
Read 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_clear
Clear the entire log buffer (stderr + log file are unaffected). Returns the number of entries dropped.
lifecycle
Manage 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 | string | Target WaClient session id. Omit to use the default session (MCP_SESSION_ID). Any other id lazily spins up an additional session that shares the same store / auth backend (rows are scoped per session… |
restart
Restart 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 supe…
| Parameter | Type | Description |
|---|---|---|
mode | string | "soft" (default) keeps the process; "process_exit" terminates the process so a supervisor can respawn it. |
session | string | Target WaClient session id. Omit to use the default session (MCP_SESSION_ID). Any other id lazily spins up an additional session that shares the same store / auth backend (rows are scoped per session… |
eval
Execute arbitrary JS in the MCP runtime with `client` (the WaClient for the selected `session`, default session when omitted) and `lib` (@eduh_dev021/wappmeow 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 registerIncomingS…
| Parameter | Type | Description |
|---|---|---|
source * | string | JavaScript statements. Wrapped as `async function (client, lib) { <source> }`. |
noAwait | boolean | Fire-and-forget mode. Defaults to false. |
session | string | Target WaClient session id. Omit to use the default session (MCP_SESSION_ID). Any other id lazily spins up an additional session that shares the same store / auth backend (rows are scoped per session… |