DEV Community

Cover image for Whapi-mcp: 165 WhatsApp Tools for AI Agents (2026)
WhatsApp API for developers
WhatsApp API for developers

Posted on

Whapi-mcp: 165 WhatsApp Tools for AI Agents (2026)

165 WhatsApp Tools for AI Agents: What Whapi-mcp Can Do and Why It Beats Manual REST (2026)

AI Agents & WhatsApp API

This developer guide from Whapi.Cloud, a WhatsApp API provider, explains how to connect AI agents — Claude Desktop, Cursor IDE, Azure AI Foundry, and any MCP-compatible runtime — to WhatsApp using the whapi-mcp Model Context Protocol server. Whapi-mcp auto-generates its entire tool library from the Whapi.Cloud OpenAPI specification, giving agents a typed interface to the full WhatsApp API from a single JSON configuration block with no backend deployment required. The guide covers installation, an MCP-vs-REST cost breakdown, three production automation workflows, the Whapi Agent Skill anti-hallucination layer, and architecture considerations for production teams. Written for developers and technical leads building WhatsApp automation in 2026; it does not cover the official WhatsApp Business API or Meta BSP program onboarding.

whapi-mcp WhatsApp MCP server connecting AI agents to the full WhatsApp API toolset

When an AI agent needs to send a WhatsApp message, validate a phone number, manage a group, or post to a newsletter channel, the standard path is to write an HTTP client, wire up authentication headers, parse webhook payloads, and repeat that entire setup for every new AI runtime the team adopts. Whapi-mcp eliminates that layer entirely by exposing the Whapi.Cloud API surface as native MCP tools — 165 auto-generated actions available to any compatible agent from a single JSON configuration entry.

What Is Whapi-mcp and How Its Tools Are Generated

Model Context Protocol (MCP) is an open standard that lets AI agents discover and invoke external tools through a typed, structured interface — without those tools being hard-coded into the agent's system prompt or application layer. Each MCP server publishes a list of named tools with defined parameters and return types; the agent queries that list at runtime, calls the tools it needs, and receives structured responses.

Whapi-mcp is the official MCP server package for the Whapi.Cloud WhatsApp API. Rather than requiring developers to manually define each WhatsApp operation as an MCP tool, the package auto-generates its entire tool library directly from the Whapi.Cloud OpenAPI specification. Tool definitions stay synchronized with API changes automatically — a mechanism that makes the tool count a reflection of the actual API surface, not a curated marketing claim.

The resulting library covers text, image, video, audio, document, poll, interactive, and reaction messaging; group management; channel and newsletter operations; community management; webhook configuration; and phone number validation. When Whapi.Cloud adds a new API endpoint, the corresponding MCP tool appears on the next server startup with no code changes required on the developer's side. This OpenAPI-to-MCP auto-generation is what distinguishes Whapi-mcp from hand-rolled MCP wrappers: it is structurally self-updating, not manually maintained.

Once the server is configured, Claude, Cursor, and Azure AI Foundry can call WhatsApp operations by name, with typed parameters, and receive structured responses — the same interaction pattern they use with any other MCP tool in their toolchain. No custom SDK, authentication middleware, or serialization layer lives in the application code. Whapi-mcp handles all of that transparently.

MCP vs Manual REST: The Setup Cost You Don't See Until Production

WhatsApp Groups via MCP

The most common objection to adopting an MCP layer is that it introduces a dependency. The more accurate framing goes the other way: a direct REST integration introduces a dependency into every AI client your team runs. Consider what "send a WhatsApp message from an AI agent" actually requires when building against the REST API directly.

  • Authentication setup: a Bearer token must be passed in every request header, plus token refresh logic if expiration is in scope.
  • Retry and timeout logic: WhatsApp API calls fail transiently; each integration needs its own retry policy or a shared library that itself requires configuration.
  • Error mapping: HTTP 4xx and 5xx responses must be caught, logged, and surfaced to the agent in a form it can act on — not silently swallowed as empty results.
  • Webhook parsing: incoming WhatsApp events — replies, reactions, status updates — require a separate endpoint, validation logic, and an event router.
  • Per-client adaptation: when you move from Claude to Cursor to Azure AI Foundry, each runtime has its own function-calling format, and the integration layer must be rebuilt for each.

