MCP
Connect Codex, Claude Code, Cursor, VS Code or any MCP client to the remote WASync server with the URL alone. Six tools, no code on your side.
WASync runs a remote MCP server over Streamable HTTP. Add it to an MCP client and the agent gets WhatsApp tools with no code on your side.
https://cloudapi.wasync.app/api/mcpThat host is deliberate. The REST base URL and every human-facing link use
developers.wasync.app, but the MCP server URL, the OAuth endpoints and the
/.well-known/… documents are protocol identifiers clients have already
registered — they stay on cloudapi.wasync.app and must match byte-for-byte.
Do not "normalise" them.
Connect a client
Give the client the server URL. It registers itself, opens a browser, and you approve with a short code. There is no API key to paste and no app to create first.
Every client goes through the same three steps:
- Add the server in the client (commands per client below).
- A browser page opens with a short code and the name the app gave
itself. Type the code where your number lives:
- Number connected in Bitrix24: open WASync in Bitrix24 → Settings → API & Agents → Authorize an app or agent, enter the code, choose the numbers and what the app may do, then approve. The number needs the Platform API add-on.
- Number in a developer workspace: enter the code at https://developers.wasync.app/authorize.
- The browser page continues on its own and the client stores its tokens.
Ask the agent to run
list_whatsapp_connections: it should return the numbers you chose.
Only enter a code you generated yourself just now
A client that registers itself is shown as Unverified app — it registered itself, with its name in quotes and marked as not verified, because the name is whatever it chose to call itself. That is expected for Codex, Claude Code, Cursor and VS Code. Access goes to whoever showed you the code, so never type a code that somebody sent you, or one from a browser page you did not open yourself a moment ago. Codes expire after 10 minutes.
A client connected this way can read and send (the scopes
whatsapp.read and whatsapp.send), and you can untick either when you
approve. It works with the MCP server only. For webhooks, for managing
connections or for the REST API, use an API key
or an app you registered yourself.
Codex
codex mcp add wasync --url https://cloudapi.wasync.app/api/mcp
codex mcp login wasynccodex mcp login opens the browser page with the code. On a machine without a
browser, run codex mcp login wasync --no-browser, open the printed link on
another device and paste the final address back into the terminal.
The same server in ~/.codex/config.toml:
[mcp_servers.wasync]
url = "https://cloudapi.wasync.app/api/mcp"Claude Code
claude mcp add --transport http wasync https://cloudapi.wasync.app/api/mcpThen, inside Claude Code, run /mcp, choose wasync and follow the steps in
the browser. From the shell, claude mcp login wasync does the same.
Cursor
Add the server to ~/.cursor/mcp.json (every project) or .cursor/mcp.json
(one project):
{
"mcpServers": {
"wasync": {
"url": "https://cloudapi.wasync.app/api/mcp"
}
}
}Cursor opens the browser page with the code the first time the server is used.
VS Code
Run MCP: Add Server from the Command Palette, choose
HTTP (HTTP or Server-Sent Events) and enter the server URL. Or put it in
.vscode/mcp.json:
{
"servers": {
"wasync": {
"type": "http",
"url": "https://cloudapi.wasync.app/api/mcp"
}
}
}Start the server and accept the sign-in request: the browser page with the code opens.
Other clients
Any client that supports remote MCP servers with OAuth and registers itself
(dynamic client registration) works with the URL alone. A client that only
speaks to local servers can go through the mcp-remote bridge:
{
"mcpServers": {
"wasync": {
"command": "npx",
"args": ["mcp-remote", "https://cloudapi.wasync.app/api/mcp"]
}
}
}If the list of numbers is empty
If list_whatsapp_connections returns an empty list, the code was approved on
an account that has no numbers shared with the app. Sign the client out of the
server (for the bridge: rm -rf ~/.mcp-auth), connect again and type the new
code where the number lives. An app can be authorized on several accounts; each
authorization is separate and can be revoked on its own.
See and revoke access
Every app you approved is listed under Authorized apps: in Bitrix24, WASync, Settings, API & Agents; for a developer workspace, developers.wasync.app, Authorize an app. Each row shows the app (one that registered itself appears as "name" (name not verified)), the numbers it can use, what it can do, who approved it and when, and when it was last used.
Revoke access stops the app immediately. To use it again, approve a new code. A revoke you make stays in force until a person approves the app again.
An app can also give its access back itself with POST /oauth/revoke. If a
refresh token that was already replaced is presented again, WASync treats it as
a sign that the token was copied and revokes that app's access; a retry within
30 seconds of a refresh is simply refused and the access stays.
Use an app you registered yourself
Register an app when you need more than read and send (whatsapp.events,
whatsapp.manage), the REST API with the same credentials, or a client that
cannot register itself.
-
Create an app at https://developers.wasync.app/apps. Set the redirect URI to the exact callback address your client uses (for the bridge below:
http://localhost:3334/oauth/callback) and tick the scopes the agent needs. Copy theclient_idand theclient_secret(shown once). The redirect URI of a registered app is matched exactly, port included. -
Give the client those credentials. Through the
mcp-remotebridge, on the same port as the redirect URI:npx mcp-remote https://cloudapi.wasync.app/api/mcp 3334 \ --static-oauth-client-info '{ "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET" }' \ --static-oauth-client-metadata '{ "scope": "whatsapp.read whatsapp.send" }' \ --authorize-param prompt=consentA client that lets you enter a client ID and secret can use them directly instead of the bridge:
codex mcp add wasync --url https://cloudapi.wasync.app/api/mcp --oauth-client-id YOUR_CLIENT_ID,claude mcp add --transport http --client-id YOUR_CLIENT_ID --client-secret --callback-port 3334 wasync https://cloudapi.wasync.app/api/mcp, or theauthobject (CLIENT_ID,CLIENT_SECRET) in Cursor'smcp.json. -
Type the code from the browser page where your number lives, as in Connect a client.
prompt=consent makes WASync always show the code. Without it, a request from
your own registered app is approved automatically when your developer account
owns exactly one workspace with at least one connection, which is the wrong
place if your number is in Bitrix24. A client that registered itself is never
approved automatically: it always shows the code.
Find it in the registry
WASync is listed in the official MCP Registry as:
app.wasync/whatsappClients and directories that read the registry can find the server by name instead of pasting the URL.
The tools
| Tool | What it does | Needs |
|---|---|---|
list_whatsapp_connections | Lists the connections the grant may use, with status and licence state. Every other tool takes a connection id from here. | read |
get_whatsapp_connection | The current state of one connection: online or not, licence status and expiry. Read-only. | read |
read_whatsapp_messages | Stored messages, newest first, across every shared connection or one of them; paged with nextCursor. Nothing is sent and no read receipt is shown. | read |
send_whatsapp_message | Sends a text message from one connection to one recipient. The tool's description tells the model to confirm recipient and wording first: a WhatsApp message cannot be recalled. | send |
send_whatsapp_file | Sends a file (document, image, audio or video, up to 5 MB) with an optional caption. Give a direct https link in url (preferred) or base64 in data. Same confirm-first rule: it cannot be recalled. | send |
mark_whatsapp_messages_read | Marks one customer's inbound messages as read (blue ticks), by phone number or by a message id. | send |
They map onto GET /connections, GET /connections/{id}, GET /messages,
POST /messages (text and media) and POST /messages/read, and they obey the
same scopes — an agent can only do what the grant
allows.
Sending a file
send_whatsapp_file takes exactly one of url or data:
{
"connectionId": "conn_123",
"to": "40700000000",
"url": "https://files.example.com/offers/offer-2026.pdf",
"filename": "offer-2026.pdf",
"caption": "Here is the offer we discussed."
}urlmust be a directhttps://link to a file that anyone on the internet can open without logging in. WASync downloads it (up to 5 MB, 20 seconds) and takes themimetypefrom the file server's answer unless you pass one. Links that point at private networks, at WASync itself, or at a web page instead of a file are refused.datais the file as plain base64 (nodata:prefix), at most 5 MB decoded, and thenmimetypeis required. Preferurl: moving file bytes through a model's conversation is slow and costly.filenameis what the recipient sees (no slashes);captionis optional, up to 1024 characters.
Failures come back as tool errors with a stable code at the start of the
message: invalid_url, url_not_allowed, download_failed, file_too_large,
invalid_media, or send_failed: <reason> when WASync refused the send.
MCP or the REST API?
Use MCP when a human-supervised agent should be able to reach WhatsApp: answering from a chat client, drafting replies, looking things up. Use the REST API when your own software owns the behaviour and needs webhooks, idempotency keys, files larger than 5 MB or provisioning — none of which MCP exposes.
An OAuth grant is only ever issued over connections that already exist, so MCP cannot create a workspace's first connection. Create it with an API key first: Quickstart.