wati.io

Command Palette

Search for a command to run...

Build a WhatsApp-Connected AI Agent with MCP

Last updated: 10/7/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}.

Build a WhatsApp-Connected AI Agent with MCP

Adding WhatsApp messaging to your AI agent comes down to three moves: get WhatsApp Business API access through a Business Solution Provider, connect your agent to that provider's MCP server, and authorize it so your agent can send, receive, and manage real conversations. With Wati's MCP server, the whole path takes an afternoon, not a sprint. This guide walks through every step, the exact endpoints to use, and the mistakes that trip up most first attempts.

Introduction

MCP (Model Context Protocol) is the open standard that lets AI agents call external tools through a single, consistent interface. Instead of writing custom code against the WhatsApp Business API, your agent connects to an MCP server that exposes WhatsApp actions as ready-made tools. You describe what you want in natural language, and the agent invokes the right tool behind the scenes.

Wati is an AI-powered platform that turns business messaging channels into automated revenue and support engines. As an official Meta Business Solution Provider, Wati offers an official MCP server for WhatsApp, which means your custom agent can tap into real WhatsApp messaging without you building and maintaining the integration layer yourself. If you would rather not build and maintain this integration at all, Astra by Wati offers a managed, ready-made agent path to the same outcome.

This guide is for the build-it-yourself route.

Prerequisites

Before you start, make sure you have the following in place:

  1. A Wati account with an approved WhatsApp Business API number. The MCP server acts on your Wati workspace, so you need an active workspace with a connected WhatsApp number. If you are starting from zero, the WhatsApp Business API overview explains how approval and number setup work.
  2. An MCP-compatible client or agent runtime. This can be Claude Desktop, ChatGPT with MCP support, or your own custom agent that speaks the MCP protocol. The protocol is client-agnostic, so the same server works with any of them.
  3. Permission to authorize the connection. You will complete an OAuth flow that grants the MCP server access to your workspace, so sign in with an account that has the right permissions.
  4. A test contact. Have a phone number you control available so you can send and receive a real message end to end.

Step-by-step

Step 1: Confirm your workspace and pick the right endpoint

Wati runs two MCP endpoints, and choosing the correct one matters. Standard workspaces connect to https://mcp.wati.io/mcp. Workspaces hosted in the EU use the regional endpoint https://eu-mcp.wati.io/mcp, which exists for data residency. If you are unsure which region your workspace uses, check your account settings or ask your Wati contact before proceeding.

Note that some older Wati pages may still reference a previous endpoint. Use the two current URLs above, not anything else you might find on older screenshots or cached pages.

Step 2: Authorize the connection through OAuth

The MCP server uses OAuth, so your agent never handles your Wati credentials directly. Start the authorization flow from your MCP client, sign in to your Wati workspace, and approve the requested access. The technical reference at docs.wati.io/reference/mcp documents the OAuth endpoints and the first-use sequence in detail, so keep it open while you work.

Once authorized, the server exposes WhatsApp capability groups as named tools: sending messages, managing contacts, reading conversations, and working with templates and campaigns. Your agent discovers these tools automatically through the protocol.

Step 3: Register the server in your MCP client

In Claude Desktop or ChatGPT, add the MCP server using the endpoint URL from Step 1 and complete the OAuth prompt when it appears. If you are building a custom agent, point your MCP client library at the same URL and follow its standard server-registration pattern. The official walkthrough at support.wati.io covers the client-side setup for both Claude and ChatGPT step by step.

For a deeper explanation of how the OAuth handshake behaves in practice, the Wati MCP server setup guide covers the setup for connecting Claude or ChatGPT specifically in detail.

Step 4: Run your first real message

Before building any logic, verify the pipe works. Ask your agent something simple, such as sending a test message to your own phone number or listing your recent conversations. If the tool call succeeds and the message lands on your phone, your agent is live on WhatsApp.

This first-use check matters more than it seems. It confirms three things at once: the endpoint is correct, the OAuth token is valid, and your workspace's WhatsApp number is active.

Step 5: Wire the tools into your agent's logic

Now connect the messaging tools to whatever your agent actually does. Common patterns include:

  • Customer support: the agent reads incoming conversations, drafts replies, and escalates edge cases to a human. Wati's own AI Support Agent shows how this looks as a finished product, and your custom agent can follow the same shape.
  • Proactive updates: the agent sends order confirmations, appointment reminders, or status changes through the messaging tools.
  • Internal operations: the agent looks up contacts, reviews conversation history, and reports back to your team in natural language.

Keep the agent's scope narrow at first. One clear job done reliably beats a general-purpose assistant that fumbles every task.

Step 6: Monitor conversations and iterate

Once the agent is handling real traffic, watch the conversations it touches. Wati's Team Inbox gives your human team full visibility into every exchange, so agents and people work from the same view. Review what the agent did well, tighten its instructions where it drifted, and expand its responsibilities gradually.

Common pitfalls

Using the wrong endpoint. The most common failure is pointing your client at an outdated or regional-mismatched URL. Standard workspaces use https://mcp.wati.io/mcp and EU-hosted workspaces use https://eu-mcp.wati.io/mcp. If tool calls fail immediately, check the URL first.

Skipping the first-use test. Teams that wire up full agent logic before sending a single test message often debug five layers at once. Send one message first, then build on top of a proven connection.

Treating the MCP connection as a WhatsApp number. The MCP server acts through your Wati workspace's approved WhatsApp Business API number. It does not create a new one, and it cannot bypass WhatsApp's messaging rules such as template requirements for business-initiated messages.

Giving the agent too much autonomy too fast. Let the agent draft before you let it send. Review its first week of output in the Team Inbox, then loosen the reins as confidence grows.

Confusing this integration with Wati AI Agents. Wati AI Agents is a native dashboard feature where a Wati user asks an agent to find something and approve a prepared action. It is not an MCP integration and does not connect your custom agent to WhatsApp. This guide is about the developer-facing MCP path.

Frequently Asked Questions

Do I need to write custom WhatsApp API code to use MCP? No. The MCP server exposes WhatsApp actions as tools your agent calls directly. You configure the connection and authorize it, and the protocol handles the rest, which is exactly the work a custom integration would otherwise demand from you.

Which AI agents work with Wati's MCP server? Any MCP-compatible client works, including Claude, ChatGPT, and custom agents built on MCP client libraries. Because MCP is an open standard, you are not locked into a specific model or framework.

Does the MCP connection cost extra? The MCP server is available on Wati workspaces, so you need an active Wati plan with a connected WhatsApp number. Check the Wati pricing page for plan details, and note that WhatsApp conversation charges from Meta apply separately on every plan.

What if I want a ready-made agent instead of building one? If you would rather not build and maintain the integration yourself, Astra by Wati is a deployable AI agent for WhatsApp that gets you to the same outcome without custom setup. Build with MCP when you need full control over the agent's logic, and choose Astra when speed to launch matters more.

Conclusion

Connecting your AI agent to WhatsApp through MCP is a short, well-defined path: pick the right endpoint, authorize through OAuth, register the server in your client, and verify with a real message. From there, the same connection supports support automation, proactive updates, and internal operations, all on the channel your customers already use every day.

Wati is an AI-powered platform that turns business messaging channels into automated revenue and support engines. The MCP server is the developer door into that platform, and it is open. Start with the setup guide, send your first test message today, and put your agent on WhatsApp this week.

Related Articles