With Whapi-mcp, the same send-message task reduces to a single tool call: sendMessageText takes two required parameters — to (the recipient Chat ID) and body (the message string). The MCP server handles authentication, serialization, and error propagation. One JSON config block replaces all per-client boilerplate, and that same configuration works identically in Claude Desktop, Cursor IDE, Azure AI Foundry, or any other MCP-compatible runtime without modification.

Maintenance adds another dimension that only surfaces after deployment. As the REST API evolves — endpoints added, parameters renamed, response shapes changed — a manually maintained client accumulates schema drift. Developers discover these mismatches at runtime, through failing agent calls in production, often weeks after the API changed. Because Whapi-mcp auto-generates from the OpenAPI spec, its tool definitions reflect the current API state on every server restart, no developer action required.

Get Started: Installing and Configuring whapi-mcp

Whapi-mcp requires no installation step. It runs via npx, meaning the runtime is fetched on demand when the MCP client starts the server. Your only prerequisite is a Whapi.Cloud API token — obtain one by creating a free sandbox channel at panel.whapi.cloud/register, then find the token in the channel settings.

Example of a token on the dashboard page

Add the following block to your MCP client's configuration file. The JSON structure is identical across all supported clients; only the file path differs per environment.

{
  "mcpServers": {
    "whapi-mcp": {
      "command": "npx",
      "args": ["-y", "whapi-mcp@latest"],
      "env": {
        "API_TOKEN": "YOUR_WHAPI_TOKEN_HERE"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Configuration file paths by client:

  • Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
  • Cursor IDE (Windows): %USERPROFILE%\.cursor\mcp.json

To run the server directly from a terminal — useful for testing or scripted environments — pass the token as an environment variable:

# PowerShell
$env:API_TOKEN="YOUR_WHAPI_TOKEN_HERE"; npx -y whapi-mcp@latest

# Bash / macOS / Linux
API_TOKEN=YOUR_WHAPI_TOKEN_HERE npx -y whapi-mcp@latest
Enter fullscreen mode Exit fullscreen mode

Verify the Connection Before Writing Any Automation

After adding the configuration and restarting your MCP client, confirm connectivity before building any workflow logic. Call the checkHealth tool with no arguments. A successful response returns a JSON object where status.text equals "AUTH", confirming that the server has authenticated against your Whapi.Cloud channel. Any other status value indicates a token or channel configuration issue that must be resolved before proceeding. Running automation workflows against an unauthenticated channel fails silently at the delivery level, not at the tool invocation level — so the authentication check is not optional.

With a confirmed connection, test outbound delivery using sendMessageText. This tool requires exactly two parameters: to (the Chat ID of the recipient) and body (the message string). No additional headers, content-type declarations, or response parsers are needed. The tool call produces a delivered message or a structured error.

Chat ID Format Reference

The to parameter in messaging tools accepts different Chat ID formats depending on the target. Using the wrong suffix causes silent delivery failures — the API call returns success, but the message is never delivered. The disambiguation is deterministic and must be applied before writing any automation that targets multiple contact types:

Message target Chat ID format Example
Individual contact [phone]@s.whatsapp.net 14155551234@s.whatsapp.net
Group [group_id]@g.us 12345678901234567890@g.us
Channel / Newsletter [channel_id]@newsletter 12345678901234567890@newsletter

Individual Chat IDs are constructed from the international phone number (digits only, no plus sign or dashes) followed by @s.whatsapp.net. Group IDs and channel IDs are numeric strings returned by the Whapi.Cloud API when you query existing groups or channels through the respective list tools.

For a step-by-step walkthrough with screenshots, see the MCP setup guide in the Whapi.Cloud knowledge base. A community-created video tutorial is also available on YouTube for developers who prefer a visual walkthrough of the configuration process.

Three Agent Workflows, One MCP Server

Three WhatsApp automation workflows running through whapi-mcp: community onboarding, channel content posting, story engagement loop

The breadth of the tool library becomes concrete when mapped to production automation patterns. Community onboarding, channel automation, and story engagement loops are three workflows that Whapi.Cloud customers run in practice — each implementable through Whapi-mcp without any backend code beyond the agent configuration itself.

Community Onboarding Automation

When a new user joins a WhatsApp group, an agent detects the join event through a webhook tool, queries an external CRM to determine whether the contact is already known, sends a personalized welcome message using their profile data, applies the appropriate group tag, and posts community rules in the thread. Every WhatsApp operation in this sequence — reading the join event, sending the message, applying the tag — is an MCP tool call. The coordination logic lives in the agent itself; whapi-mcp provides the execution layer. No backend server is needed to run this workflow.

Channel Content Automation

For businesses distributing content through WhatsApp newsletter channels, the channel automation workflow connects an external content source — an RSS feed, a Telegram channel, or an e-commerce product catalog — to a WhatsApp channel via an AI agent. The agent monitors the source for new items, formats the content according to the channel's publishing conventions, and posts updates using the @newsletter Chat ID format. The same sendMessageText tool that handles 1:1 messaging also handles broadcast distribution; the only difference is the Chat ID suffix.

Story Engagement Loop

WhatsApp status stories offer a high-engagement surface for business communication. An agent running the story engagement loop publishes a story with a promotional offer or teaser content, monitors incoming reactions and direct replies through webhook tools, and triggers follow-up messages to users who responded — routing them into a lead qualification flow, a booking sequence, or a survey. This closed-loop pattern is difficult to implement reliably with a manually managed REST integration because it requires coordinating asynchronous webhook events with outbound messaging decisions in real time. The MCP tool interface makes both halves of that coordination structurally symmetric from the agent's perspective: receiving events and sending messages follow the same typed call pattern.

Whapi Agent Skill: The Anti-Hallucination Layer for WhatsApp Integrations

MCP servers expose tools, but they do not tell agents which parameter combinations are invalid, which operations silently fail when the Chat ID format is wrong, or which API capabilities are commonly misunderstood. The Whapi Agent Skill fills exactly this gap — a structured knowledge layer installed directly into an AI agent's context, covering seven reference categories: Core concepts, Sending messages, Receiving messages, Groups, Channels (Newsletters), Communities, and Integration patterns.

The Agent Skill includes an explicit anti-hallucination checklist: a documented list of parameters and operations that do not exist in the Whapi.Cloud API, provided so agents can refuse confidently rather than generating plausible-looking but broken tool calls. One concrete example: there is no bulk-send parameter on sendMessageText. Sending to multiple recipients requires individual calls, not a single array argument. Agents without this knowledge construct invalid tool calls that appear structurally correct but fail silently at delivery. The Agent Skill prevents that class of error from reaching production.

The Agent Skill works with Cursor, Claude Code, GitHub Copilot, Codex, and more than 40 compatible runtimes. Install it with a single command:

npx skills add Whapi-Cloud/whapi-whatsapp-api-skill
Enter fullscreen mode Exit fullscreen mode

The skill is hosted on GitHub at github.com/Whapi-Cloud/whapi-whatsapp-api-skill with full source transparency. Detailed documentation is available in the Agent Skill guide.

When used alongside whapi-mcp, the Agent Skill and the MCP server work as complementary layers: the MCP server handles tool execution, and the Agent Skill improves tool selection accuracy before any call is made. Treating the Agent Skill as a redundant add-on misses the point — it addresses the class of errors that execution infrastructure cannot catch, because those errors happen before any tool call is attempted.

Compatible AI Clients and the Platform-Agnostic Architecture

Whapi-mcp works with any runtime that implements the Model Context Protocol. The following clients are explicitly documented and tested by Whapi.Cloud:

  • Cursor IDE: The primary developer-facing client for this use case. Add the config to %USERPROFILE%\.cursor\mcp.json and restart Cursor. WhatsApp tools appear in the agent panel immediately, alongside any other MCP servers already configured in the workspace.
  • Claude Desktop: The most accessible entry point for non-developer users and prototyping. Config path on Windows: %APPDATA%\Claude\claude_desktop_config.json. The same JSON block used for Cursor works here without modification.
  • Azure AI Foundry: The enterprise path — relevant for teams building WhatsApp automation within Microsoft Azure AI pipelines, subject to organizational governance and compliance constraints that rule out local-only tooling.
  • VS Code Agents: GitHub Copilot's agent mode in VS Code supports MCP servers, making the WhatsApp tool library accessible to developers who work in VS Code without switching to a separate client application.
  • Jenova: An MCP-compatible runtime within the broader agent framework ecosystem. Whapi.Cloud verifies compatibility with Jenova and maintains updates as the MCP protocol evolves.

Because MCP is a protocol standard rather than a vendor-specific SDK, any future MCP-compatible runtime — whether released by a major cloud provider or an open-source project — gains access to the full WhatsApp tool library without any changes to the whapi-mcp package. This structural property is the primary reason MCP represents a lower vendor lock-in choice compared to client-specific function-calling implementations, where a change in AI provider typically means rewriting the integration layer from scratch. The companion Whapi Agent Skill extends support across the same broad ecosystem, covering GitHub Copilot, Codex, and all compatible runtimes in the MCP network.

Limitations and Considerations for Technical Architects

Teams evaluating whapi-mcp for production deployments need explicit answers to questions that most product pages defer. The following are not edge cases — they are structural properties of this integration approach that belong in any honest architecture evaluation.

API policy risk. Whapi.Cloud provides access to WhatsApp messaging through a third-party session-based API, not through Meta's official Business Solution Provider program. WhatsApp enforces its terms of service server-side, and enforcement is unpredictable: account suspension can occur without warning, typically triggered by message patterns that match spam heuristics, high delivery volume, or unusually rapid scaling. Teams building customer-facing production systems should evaluate this risk explicitly against the cost and constraints of the official WhatsApp Business API — the trade-off is real and the correct choice depends on use case, volume, and risk tolerance. Whapi.Cloud's account protection guide documents the message behavior patterns that reduce suspension risk.

Rate limits. Agents designed for high-volume outbound messaging — particularly those running story engagement or broadcast channel workflows — must implement queuing or delay logic. The MCP server does not throttle calls on the agent's behalf.

Local token storage model. The zero-backend deployment design stores the API token as a local environment variable in the MCP client's configuration file. This works well for individual developer workstations and prototyping environments. For team deployments, shared CI/CD environments, or multi-developer workflows, manage the token through your organization's standard secrets infrastructure — a secrets manager, environment-specific .env files excluded from version control, or a secure vault — rather than sharing the raw configuration file.

Message template restrictions. Unlike the official WhatsApp Business API, this approach does not require pre-approved message templates for most messaging scenarios.

In 2026, MCP Is the Protocol AI Agents Were Built For — REST Was Designed for Humans

REST APIs were designed for HTTP clients written by developers against known, stable integration points. AI agents work differently: they discover capabilities at runtime, invoke tools based on semantic understanding of parameters and task context, and adapt to changing requirements without code changes. MCP was built for exactly this pattern — which is why adoption across Claude, Cursor, Azure AI Foundry, and the broader agent ecosystem accelerated through 2026.

Whapi-mcp translates that architectural advantage into a concrete WhatsApp integration story. The complete WhatsApp API toolset is available to any MCP-compatible agent from a single configuration entry. That configuration works unchanged across clients. Schema updates propagate automatically. Tokens stay local with zero backend exposure. None of these properties are available when the integration is built directly against the REST API, and they compound in value as the number of AI clients in an organization grows.

For development teams building AI agent infrastructure in 2026, the question is not whether MCP will become the dominant integration pattern for external services — the direction is clear. The real question is whether WhatsApp automation becomes part of that infrastructure or remains a one-off integration rebuilt manually for every new AI runtime the organization adopts. whapi-mcp makes it the former, starting from a single JSON configuration block.


Connect Your AI Agent to WhatsApp Today

Create a free Whapi.Cloud channel, copy one JSON config block into your MCP client, and your agent gains access to the complete WhatsApp API toolset — no backend required, no per-client rewrites, no schema maintenance.


Developer Q&A

Frequently Asked Questions

What AI clients and runtimes does whapi-mcp support?

whapi-mcp supports any runtime that implements the Model Context Protocol standard. Explicitly tested and documented clients include Cursor IDE, Claude Desktop, Azure AI Foundry, VS Code Agents (GitHub Copilot agent mode), and Jenova. Because MCP is a protocol standard rather than a vendor-specific SDK, any future MCP-compatible runtime also gains access to the WhatsApp tool library without changes to the whapi-mcp package.

Is whapi-mcp free to use, and what does a Whapi.Cloud subscription cost?

The whapi-mcp package itself is open source and free to use. You need a Whapi.Cloud API token to use it, which requires a Whapi.Cloud channel subscription. Whapi.Cloud offers a free sandbox environment for testing at panel.whapi.cloud/register. Paid plans are listed at whapi.cloud/price and are priced by channel and usage volume, not per message or per MCP tool call.

How do I find the correct Chat ID format for individuals, groups, and channels?

Chat ID format depends on the message target. For individual contacts, the format is the international phone number followed by @s.whatsapp.net — for example, 14155551234@s.whatsapp.net. For WhatsApp groups, the format is a numeric group ID followed by @g.us. For WhatsApp channels and newsletters, the format is a numeric channel ID followed by @newsletter. Group and channel IDs are numeric strings returned by the Whapi.Cloud API when you query existing groups or channels through the list tools.

What is the difference between whapi-mcp and the Whapi Agent Skill?

whapi-mcp is an MCP server: it exposes WhatsApp API operations as executable tools that AI agents call at runtime. The Whapi Agent Skill is a knowledge layer installed into the agent's context — it provides reference documentation, usage patterns, and an anti-hallucination checklist of parameters and operations that do not exist in the API, preventing agents from generating plausible but broken tool calls. The two work best together: the MCP server handles execution, and the Agent Skill improves tool selection accuracy before any call is made.

Does whapi-mcp require running a backend server or deploying infrastructure?

No. whapi-mcp runs locally via npx — no installation step, no backend deployment, and no server infrastructure required. The API token is stored as a local environment variable in the MCP client's configuration file. Tokens never leave the developer's machine. For team or CI/CD deployments, manage the token through your organization's standard secrets management infrastructure rather than committing it to version control.

How are the WhatsApp tools in whapi-mcp kept up to date when the API changes?

whapi-mcp auto-generates its tool definitions from the Whapi.Cloud OpenAPI specification. When the API is updated — new endpoints added, parameters modified, or response shapes changed — the corresponding tool definitions are regenerated automatically on the next server startup. No manual updates to tool definitions are required. This contrasts with a manually maintained REST integration, where API changes accumulate as schema drift that is only discovered at runtime.


What Is Whapi.Cloud?

About API Provider

Whapi.Cloud is a WhatsApp API provider that gives developers and businesses programmatic access to WhatsApp messaging, group management, channel operations, and automation workflows. The platform operates as a third-party provider outside the Meta Business Solution Provider ecosystem — which enables broader feature access and faster iteration, at the cost of the compliance guarantees that come with the official BSP program.

The platform offers REST API access, the whapi-mcp MCP server, an Agent Skill for AI toolchains, and channel management tools. It is used by development teams building chatbots, automation pipelines, CRM integrations, and AI agent workflows that require WhatsApp as a communication channel.

For detailed documentation on sending messages, managing groups, and configuring webhooks, see the getting started guide in the Whapi.Cloud knowledge base.

Top comments (0)