Integrate WhatsApp with MCP

To integrate WhatsApp with MCP, calls go out through its MCP tool (tools/call) wrapping a Wapito endpoint and events come back through its MCP resource fed by your webhook receiver; authentication is Token held in the MCP server's environment; clients never receive it, and the setup below takes about 45 minutes. No official connector is involved: groups, Channels, status posts and template-free sends all go through one plain HTTPS call.

AI

What you can do with MCP

Setup in MCP

Authentication
Token held in the MCP server's environment; clients never receive it
Time to first call
About 45 minutes
  1. Create an MCP server in any language with an official SDK, and read the Wapito channel token from its environment rather than from any client-supplied argument.

  2. Expose a small number of tools with strict input schemas - send a message, list groups, create a group, check a number - and give each a description that states its limits.

  3. Mark the tools that send anything as requiring confirmation in the host, so a human approves an outbound message before it leaves.

  4. Run a webhook receiver alongside the server that stores recent events, and expose them as resources so the assistant can read context without being handed a send capability.

  5. Test with a Sandbox channel first, with a hard per-session cap on sends, before pointing the server at a production number.

Example flows

Let an assistant send a WhatsApp message

A send tool takes a recipient and a body, validates the recipient against an allow-list held by the server, and calls Wapito. The host shows the user exactly what will be sent before it goes.

POST /messages/text Send a text message

curl --request POST \
  --url https://api.wapito.com/v1/messages/text \
  --header 'Authorization: Bearer wpt_YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"to":"+15551234567","body":"Your order #4182 has shipped. Track it here: https://acme.example/t/4182","typing_time":3}'

Give the assistant read access to groups

A list-groups tool returns names and ids only. It is read-only by construction, which makes it safe to expose without confirmation while the write tools stay gated.

GET /groups List groups

curl --request GET \
  --url 'https://api.wapito.com/v1/groups?count=50&offset=0' \
  --header 'Authorization: Bearer wpt_YOUR_TOKEN'

Create a group from a conversation

A create-group tool takes a subject and a list of participants drawn from a directory the server controls, so the assistant can propose a group but cannot invent members from the conversation text.

POST /groups Create a group

curl --request POST \
  --url https://api.wapito.com/v1/groups \
  --header 'Authorization: Bearer wpt_YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"subject":"Acme Launch Team","participants":["+15551234567","+15559876543"],"description":"Coordination for the Q3 launch. Keep it on topic."}'

Surface recent messages as context

Recent inbound messages are exposed as resources rather than as a tool, so the assistant can read the thread it is being asked about without that read implying any ability to reply.

GET /messages/list/{chat_id} List messages in a chat

Beta

curl --request GET \
  --url 'https://api.wapito.com/v1/messages/list/15551234567@s.whatsapp.net?count=50&offset=0&from_me=true&time_from=1789372800000&time_to=1789459200000' \
  --header 'Authorization: Bearer wpt_YOUR_TOKEN'

Receiving events

In MCP the inbound side is the MCP resource fed by your webhook receiver: it gives you the URL to register in Wapito.Every event Wapito delivers — an inbound message, a delivery receipt, a member joining a group, a number disconnecting — is one HTTPS POST to a URL you register, signed with the webhook's secret in the X-Wapito-Signature header. Verify that header against the raw request body before you act on anything, answer with a 2xx within the retry window, and do slow work afterwards.

Webhooks guide: events, envelope and signature MCP resource fed by your webhook receiver documentation

What the official connector does instead

There is no official WhatsApp MCP server from Meta, and the official API has no groups, Channels or status to expose through one. A server wrapping Wapito can expose all of them, which is precisely why the write tools need confirmation in the host.

Wapito is an independent product. It is not affiliated with, endorsed by, sponsored by or certified by WhatsApp or Meta Platforms, Inc. WhatsApp is a trademark of Meta Platforms, Inc.

Frequently asked questions

Is it safe to give an assistant a send tool?

Only with guardrails. Keep the tool list minimal, validate recipients against your own allow-list rather than trusting the model, require host confirmation on anything that sends, and cap sends per session. Treat inbound message text as data, never as instructions the assistant should follow.

Where does the token live?

In the server's environment, never in a tool argument and never in a prompt. The client asks the server to do something; the server decides whether to and holds the credential. That separation is the whole point of putting an MCP server in front of an API.

Can the assistant be triggered by an incoming message?

Not directly - MCP has no inbound trigger. Run your own webhook receiver, store the events, and expose them as resources the assistant reads when asked. If you want a message to start an autonomous run, that scheduling belongs in your code rather than in the protocol.

Related

Try it on your own number

Create a channel, link a WhatsApp number by QR or pairing code, and call the API in a couple of minutes. The Sandbox plan is free and needs no card.