How to Connect an AI Agent to WhatsApp (MCP, 2026)
Giving an AI agent its own WhatsApp number used to mean reverse-engineering a client or standing up a brittle bridge. The Model Context Protocol (MCP) turned it into a connection: point your agent at one HTTPS endpoint, sign in once, and it can send, read and manage WhatsApp messages as tools. This guide walks the whole path — the two kinds of number you can connect, the generic connect flow, and what the agent can actually do once it is live.
What “connecting an agent to WhatsApp” means
An MCP server exposes a set of tools to any MCP-capable client. WhatsMCP is a hosted MCP server whose tools act on a real WhatsApp account: wa_send_message, wa_list_messages, wa_get_media and about twenty more. Your agent — Claude, ChatGPT, Cursor, Codex, a Grok- or Manus-powered agent, or something you built yourself — connects to that server and calls the tools. There is nothing to host: the endpoint is remote, and the agent talks to it over Streamable HTTP.
Two things decide how a connection behaves: which kind of WhatsApp number you put behind it, and which client you connect.
Step 1: Choose the kind of number
WhatsMCP connects two kinds of WhatsApp number, through the same endpoint:
- Personal (QR). Your existing WhatsApp, linked like WhatsApp Web by scanning one QR code. It keeps your groups, contacts and history, and your agent can send free text at any time. It is a linked device, so it is unofficial — WhatsApp can restrict a linked device, and it sits outside WhatsApp’s terms of service.
- Business (official). An official number on Meta’s WhatsApp Cloud API, connected with Facebook. It is the route Meta supports for business automation: it adds message templates and the 24-hour window (free-form replies within 24 hours of the customer’s last message, templates after), and Meta bills its own per-message fees. A workspace’s first Business plan starts with a 7-day free trial.
Rule of thumb: use a Business number for customer-facing sales and support, and a Personal number when the relationship already lives on someone’s own WhatsApp — a founder’s or an account manager’s. The full side-by-side is on the MCP server page.
Step 2: Create a workspace and connect the number
Create a free workspace in the console, then add the number:
- Personal: open Fleet → Add Number → Personal WhatsApp, then on your phone go to WhatsApp → Settings → Linked devices → Link a device and scan the QR. The number appears in your fleet within a few seconds.
- Business: open Fleet → Add Number → WhatsApp Business and press Connect with Facebook. Meta’s Embedded Signup registers the number on the Cloud API for you.
Either way, the number is now reachable through one endpoint.
Step 3: Point your agent at the MCP server
This is the part people get wrong, so it is worth stating plainly. The endpoint is the full URL:
https://api.whatsmcp.com/mcp
Both the api. host and the /mcp path matter — the bare domain is not the endpoint. Add it to your client as a remote (HTTP / Streamable-HTTP) MCP server, not a stdio command.
For authentication, OAuth is the default and the easy path: the client reads the server’s metadata, registers itself, and sends you to the WhatsMCP console to approve. Nothing is pasted anywhere, and you can revoke a client later from Console → Connections. For clients that cannot sign in — scripts, CI — an API key (wamcp_live_…) goes in an Authorization: Bearer header, or x-api-key where the client reserves Authorization for its own token.
The flow is the same shape in every client:
- Add the remote server at
https://api.whatsmcp.com/mcp. - Approve the OAuth sign-in in your browser.
- The client lists the WhatsMCP tools — you are connected.
Only the menu path differs per client. We keep a short, accurate guide for each one:
- Connect Claude to WhatsApp — Desktop, claude.ai or Claude Code.
- Connect ChatGPT to WhatsApp — a connector in Developer mode (OAuth only).
- Connect Codex to WhatsApp — one
codex mcp addcommand. - Connect Cursor to WhatsApp — a one-click deep link or an
mcp.jsonentry. - The full connector hub lists Grok, Manus and the rest.
Step 4: Do something with it
Once connected, the agent has one toolbelt for the whole account. Start it with wa_list_accounts — every other tool takes an account_id from it — and then it can:
- Send and reply — text, images, documents and voice notes, in direct chats, groups and channels, with edits and reactions.
- Read and search — page message history with a cursor (no gaps, no duplicates), catch up on a chat, and resolve “message Alice” against the synced address book.
- Handle media — download received images, documents and audio by message id; attach files on the way out.
- Manage groups — create groups, add and remove members, promote and demote admins, follow channels.
- Templates and the 24-hour window — on a Business number, send approved templates and free-form replies inside the window.
- Receive webhooks — push each inbound message to your own HTTPS endpoint, signed with HMAC-SHA256, instead of polling (paid plans).
- Calls — a number can take WhatsApp calls, and WhatsMCP also bridges them to a SIP trunk or softphone if you want them on a phone system.
A simple agent loop is: poll wa_list_messages with a cursor, act on each inbound message, and reply with wa_send_message. Because the agent reads on its own schedule, nothing can interrupt it mid-thought — the cursor is what makes catching up reliable.
A note on reading incoming messages
The server never pushes to your agent. That is deliberate: an LLM cannot be interrupted, so your agent reads when it is ready. wa_list_messages returns messages oldest-first, each with a cursor; pass the last cursor back as after_cursor and you get only what has arrived since. If you would rather not poll, register a webhook and WhatsMCP delivers each message to your backend as it lands.
Where to go next
- Pick your client and follow its exact steps on the connector hub.
- Read the MCP server overview for the tool list and the hosted-vs-self-host trade-off.
- For a CRM, see how WhatsMCP connects WhatsApp to Pipedrive.
- For voice, the WhatsApp SIP trunk puts a number’s calls on Asterisk, FreePBX or a hosted softphone.
Connecting an agent to WhatsApp is, in the end, one URL and a sign-in. The interesting part is what you do once the messages are tools.
About WhatsMCP Engineering
Engineering Team at WhatsMCP. The team building WhatsMCP's MCP server and SIP bridge — the people who wrote the code these posts describe.