Skip to content
whatsapi.sh
Docs

The MCP server

Connect an AI app to send WhatsApp messages, read chats and manage your numbers. Calls use your account quota and sending limits.

Connect over HTTP

Server transport: Streamable HTTP. In an OAuth-capable AI app, add this URL as a remote MCP server, without pasting a key:

MCP URL
https://api.whatsapi.sh/mcp

Your app can list the tools before you sign in. To use them, sign in when your app opens whatsapi, check the app name and press Connect. The app gets its own API key. If your client only accepts keys, use the setup below.

Ask your agent
Show my connected WhatsApp numbers. Do not send any messages.

The agent calls list_numbers and shows the numbers on your account with their connection status. A new account returns an empty list. Pair a number in the dashboard before trying a send.

What you allow

This connection is not read-only. It can send real messages, read stored chats, pair numbers, change their sending settings and configure webhooks and Supabase hooks. It acts on your account. There are no separate read-only or per-tool permissions. Ask the agent to show the recipient and message for approval before sending.

To stop new calls, revoke the app's named key under API keys in the dashboard. Removing the server from the AI app alone does not revoke that key. Messages already queued can still leave; cancel them on Messages or with cancel_queued_message. Revoking a key does not undo a sent message.

Open API keys

whatsapi is an unofficial WhatsApp API. WhatsApp may restrict or ban your number. The send queue and daily new-conversation limit still apply through MCP. A queued message is accepted, not delivered. Read the sending guide before you let an agent send messages.

Avoiding bans

Claude Code and Codex: install the plugin

The whatsapi plugin connects your agent to whatsapi. There's no key to copy.

Claude Code

claude plugin marketplace add owe-br/plugins
claude plugin install whatsapi@owe-br

Then type /mcp, pick whatsapi and choose Authenticate.

Codex

codex plugin marketplace add owe-br/plugins
codex plugin add whatsapi@owe-br
codex mcp login whatsapi

The last line signs you in. It needs Codex 0.147 or later: older versions fail with "missing required issuer". To update, run npm install -g @openai/codex@latest.

Either way, your browser opens whatsapi. Sign in and press Connect. That makes an API key named after the app, listed under API keys in the dashboard. To disconnect the app, revoke that key.

See the plugin on GitHub

An agent with no browser

A script on a server or in a container can sign in with a short code instead of a pasted key. Start a sign-in:

curl https://api.whatsapi.sh/oauth/device_authorization -d client_id=whatsapi-agent

Show the person the verification_uri_complete link. They open it, check the code and press Connect. Meanwhile, ask for the key every 5 seconds:

# device_code comes from the first answer
curl https://api.whatsapi.sh/oauth/token \
  -d client_id=whatsapi-agent \
  -d grant_type=urn:ietf:params:oauth:grant-type:device_code \
  -d device_code=DEVICE_CODE

Until they press Connect, the answer is authorization_pending. After that, access_token is a wa_ key, sent only once. The code expires after 10 minutes.

Any other client: use a key

Create a separate key under API keys in the dashboard and send it in the Authorization header. This config is for Claude Code; other clients may use a different format. Keep the key out of prompts, URLs and git:

.mcp.json (Claude Code)
{
  "mcpServers": {
    "whatsapi": {
      "type": "http",
      "url": "https://api.whatsapi.sh/mcp",
      "headers": { "Authorization": "Bearer wa_your_key" }
    }
  }
}

What an app can see and what we keep about it: Privacy when you connect an AI app.

When a call fails

A 401 means the key is missing, invalid or revoked. Sign in again or replace the key in the client. If approval says you have too many keys, revoke an unused key in the dashboard and reconnect.

NUMBER_NOT_CONNECTED means you need to check the phone and reconnect under Numbers. A 429 names the daily limit, monthly quota or new-conversation limit; wait until the time shown. If a send times out, do not send it again blindly. Check the chat and delivery receipts. For a safe retry, reuse the same idempotencyKey.

Loading the tool list…