Twilio
Connect Claude, ChatGPT or Cursor to Twilio via MCP. Read SMS and voice delivery status, search messages, and list incoming numbers.
Example questions
Try asking your AI client
-
Which Twilio messages failed in the last 2 days?
-
Did the SMS to Jack about the outage ever get delivered?
-
Summarize delivery errors from the last hour without showing full numbers.
-
Write a short incident note for Slack - do not send a new SMS.
-
Which incoming numbers received traffic this week?
Overview
Connect Twilio so AI clients can read SMS and voice delivery status, search messages, and list incoming numbers via the Twilio REST API.
This integration is read-first. Sending SMS or placing calls is not included. Use it to confirm whether an alert, OTP, or onboarding message was delivered.
Prerequisites
- A Twilio account
- Account SID and Auth Token from the Account Dashboard, or an API Key SID and secret (or a parent account that can read a subaccount)
- A stackgate.ai account
Getting credentials
- Sign in to the Twilio Console.
- Open the Account Dashboard. Copy Account SID (starts with
AC) and Auth Token. Alternatively, open Account → API keys & tokens, create a key, and copy the API Key SID (starts withSK) plus its secret. - Optional: to scope reads to a subaccount, open Account → Subaccounts and copy that subaccount SID.
- In stackgate.ai, open My Integrations → Twilio.
- Paste Account SID and Auth Token, or API Key SID and secret. Add the subaccount SID only when you want default tools to query that subaccount.
- Save. stackgate.ai verifies the credentials against Twilio and stores secrets encrypted. API Keys are resolved to the Account SID automatically.
- Optionally use Edit tool access to keep the connection read-only.
See the Twilio REST API and Messages resource.
Credentials reference
| Field | Required | Where to find it | Notes |
|---|---|---|---|
| Account SID or API Key SID | Yes | Console Account Dashboard or API keys | Account SID starts with AC. API Key SID starts with SK. |
| Auth Token or API Key secret | Yes | Console Account Dashboard or API keys | Rotate if leaked; stored encrypted |
| Subaccount SID | No | Account → Subaccounts | Parent credentials must be able to read this SID |
Permission model
| Permission / Scope | Why it is needed | Access level |
|---|---|---|
| Account SID + Auth Token | Authenticate REST reads for messages, calls, and numbers | Read |
Twilio does not use OAuth for this connect flow. The Auth Token can read any resource the account owns. Prefer a dedicated subaccount for agent access when possible.
Using with AI clients
- Dedicated endpoint:
POST /mcp/twiliowith a Sanctum bearer token - Private gateway: one config for all integrations - use
twilio__*namespaced tools
Example prompts:
- "List my recent Twilio messages and their delivery status."
- "Search Twilio messages sent to +15551234567 today."
- "Get Twilio message SM123 and tell me if it failed."
- "List incoming Twilio phone numbers."
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| 422 integration not configured | Form not saved | Complete Account SID and Auth Token in My Integrations |
| 401 Unauthorized | Wrong SID or rotated token | Copy current Auth Token from the Console and reconnect |
| Invalid Account SID format | SID missing AC or SK prefix |
Paste the Account SID from the Account Dashboard, or an API Key SID from API keys |
| 404 on a message or call | Wrong SID or wrong account/subaccount | Confirm the SID and optional subaccount |
| 429 Too many requests | Twilio concurrent or burst limits | Retry after a short delay and keep page_size small |
Security and revocation
- Disconnect Twilio in My Integrations to delete the stored SID and token from stackgate.ai.
- Rotate the Auth Token in the Twilio Console if you suspect leakage.
- Phone numbers and message bodies in tool results are PII. Prefer SID and status in Slack or ticket summaries.
- Audit logs record tool names and arguments. Avoid pasting raw numbers into public prompts when a SID is enough.
- stackgate.ai encrypts credentials at rest and does not keep message bodies unless you copy them to Temp Storage.
Limitations
- Read-only MVP: no send SMS, no outbound calls, no webhook management.
- Regional numbers and sender IDs follow your Twilio account and country rules.
- Date filters use the account timezone (
DateSentasYYYY-MM-DD). - List tools default to small pages to limit PII in model context.
Available tools
-
list_messages
List recent Twilio SMS/MMS messages with delivery status. Prefer search_messages when filtering by number or date.
-
get_message
Get one Twilio message by SID, including status, error_code, and timestamps.
-
search_messages
Search Twilio messages by destination, sender, and/or sent date (YYYY-MM-DD).
-
list_calls
List recent Twilio voice calls with status. Optional to/from filters.
-
get_call
Get one Twilio call by SID, including status, duration, and timestamps.
-
list_phone_numbers
List incoming Twilio phone numbers on the connected account or subaccount.
MCP endpoint:
https://stackgate.ai/mcp/twilio
(HTTP) or via the
private gateway.
Related workflows
Multi-integration playbooks that use Twilio to solve concrete business outcomes.