Skip to Content
Developer docsBeta

MCP for AI agents

Let Claude, Cursor, ChatGPT and other AI agents send WhatsApp campaigns through Mawgood, with a preview you approve first.

Mawgood runs a remote MCP server (Model Context Protocol, Streamable HTTP transport). Connect an AI assistant to it and you can ask, in plain words: "Send the order_shipped template to the customers in this sheet" or "How did yesterday's Eid campaign do?".

https://api.mawgood.ai/v1/mcp

It authenticates with the same API key as the REST API, in the same header: Authorization: Bearer mwg_sk_live_… (a secret key; publishable keys are refused). A missing or wrong key answers 401 with WWW-Authenticate: Bearer. OAuth sign-in comes later.

The server is stateless (no session): send JSON-RPC with POST; GET and DELETE answer 405. It identifies itself as mawgood 1.0.0 and gives the agent short instructions (preview first, approved templates only, never invent variable values).

Tools

ToolWhat it doesScope
list_numbersThe WhatsApp numbers you can send from.numbers:read
list_templatesYour templates (approved by default), their category and variables. Filters: name, language, category.templates:read
preview_campaignChecks a send without sending: recipients, credit cost, how long it will take, blockers, and a confirm token.campaigns:send
send_campaignSends a previewed campaign. Needs the confirm token from preview_campaign.campaigns:send
get_campaign_statusA campaign's status and counts.campaigns:read
list_recipientsEach number's status, and why a message failed or was skipped (status filter, cursor, up to 500 a page).campaigns:read
cancel_campaignStops a campaign.campaigns:send

preview_campaign and send_campaign take the same input as POST /campaigns (without the Idempotency-Key). Every result has a short text summary and the same JSON as the REST API in structuredContent. An error comes back as a tool error with the API's code and message (missing_variables, template_not_approved, insufficient_scope…), so the agent can fix the input and try again. The resource mawgood://templates lists the approved templates too.

Preview, then send

An agent can't send in one step. It must call preview_campaign first, which returns everything a person needs to decide (how many will receive it, how many are skipped and why, the credit cost, the duration and anything blocking the send) plus a confirm token. send_campaign only accepts that token, so what's sent is exactly what was previewed.

  • The token is valid for 15 minutes, for the key that previewed and the exact same input. Change anything (a recipient, a value, the name) and send_campaign answers confirm_token_mismatch: preview again.
  • A retried send_campaign never sends twice: its idempotency key is a hash of the input (numbers in E.164, recipients in order), so the same input within 24 hours returns the first campaign (replayed: true). To send the same thing again on purpose, give it another name.
  • Test keys (mwg_sk_test_…) preview everything, but send_campaign answers test_key_cannot_send.

Keep a person in the loop

Let your assistant ask before running send_campaign: don't add it to an "always allow" list. Read the preview, then approve.

Setup

export MAWGOOD_API_KEY=mwg_sk_live_...
claude mcp add --transport http mawgood https://api.mawgood.ai/v1/mcp \
  --header "Authorization: Bearer $MAWGOOD_API_KEY"

Then run /mcp in Claude Code to check mawgood is connected.

Good to know

  • The MCP server follows the same rules as the API: opt-outs always; quiet hours and the frequency cap for marketing templates (utility templates skip them); review mode and credits.
  • Everything an agent sends shows up in Mawgood like any other campaign, and replies go to your Mawgood and your inbox.
  • Give the agent its own key, so you can revoke it alone.

On this page