# Twilio MCP

> Twilio MCP Server lets you run your entire communications stack from any AI agent. Send SMS messages, start outbound voice calls, cancel live calls, list call recordings, and audit account usage—all without opening a dashboard or writing boilerplate code.

## Overview
- **Category:** talk-to-me
- **Price:** Free
- **Tags:** sms-messaging, voice-api, telephony, call-tracking, api-governance, billing-analytics

## Description

**Twilio MCP Server - Manage Calls & SMS**

You're gonna run your whole comms stack straight from your AI agent, period. Don't open a dashboard or write some boilerplate code; you just tell it what to do and get the job done. This server gives your agent direct control over every part of your phone system.

**Handling SMS Messaging**

You can send plain text messages instantly using `send_sms` by specifying both the sender ID and the target number. Need to know if that message got through? Use `get_message_details` to pull detailed metadata and status reports for any specific message ID. You'll also get a full history of what you sent or received by running `list_messages`, which displays every SMS message recently handled by your account.

**Controlling Voice Calls**

Want to make an outbound call? Just run `create_voice_call`, giving it the caller ID and the TwiML instructions for how the call should route. If things go sideways or you gotta cut a conversation short, don't sweat it; `cancel_active_call` immediately terminates any live voice chat. You can check out all your recent activity by calling `list_calls`, which shows both inbound and outbound calls along with their status and who they went to. Furthermore, if you wanna review what people said during those chats, `list_recordings` lists every single voice recording stored in your system.

**Auditing Your Comm Logs**

You need a clear picture of everything that happened? You can track down all historical phone calls using `list_calls`, which gives you the status and recipients for both inbound and outbound activity. For texts, running `list_messages` shows every message sent or received, letting you audit your communication history in bulk.

**Account Spending and Setup**

When it comes to money and security, this server keeps you tight. You can pull a precise log of spending using `get_usage_records`, which retrieves comprehensive usage statistics and current billing details for the account. Need to know what your general status is? Run `get_account_info` to get the current state information for your main Twilio account. To keep things secure, you can list every active API key configured with `list_api_keys`.

This setup lets your agent manage everything—sending texts, making and killing calls, tracking down recordings, and auditing all spending records—without ever leaving the conversational flow.

## Tools

### cancel_active_call
Immediately terminates any currently active voice call.

### create_voice_call
Starts an outbound phone call using a specified caller ID and TwiML instructions.

### delete_message
The message body becomes inaccessible after deletion. This action is irreversible.

Permanently delete an SMS message record

### get_account_info
Retrieves the current status information for your main Twilio account.

### get_message_details
Gathers detailed metadata and status reports for a specific SMS message ID.

### get_recording_details
Requires the recording SID (starting with RE).

Get detailed information about a specific call recording

### get_usage_records
Retrieves comprehensive usage statistics and current billing records for the account.

### list_api_keys
Provides a list of all API keys configured within your Twilio account.

### list_call_queues
List all call queues configured for the account

### list_calls
Lists recent outbound and inbound voice calls, including their status and recipients.

### list_messages
Displays a list of all SMS messages that have been recently sent or received by the account.

### list_phone_numbers
List all incoming phone numbers owned by the account

### list_recordings
Lists all voice recordings stored in your Twilio ecosystem.

### lookup_phone_number
Provide the number in E.164 format.

Look up information about a phone number

### send_sms
Sends an SMS message using a specified sender and target receiver number.

## Prompt Examples

**Prompt:** 
```
Send an SMS to +14155552671 from my main number saying 'Server 3 is down, investigate ASAP'.
```

**Response:** 
```
The SMS has been successfully dispatched. The Message SID is SMxyz123 and the current status is 'queued'. I can check back in a minute to confirm delivery.
```

**Prompt:** 
```
List my recent phone calls and tell me if any failed.
```

**Response:** 
```
I've retrieved 15 recent calls. 14 completed successfully. One call (SID CAabc456) has the status 'failed' to +15551234. Would you like to view the error details?
```

**Prompt:** 
```
Show me our Twilio usage statistics to help understand our bill.
```

**Response:** 
```
Accessing usage records... So far, your heaviest consumption comes from SMS outbound ($45.00 total over 4,500 messages). Voice minutes account for $12.30. Should I break down the voice categories further?
```

## Capabilities

### Manage SMS Messaging
Send plain text messages and retrieve detailed metadata, including delivery status.

### Initiate Voice Calls
Start outbound phone calls using specific TwiML instructions for call routing.

### Control Live Calls
Immediately terminate an active voice call, even if it’s stuck or failed.

