- URL:
http://<host>:3000<APP_BASE_PATH>/mcp(defaulthttp://localhost:3000/mcp) - Enabled by default. Disable with
MCP_ENABLED=falseor--mcp-enabled=false. - Stateless: no session handshake to keep alive between calls.
Upgrading from an older release? The standalone
./whatsapp mcp command and its SSE endpoint on port 8080 (/sse) are gone. Run ./whatsapp rest and point clients at /mcp. The old one-tool-per-operation set was replaced by the consolidated tools below.Connect a client
/mcp sits behind the same Basic Auth as the REST API. Send the Authorization header, plus X-Device-Id if you run more than one device:
YWRtaW46Y2hhbmdlbWU= is base64("admin:changeme"); generate yours with echo -n 'user:pass' | base64. Omit Authorization if Basic Auth is off, and X-Device-Id if there is only one device.
The exact config format depends on the client. If a client can only launch stdio servers, use a bridge such as mcp-remote.
Tools
GOWA exposes eight tools (seven in v9.11.0 and earlier, withoutwhatsapp_user). Each takes a type (send) or action (all others) argument that selects the operation.
On GOWA
main after v9.11.0, whatsapp_send adds interactive, chat_presence and presence, whatsapp_chat adds pin, set_disappearing and request_history, whatsapp_group adds info_from_link, set_photo and remove_photo, and the whatsapp_user tool is new. Earlier releases reject these values.
Notes on arguments:
whatsapp_sendneedstypeandphone(except forpresence, below). Media is sent by URL only (image_url,video_url,audio_url,file_url,sticker_url); MCP cannot upload local files.linkneedslinkandcaption;forwardneedsmessage_id.whatsapp_sendaccepts the schedule fields (scheduled_at,timezone,recurrence,weekdays,day_of_month,end_at,occurrence_limit). Manage the result withwhatsapp_schedule(get,pause,resumeandcancelneedschedule_id).- On GOWA
mainafter v9.11.0:presenceis the onewhatsapp_sendtype withoutphone. It needspresence:availableorunavailable.chat_presenceneedsphoneandaction:startorstopthe typing indicator.interactivetakes the samebody,footer, andbuttonsorcardsasPOST /send/interactive.- None of these three types can be scheduled.
reply_message_idworks fortext,image,video,audio,documentandsticker.duration(disappearing timer:0,86400,604800or7776000) works for every message type.phoneis normalized as in REST: a bare number becomes a user JID, and a bare ID longer than 15 digits becomes a group JID.
whatsapp_messageneedsphone(the chat) andmessage_id;editalso needsmessage.- On GOWA
mainafter v9.9.0,whatsapp_messagewithaction: "edit"acceptsmedia_type: "image"ormedia_type: "document"to replace a caption. Match the original media type and omitlink. See Edit a caption. whatsapp_chat:get_messagesneedschat_jid;archiveneedschat_jidandarchived.- On GOWA
mainafter v9.11.0, the newwhatsapp_chatactions all needchat_jid:pinalso needspinned.set_disappearingalso needstimer_seconds:0(off),86400,604800or7776000.request_historytakes an optionalcountfrom 1 to 500 (default 50). It asks the phone for messages older than the oldest one stored. The chat needs at least one stored message, and the older messages arrive asynchronously through history sync.
- On GOWA
mainafter v9.11.0, the newwhatsapp_groupactions:info_from_linkneedsinvite_link(a link or code) and previews the group without joining it.set_photoneedsgroup_idandphoto_url, a JPEG, PNG or WebP URL ending in.jpg,.jpeg,.pngor.webp. GOWA crops the image to a square and resizes it.remove_photoneedsgroup_id.
whatsapp_app:login_codeneedsphone.- On GOWA
mainafter v9.11.0,whatsapp_user:info,check,business_profile,avatarandsubscribe_presenceneedphone.checkaccepts an international number of up to 15 digits.avataralso accepts a group JID and takes optionalis_previewandis_community.subscribe_presencedelivers the user’s online and offline events only while this account is available. SetWHATSAPP_PRESENCE_ON_CONNECT=availableor callwhatsapp_sendwithtype: "presence"first.set_push_nameneedspush_nameand changes this account’s display name.my_privacy,my_groups,my_newslettersandmy_contacts_detailedread this account’s own data.- The plain contact list stays in
whatsapp_chatlist_contacts. Changing your own profile photo still requires REST (POST /user/avatar).
main after v9.11.0, whatsapp_send with type: "interactive" sends them too. See interactive messages. Newsletter tools support channel discovery, history counters, and automatically renewed live-update subscriptions. See newsletters.
Media URL downloads apply the same public-address checks as REST sends and connect directly without HTTP_PROXY or HTTPS_PROXY. Uploads from local files require the REST API.
Your MCP client shows the full input schema of each tool. The HTTP endpoint accepts POST and DELETE. GET SSE streaming is disabled.
Device selection
Each call resolves its device in this order:- The
device_idargument on the tool call. - The
X-Device-Idheader on the MCP connection. - The only registered device, when exactly one exists.
device identification required: set the X-Device-Id header or pass device_id. See Multi-device.
Remote clients with OAuth
Hosted clients such as Claude custom connectors cannot attach a Basic Auth header. For them, GOWA can run an OAuth 2.1 authorization server for/mcp. It is off by default.
APP_BASIC_AUTHmust be set: the authorization page signs users in with those same accounts. Startup fails without it.- Issuer and resource must be the public HTTPS URLs clients see, not internal addresses like
http://gowa:3000. - With OAuth on,
/mcpaccepts a Bearer token or Basic Auth. Tokens are not accepted on REST or UI routes. - Clients register themselves (RFC 7591 dynamic client registration). Registration bodies are limited to 16 KiB and each redirect URI to 2 KiB. Registrations are limited to 40 per hour and 1,000 stored clients; unused ones are pruned after 24 hours.
- PKCE
S256is mandatory. Codes expire after 5 minutes, access tokens after 1 hour; refresh tokens rotate, and reusing an old one revokes the whole token family. Only SHA-256 hashes of tokens are stored, inMCP_OAUTH_DB_URI(defaultfile:storages/oauth.db).
localhost callbacks require an explicit port and an exact match. Other redirects require HTTPS. The OAuth resource is bound to the canonical MCP URL; token requests can omit it, but a supplied value must match. Successful authorization responses include iss.
Expired codes and tokens are pruned during OAuth writes. Rotated refresh-token hashes remain while needed to detect replay against a live family, for at most one further refresh-token lifetime of 30 days. Deleting or replacing the OAuth database invalidates existing clients and grants.
Endpoints, relative to the issuer: /oauth/authorize, /oauth/token, /oauth/register. Discovery metadata uses path-insertion well-known URLs at the domain root, so with APP_BASE_PATH=/gowa your proxy must route:
https://gowa.example.com/mcp as a custom connector and sign in with an APP_BASIC_AUTH account.
