FlowTruxFlowTrux/Docs

Twilio MCP Server

Send SMS and WhatsApp messages and make voice calls through Twilio from workflows

The Twilio MCP server lets your workflows send SMS and WhatsApp messages, make voice calls with TwiML, check delivery and list WhatsApp templates. It provides 7 tools.

Setup

  1. Sign up at twilio.com and copy your Account SID and Auth Token from the Twilio Console.
  2. Go to Resources > MCP Servers > Add Server (OWNER or ADMIN).
  3. Choose Twilio (SMS / WhatsApp / Calls).
  4. Give it a Name and fill in:
FieldRequiredDescription
Account SIDYesStarts with AC
Auth TokenYesYour Twilio Auth Token
From NumberNoDefault sender, a Twilio number in E.164 format (e.g., +14155551234)
  1. Under Available in workspaces, pick the workspaces, then click Add Server.

Phone numbers are always E.164: a leading +, the country code, no spaces or dashes. The sender must be a number your Twilio account owns - the configured From Number or a per-call from.

Business SMS to US numbers requires A2P 10DLC registration in Twilio; without it, messages are not delivered.

WhatsApp: templates outside the 24-hour window

WhatsApp decides by who wrote last:

  • Within 24 hours after the recipient wrote to you, send_whatsapp can send any text in body.
  • Otherwise - which includes every notification your workflow starts on its own - free text is accepted by Twilio (you even get a message SID) but never delivered. You must send an approved Content Template: content_sid plus content_variables for its placeholders.

So for notifications:

  1. Create the template and submit it for approval in the Twilio Console (no tool can create or approve one).
  2. Call list_content_templates and pick a template whose usable is true.
  3. Pass its sid as content_sid to send_whatsapp.

The template's category sets the price: utility and authentication templates cost far less than marketing ones. media_url works only for free-form messages; a template carries its own media. For the full picture, see Twilio's WhatsApp documentation.

Tools

send_sms

Send an SMS message via Twilio.

ParameterTypeRequiredDescription
tostringYesRecipient phone number in E.164 format (e.g., +14155551234)
bodystringYesSMS message body (max 1600 characters)
fromstringNoSender number. Defaults to the server's From Number.

send_whatsapp

Send a WhatsApp message. Free-form body is delivered only inside an open 24-hour window; messages you start yourself need content_sid - an approved Content Template. The whatsapp: prefix is added to the numbers for you.

ParameterTypeRequiredDescription
tostringYesRecipient phone number in E.164 format (e.g., +14155551234)
bodystringNoFree-form message body. Delivered only inside an open 24h window (recipient wrote recently). Provide either body or content_sid.
content_sidstringNoTwilio Content Template SID (HX…) of an approved template — required for business-initiated messages outside the 24h window. Provide either content_sid or body.
content_variablesobjectNoTemplate placeholder values keyed by name/index, e.g. {"1": "Denis", "2": "tomorrow 10:00"}. Only used with content_sid.
fromstringNoWhatsApp sender number. Defaults to the server's From Number.
media_urlstringNoURL of media to attach (image, PDF, etc.). Free-form mode only.

list_content_templates

List the WhatsApp Content Templates of this Twilio account with their approval status, SID and placeholder names. Use it before send_whatsapp whenever the recipient has not written in the last 24 hours. Reads templates only; it cannot create or approve them.

ParameterTypeRequiredDescription
name_containsstringNoCase-insensitive substring filter on the template's friendly name.
approved_onlybooleanNoReturn only approved templates. Default false - unapproved ones are listed with usable: false, so you can tell "missing" from "not approved yet".
page_sizenumberNoTemplates per page (1-100, default 50).

make_call

Make a phone call via Twilio using TwiML for call instructions.

ParameterTypeRequiredDescription
tostringYesRecipient phone number in E.164 format.
twimlstringYesTwiML instructions for the call (e.g., '<Response><Say>Hello!</Say></Response>')
fromstringNoCaller number. Defaults to the server's From Number.
timeoutnumberNoSeconds to wait for answer (default: 30, max: 600)

get_message_status

Check the delivery status of a sent message by its SID. An undelivered message is a normal answer: status failed or undelivered with errorCode and errorMessage. An unknown SID fails the call.

ParameterTypeRequiredDescription
message_sidstringYesMessage SID (returned from send_sms or send_whatsapp)

list_messages

List recent messages (sent and received)

ParameterTypeRequiredDescription
tostringNoFilter by recipient number.
fromstringNoFilter by sender number.
limitnumberNoMax messages to return (default: 20, max: 100)

get_account_info

Get Twilio account information and balance.

No parameters.

Errors and Delivery

  • A request Twilio refuses (invalid number, bad credentials, a sender you do not own) fails the step with Twilio error <code>: <message>.
  • A message Twilio accepted is not proof of delivery. Use get_message_status with the returned SID: a message that could not be delivered comes back with status failed or undelivered and an errorCode / errorMessage (for example 30007).
  • An SMS body is plain text, up to 1600 characters. Longer texts are split by the carrier into segments that may arrive out of order.

Example Workflow

An alert routed by severity:

  1. Trigger - Webhook receives an alert from a monitoring system.
  2. Logic - Switch on {{trigger.data.severity}}:
    • critical - twilio:make_call with TwiML such as <Response><Say>Critical alert on the payment service.</Say></Response>.
    • high - twilio:send_sms with the alert text.
    • medium - twilio:send_whatsapp with an approved template (content_sid) and the alert fields in content_variables.