BroadNet
The JournalEngineering
Engineering

MCP for messaging: how AI agents can send SMS and WhatsApp safely

An MCP server turns a messaging API into tools an AI agent can call. That is powerful and risky: an agent with a send tool can message real customers. Here is how MCP works for SMS and WhatsApp, how to connect to BroadNet's server, and the guardrails to put in place first.

BroadNet Engineering
11 min read
Engineering · Issue 47
11 min read

n MCP server for messaging exposes a messaging API as tools that an AI agent can discover and call through the Model Context Protocol, so an assistant can send an SMS or a WhatsApp message on request. BroadNet runs one at https://mcp.broadnet.me/mcp, using the Streamable HTTP transport and a Bearer token, over the same API that serves WhatsApp, SMS, RCS, Telegram, Push, Email, Messenger and Instagram. This guide explains how it works and, more importantly, how to stop an agent from messaging the wrong people.

Key takeaways

  • MCP is an open protocol, built on JSON-RPC 2.0, that lets AI applications discover and call external tools. A messaging MCP server turns send, template and report endpoints into tools.
  • Remote servers use the Streamable HTTP transport: one HTTPS endpoint, every client message an HTTP POST. Local servers usually use stdio.
  • The BroadNet MCP server is at https://mcp.broadnet.me/mcp and refuses any request without an Authorization: Bearer header.
  • A token is a send credential. The agent acts with its permissions, exactly as your own code would.
  • The MCP specification says there SHOULD always be a human in the loop who can deny tool calls, and that servers MUST rate-limit tool invocations. Build consent, quiet hours, caps and approvals around every send tool.

What is the Model Context Protocol?

The MCP specification describes MCP as "an open protocol that enables seamless integration between LLM applications and external data sources and tools". It uses JSON-RPC 2.0 messages between three roles: hosts (the AI application), clients (connectors inside the host) and servers (services that provide tools, resources and prompts). As of 26 September 2026, the latest revision of the specification is dated 2026-07-28.

Tools are the part that matters for messaging. A client lists them with tools/list, the model chooses one, and the client invokes it with tools/call. The specification calls tools "model-controlled": the model decides when to use them. That is exactly why a send tool needs guardrails the model cannot talk its way around.

How does an MCP server for SMS and WhatsApp work?

The request path has five hops. The design point is that the MCP server adds no new sending power; it exposes the API you already have, under the same token and the same controls.

  1. A user asks the AI host, for example: "send the delivery update to this customer on WhatsApp".
  2. The model picks a tool from the list the MCP client retrieved, such as a WhatsApp send tool, and fills in its arguments.
  3. The MCP client sends a tools/call request as an HTTP POST to https://mcp.broadnet.me/mcp with the Bearer token.
  4. The BroadNet MCP server validates the token and calls the corresponding BroadNet API endpoint.
  5. The API routes the message to WhatsApp or to the mobile network and returns a result, which travels back to the model as the tool result.

In the product team's demo recording, the client lists 380 BroadNet tools, among them send_message, post_sms_send, post_whatsapp_message_send, get_whatsapp_template_list, post_whatsapp_template_send, post_rcs_message_send and get_report_delivery. The exact list depends on the server version and your account; see the MCP server documentation.

Streamable HTTP or stdio: which transport?

The specification defines two standard transports. Which one you use depends on where the server runs, and it decides how you authenticate.

stdioStreamable HTTP
Where the server runsAs a subprocess launched by the client, on the same machineAs an independent service reached over HTTPS
How messages travelNewline-delimited JSON-RPC over standard input and outputEach client message is an HTTP POST to a single MCP endpoint; replies come back as JSON or a server-sent-events stream
How credentials workThe specification says stdio servers should read credentials from the environmentAn Authorization: Bearer header on every request; tokens must never go in the query string
Typical useLocal developer toolsHosted services shared by many clients, such as a messaging API
BroadNetNot offeredhttps://mcp.broadnet.me/mcp

