Guide · AI agents on social media

WhatsApp MCP server: send and read WhatsApp messages from an AI agent

By Antoine Blanco··6 min read

A WhatsApp MCP server turns the Cloud API into tools an agent can call: open a conversation, send a message, read the inbox, send an approved template. It cannot post, because WhatsApp has no posts. The hard part is not the plumbing, it is the 24-hour window. Everything below was checked on October 21, 2026.

What a WhatsApp MCP server can and cannot do

WhatsApp is a conversation channel, not a publishing surface. So the tool list an agent gets is short and sharp: list conversations, open a conversation by phone number in international format, send text, send an approved template, read inbound messages. There are no posts, no comments and therefore no analytics. Any WhatsApp MCP server promising you reach and impressions is describing something that does not exist in the API.

What it needs underneath is a WhatsApp Business Account. On PlugKit that connection runs through Meta's Embedded Signup: call GET /v1/connect/whatsapp?profileId=..., open the authUrl it returns, and the user signs in with Facebook, picks or creates a WABA and verifies the number. The permissions requested are whatsapp_business_messaging and whatsapp_business_management.

One trap from the PlugKit docs that costs people a day: connect a real number. A Meta test number carries a 24-hour token and stops working the next morning, which looks exactly like a broken integration.

The 24-hour window, seen from an agent

This is the rule that decides whether your agent's message sends at all. Free-form text is only accepted within 24 hours of the contact's last message to you. Outside that window, free-form text is rejected and only an approved template goes through.

For an agent, that has a practical consequence most tutorials skip. The agent cannot know from the text of a request whether the window is open; it has to read the conversation first. So the useful loop is: list the conversation, look at the timestamp of the last inbound message, then choose between free-form text and a template. An agent that skips the read will produce confident failures, and a user who is told the message was sent when it was rejected is worse than an error.

Campaigns follow the same window. There is no setting that opens it.

Templates: the only way out of the window

A template is pre-approved text with numbered placeholders. List the ones approved on an account with GET /v1/accounts/{ACCOUNT_ID}/message-templates, then send one by passing template with name, language and variables, which fill {{1}}, {{2}} in order. Name and language have to match exactly, and components takes raw Meta components when you need a header or buttons.

Two things to tell your agent explicitly. It cannot invent a template, because approval happens outside your code. And it should not pick a template whose category does not match the intent: Meta's per-message pricing bills by category, so sending a marketing template to do a utility job is a self-inflicted cost.

What the messages cost

Meta moved to per-message pricing on July 1, 2025, replacing the old per-conversation model. You pay on delivery, by message category and by the recipient's country code. Messages from users to you are free.

Category Needs an approved template Sendable outside the 24-hour window Charged
Marketing yes yes yes
Utility yes yes yes, and since October 1, 2026 also inside an open service window
Authentication yes yes yes
Service no no first 1,000 per business number per month are not charged since October 1, 2026, then yes
Meta Business Agent no no yes, per token rather than per message

Three dates to keep straight: per-message pricing since July 1, 2025; the Meta Business Agent category added July 1, 2026; and October 1, 2026, which brought the 1,000 uncharged service messages per number per month, with no rollover, plus charging for utility messages sent inside an open service window. Meta only changes pricing on the first day of a quarter, which makes this one of the easier bills to forecast.

One bright spot worth building for: when a user messages you from a Click to WhatsApp ad on Android or iOS and you reply inside the service window, a free entry point window of up to 7 days opens, during which marketing, utility, authentication and service messages are not charged. Meta Business Agent messages still are. The full grid is in WhatsApp Business API pricing.

Why WhatsApp Web automation is the wrong shortcut

Search for a WhatsApp MCP server and most of what you find drives WhatsApp Web or a reverse-engineered client library, usually by pairing a personal number over a QR code. It demos beautifully. It also means an unofficial client is sending traffic on behalf of your number, which is a direct route to losing it, and when it goes you lose the number your customers already have. There is no appeal queue for that.

The official Cloud API costs money per message and makes you get templates approved. Those two frictions are what you are buying: the number stays yours. The same reasoning applies across platforms, and the broader version is in WhatsApp automation.

Connect it to Claude, ChatGPT or Cursor

PlugKit's hosted MCP server covers WhatsApp alongside the publishing platforms, so one endpoint gives an agent both. It is at https://api.plugkit.co/mcp over Streamable HTTP, with 103 tools and three prepared workflows as of October 21, 2026. In Claude Code:

claude mcp add -t http plugkit https://api.plugkit.co/mcp

In Claude's apps, Customize then Connectors then Add then a custom connector, and paste the same URL. ChatGPT takes it under developer mode. Cursor and VS Code take a one-click link or a few lines of JSON. Authentication is OAuth 2.1 with PKCE and no client secret, with mcp:read for reading conversations and mcp:write to send. Start on mcp:read for a week: reading an inbox is reversible, sending a WhatsApp message to a customer is not.

If inbound messages stop arriving, the fix is POST /v1/connect/whatsapp/{ACCOUNT_ID}/subscribe-webhooks, which re-subscribes without a reconnect. When sends fail, read GET /v1/accounts/{ACCOUNT_ID} for isActive, needsReconnection and disconnectedReason; Meta can refuse to serve a number while the token is perfectly valid, and that surfaces as a Meta error rather than an auth error.

PlugKit is $49 a month for 5 connected accounts, cancel anytime, with 7 days free and no card, one connected account during the trial. The WhatsApp message fees are Meta's and are billed by Meta, not passed through PlugKit. For the same pattern on platforms that do have posts, see the Instagram MCP server and the LinkedIn MCP server.

FAQ

Can Claude send WhatsApp messages?

Yes, through an MCP server connected to the WhatsApp Cloud API. Claude has no WhatsApp access of its own. Once the server is added, sending a message is a tool call, subject to the same 24-hour window and template rules as any other Cloud API client.

Is there an official WhatsApp MCP server from Meta?

No. Meta publishes the Cloud API; the MCP layer is built by third parties on top of it. That is why it is worth checking whether a given server uses the Cloud API or drives WhatsApp Web, because only the first one is sanctioned.

Why was my agent's WhatsApp message rejected?

Almost always the 24-hour window. If the contact has not messaged you in the last 24 hours, free-form text is refused and you need an approved template. The second most common cause is a template name or language that does not match exactly.

Can a WhatsApp MCP server read my message history?

It can read the conversations that arrived through the connected business number, delivered by webhook. It cannot import the history of a personal WhatsApp account, and anything claiming to do so is driving an unofficial client.

Does WhatsApp give an agent any analytics?

No. There are no posts on WhatsApp, so there are no post metrics. Delivery and read states exist at the message level, but reach, impressions and engagement do not apply to this channel.

AB
Antoine BlancoFounder of PlugKit. Runs his own Instagram, YouTube and X accounts through the API and MCP server described here.

One plug for every platform your agent touches

$49 a month for 5 connected accounts, cancel anytime. Every feature in every plan.

Get your API key →
English ▾