### Audit Communication Logs
List recent SMS messages and track all historical outbound and inbound calls.

### Review Account Spending
Pull usage statistics and billing records to keep a precise log of spending.

## Use Cases

### Incident Alerting
A DevOps engineer notices a server failure. Instead of manually logging into the console and sending multiple alerts, they prompt their agent: 'Send an SMS to the on-call team with the alert details.' The agent uses `send_sms` to dispatch the message instantly, keeping communication fast and reliable.

### Customer Support Review
A support manager needs to check a customer's history. They ask their agent to 'List recent calls for this user.' The agent uses `list_calls` to pull the data, allowing the manager to see if previous interactions were successful or if there was an error.

### Billing Reconciliation
The founder needs to prove spending limits were met. They prompt their agent: 'Show me last month's usage stats.' The agent runs `get_usage_records`, providing immediate, accurate figures that can be attached directly to a report.

### Testing Outbound Flows
An engineer wants to test if a new automated call sequence works. They prompt the agent: 'Create a sample outbound call pointing to this TwiML URL.' The agent uses `create_voice_call` to execute the logic for testing before committing it to production.

## Benefits

- Stop context switching. Instead of jumping between the Twilio console, a dashboard, and your code editor, you run all comms operations through a single prompt to your AI client.
- Instant operational visibility. Use `list_calls` or `list_messages` to get an immediate summary of recent activity, letting you spot failures or missed messages instantly.
- Control spending and security. Quickly audit keys with `list_api_keys` and review exact costs using `get_usage_records`. You know exactly what your comms stack is costing you.
- Crisis management on demand. If a call gets stuck or fails, use `cancel_active_call` to shut it down immediately without needing manual intervention.
- Full lifecycle tracking. Beyond just sending, use `get_message_details` to see if that SMS was delivered, failed, or is still queued for delivery.

## How It Works

The bottom line is that your AI client becomes a programmable communication center, letting you run comms ops without switching tabs.

1. Subscribe to this server using your Twilio credentials (Account SID and Auth Token).
2. Your AI agent accesses the necessary communication tools via the Model Context Protocol.
3. You simply prompt your agent—e.g., 'Send an SMS to 555-1234 saying X'—and it executes the action.

## Frequently Asked Questions

**How do I check if a specific SMS message was delivered using get_message_details?**
You pass the Message SID to `get_message_details`. The tool returns detailed metadata that confirms the delivery status (e.g., 'delivered', 'failed', or 'queued').

**Can I list all my recent calls using list_calls?**
Yes, `list_calls` pulls a record of your most recent voice interactions. You can check the status and recipient numbers right in the results.

**What is the best way to audit my API keys with list_api_keys?**
Use `list_api_keys`. This tool provides a clear, actionable list of every key configured on your account, helping you spot old or unused credentials.

**I need to send an urgent message; should I use send_sms?**
Yes, `send_sms` is the tool for this. You just provide the E.164 sender and target numbers, and it dispatches the text immediately.

**Can I get my usage statistics with get_usage_records?**
Absolutely. `get_usage_records` pulls your billing data and usage stats into a readable format, helping you understand where your money is going.

**If a call needs to be terminated immediately, how do I use the `cancel_active_call` tool?**
The `cancel_active_call` tool terminates an active voice connection instantly. This is useful for stopping misdirected or stuck calls before they run their course.

**After using `list_recordings`, how do I actually play back the audio file?**
The `list_recordings` tool provides a direct play URL for each stored voice recording. You use this specific URI to retrieve and listen to the full conversation transcript.

**How can I view my entire history of SMS messages using `list_messages`?**
`list_messages` provides a comprehensive list of all recent texts, whether you sent them or received them. This allows you to quickly review the sender, receiver, and timestamps for every message.

**Can my AI agent trigger an incident alert SMS to the on-call engineer?**
Absolutely. You can provide your Twilio phone number, the destination E.164 number, and the alert body text. The agent will hit the Twilio API instantly, dispatch the SMS, and return the Message SID along with delivery status.

**How can I stop a rogue voice call stuck in a loop?**
Ask your agent to list active or recent voice calls and find the offending Call SID. Then instruct the AI to cancel the active call by its ID. The agent updates its status to 'canceled', dropping the connection right away.

**Can it check how much my company has spent so far this month?**
Yes. Ask the agent to pull your account's usage records. It interfaces with the Twilio billing records and can display breakdowns of amounts sent, call durations, and costs incurred, giving you full transparency without opening the dashboard.