For HTTP servers, the 2025-06-18 revision of the specification also requires servers to validate the Origin header and recommends that they authenticate every connection. The latest revision (2026-07-28) makes each request self-contained, carrying the protocol version and client capabilities in its own metadata; earlier revisions opened a session with an initialize handshake, and clients detect which revision a server speaks and fall back.

How do you connect an AI agent to BroadNet's MCP server?

  1. Get a token from your BroadNet account. In the BroadAdmin portal, Integrations, then MCP Integration, issues a temporary key; a permanent key comes from your account admin or master account.
  2. Add the server to your MCP client. Most clients take a JSON configuration like the one below. Field names vary slightly between clients, so check your client's documentation.
  3. Keep the token out of files you commit. Use your client's environment-variable support, as the configuration below does.
  4. Open the tool list and switch off every tool the agent does not need.
  5. Test with one message to a number you own before you let the agent near customer data.
snippet
{
"mcpServers": {
"broadnet": {
"type": "http",
"url": "https://mcp.broadnet.me/mcp",
"headers": {
"Authorization": "Bearer ${BROADNET_TOKEN}"
}
}
}
}

To test the connection without a client, send the initialize request yourself:

snippet
curl -X POST https://mcp.broadnet.me/mcp \
-H "Authorization: Bearer $BROADNET_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize",
"params":{"protocolVersion":"2025-06-18","capabilities":{},
"clientInfo":{"name":"curl","version":"1.0"}}}'

Without the header, the server refuses the call at the protocol level. This is its actual reply to an unauthenticated initialize request, checked on 26 September 2026:

snippet
event: message
data: {"jsonrpc":"2.0","id":1,"error":{"code":-32001,
"message":"Authorization bearer token is required. Connect with an
'Authorization: Bearer <BroadNet token>' header."}}

Is it safe to give an AI agent a messaging API key?

Only with limits around it. The token is a send credential: anyone, or any agent, holding it can send messages from your account, and every send costs money and reaches a real person. Agents also act on natural-language instructions, and some of that text comes from outside: an inbound customer message or a web page can contain instructions the model may try to follow. The MCP specification is direct about this. It says hosts must obtain explicit user consent before invoking any tool, that there SHOULD always be a human in the loop with the ability to deny tool invocations, and that clients must treat tool annotations as untrusted unless they come from a trusted server.

Which guardrails stop an agent from spamming customers?

Put the controls where the model cannot bypass them: in the client configuration, in your own middleware, or in the account settings, not in the prompt.

RiskControlWhere it lives
Messaging someone who has not opted inCheck consent and opt-out status before any send tool runsYour middleware or CRM
Sending at night or on the wrong dayQuiet hours per recipient time zone and market rulesYour middleware
Using tools the task does not needEnable only the required tools; disable template, onboarding and account toolsMCP client tool settings
Runaway loops and bulk sendsPer-agent send caps and rate limits; the specification requires servers to rate-limit tool invocationsYour middleware and the server
Duplicate messages after a retryKeep the returned message ID and check its status before resendingYour agent logic (see idempotency guide)
Marketing sent without reviewHuman approval for any marketing or multi-recipient sendMCP client confirmation prompts
Instructions hidden in inbound messagesTreat inbound text as data; never let it trigger a send without a user requestPrompt design and approval rules in the AI host
Leaked tokenTemporary keys for experiments, environment variables, revoke and reissue on exposureBroadNet account admin
No audit trailLog every tool call with inputs and resultsMCP client; the specification says clients should log tool usage

The BroadNet API has no idempotency header, so a retry after a timeout can send twice. The safe pattern is to store the message ID the API returns and check delivery status before resending; our idempotency and retries guides show how.

Which messaging actions should need human approval?

ActionSuggested defaultWhy
Read delivery reports, list templatesAutomaticRead-only; nothing reaches a customer
One transactional message to one known customer who asked for itAutomatic within a send cap, or one-click confirmLow risk, high value, easy to audit
Any marketing messageAlways human approvalConsent, content and cost risk
Any send to more than one recipientAlways human approvalA mistake multiplies
Creating or submitting WhatsApp templatesHuman approvalTemplates are reviewed by Meta and represent your brand
Account, billing or onboarding toolsDisabledAn agent should not change the account it runs on

MCP or a plain REST API: which should an agent use?

Both reach the same platform. The difference is who decides which call to make.

BroadNet MCP serverBroadNet REST API
Who chooses the callThe model, from the tool listYour code
Endpointhttps://mcp.broadnet.me/mcphttps://api.broadnet.me, for example POST /sms/sendSms
AuthenticationAuthorization: Bearer tokenAuthorization: Bearer token
Client libraryAny MCP client that supports remote servers and a custom Authorization headerOne official SDK, @broadnet/cpaas-sdk (TypeScript/Node.js); generate other clients from the OpenAPI spec
Best forAssistants, operations copilots, ad-hoc tasks in natural languageProduction flows with fixed logic: OTP, alerts, campaigns

A sensible split: use MCP where a person is steering the agent and a confirmation prompt is acceptable, and use the REST API, with the quickstart and the curl generator, for flows that must run the same way every time. Our API reference documents the endpoints behind the MCP tools.

Frequently asked questions

What is an MCP server for messaging?

A server that exposes a messaging API, such as send SMS, send WhatsApp message or get delivery report, as tools an AI agent can discover and call through the Model Context Protocol.

What is the BroadNet MCP server URL?

https://mcp.broadnet.me/mcp. It uses the MCP Streamable HTTP transport and requires an Authorization: Bearer header with your BroadNet token on every request.

Which AI clients can connect to it?

Any MCP client that can connect to a remote server over Streamable HTTP and send a custom Authorization header. The BroadNet demo recording uses Cursor.

Can the agent send real messages?

Yes. The tools act with your token's permissions, exactly as your own API calls would. Treat every send as real: enable only the tools the agent needs and require confirmation before sends.

How does Bearer authentication work with MCP?

For HTTP transports the client sends Authorization: Bearer followed by the token on every request, even within the same session, and never in the URL query string. BroadNet's server rejects requests without it.

What is the difference between stdio and Streamable HTTP?

stdio runs the server as a local subprocess and exchanges newline-delimited JSON-RPC over standard input and output. Streamable HTTP runs the server as a web service where every client message is an HTTP POST to one endpoint.

How do I stop an AI agent from spamming customers?

Enforce consent checks, quiet hours and send caps outside the model, enable only the tools you need, require human approval for marketing and multi-recipient sends, and log every tool call.

Should I use MCP or the REST API?

Use MCP when a person steers an agent in natural language. Use the REST API or the TypeScript SDK for fixed production flows such as OTP and alerts, where your code, not a model, decides what to send.

Sources

Related reading: AI agents in customer messaging and choosing an enterprise agentic AI platform.

Was this useful?

How we write and review content

Written by

BroadNet Engineering

Engineering operates the wire: SMPP binds, SS7 stacks, routing engines, the boring infrastructure that makes one-billion-message months possible. They write here when something is worth writing down.

The Journal, by email

One essay a month. Nothing else.

Subscribe and we'll send the next piece — engineering, regulation, or industry — the day it ships. No drip campaigns, no product pitches, no third-party sharing. Unsubscribe in one click.

We send one email a month. Unsubscribe anytime. See our privacy policy.

What you'll get
  • Long-form, not link bait
    Six to eleven minutes of focused writing on a single topic.
  • Written by operators
    Engineers, regulatory leads, and product writing in-house.
  • Region-aware
    MENA-grounded view on regulators, operators, and channel mix.
  • Once a month
    No drip campaign. One essay when there is one to share.
Stop reading. Start shipping.

Most of what we write we learned in production.

If this piece made you nod, we should probably talk. Bring the use case, the volumes, the markets — we'll come back with routing, pricing, and a reference customer you can call.

$ curl -X POST https://api.broadnet.me/sms/sendSms