Twilio MCP Server
Enables communication through Twilio's API including sending SMS/WhatsApp messages, making phone calls, and managing phone numbers and account settings. Provides comprehensive messaging and voice capabilities with proper authentication and rate limiting.
README
Twilio MCP Server
MCP server for interacting with the Twilio communication API. Send SMS and WhatsApp messages, make phone calls, and manage your Twilio account.
Features
- SMS Messaging: Send and manage SMS/MMS messages
- WhatsApp Messaging: Send WhatsApp messages via Twilio
- Voice Calls: Initiate and manage phone calls
- Phone Number Management: List and lookup phone numbers
- Account Management: Check balance and account status
Setup
Prerequisites
- Twilio account (sign up at twilio.com)
- Twilio phone number (for sending SMS/calls)
- Account credentials from Twilio Console
Environment Variables
TWILIO_ACCOUNT_SID(required): Your Twilio Account SIDTWILIO_AUTH_TOKEN(required): Your Twilio Auth Token
How to get credentials:
- Go to console.twilio.com
- Find your Account SID and Auth Token in the dashboard
- Keep these secure - they provide full access to your Twilio account
Available Tools
Messaging Tools
send_sms
Send an SMS message.
Parameters:
to(string, required): Recipient phone number in E.164 format (e.g., +1234567890)from_(string, required): Your Twilio phone number in E.164 formatbody(string, required): Message content (up to 1600 characters)media_url(string, optional): URL of media to send (converts to MMS)
Example:
result = await send_sms(
to="+1234567890",
from_="+1987654321",
body="Hello from Twilio MCP!",
media_url="https://example.com/image.jpg"
)
send_whatsapp
Send a WhatsApp message via Twilio.
Parameters:
to(string, required): Recipient WhatsApp number (e.g., whatsapp:+1234567890)from_(string, required): Your Twilio WhatsApp number (e.g., whatsapp:+1987654321)body(string, required): Message contentmedia_url(string, optional): URL of media to send
Example:
result = await send_whatsapp(
to="whatsapp:+1234567890",
from_="whatsapp:+1987654321",
body="Hello from WhatsApp!",
media_url="https://example.com/image.jpg"
)
list_messages
List sent and received messages with optional filters.
Parameters:
to(string, optional): Filter by recipient phone numberfrom_(string, optional): Filter by sender phone numberdate_sent(string, optional): Filter by date in YYYY-MM-DD formatpage_size(int, optional): Number of results (default: 50, max: 1000)
Example:
messages = await list_messages(from_="+1987654321", page_size=20)
get_message
Get details of a specific message.
Parameters:
message_sid(string, required): The Twilio message SID (e.g., SMxxxxx)
Example:
message = await get_message(message_sid="SM1234567890abcdef")
Voice Call Tools
make_call
Initiate an outbound phone call.
Parameters:
to(string, required): Recipient phone number in E.164 formatfrom_(string, required): Your Twilio phone number in E.164 formaturl(string, required): URL that returns TwiML instructions for the callmethod(string, optional): HTTP method (GET or POST, default: POST)status_callback(string, optional): URL for call status updates
Example:
call = await make_call(
to="+1234567890",
from_="+1987654321",
url="https://example.com/twiml",
status_callback="https://example.com/status"
)
list_calls
List call logs with optional filters.
Parameters:
to(string, optional): Filter by recipient phone numberfrom_(string, optional): Filter by caller phone numberstatus(string, optional): Filter by status (queued, ringing, in-progress, completed, etc.)page_size(int, optional): Number of results (default: 50, max: 1000)
Example:
calls = await list_calls(status="completed", page_size=10)
get_call
Get details of a specific call.
Parameters:
call_sid(string, required): The Twilio call SID (e.g., CAxxxxx)
Example:
call = await get_call(call_sid="CA1234567890abcdef")
Account & Phone Number Tools
get_account_balance
Get your current Twilio account balance.
Example:
balance = await get_account_balance()
# Returns: {"balance": "100.00", "currency": "USD"}
list_phone_numbers
List phone numbers owned by your Twilio account.
Parameters:
page_size(int, optional): Number of results (default: 50, max: 1000)phone_number(string, optional): Filter by specific phone numberfriendly_name(string, optional): Filter by friendly name
Example:
numbers = await list_phone_numbers(page_size=10)
lookup_phone_number
Validate and get information about a phone number.
Parameters:
phone_number(string, required): Phone number to lookup in E.164 formatcountry_code(string, optional): ISO country code if using national format (e.g., 'US')type_(string, optional): Additional data ('carrier' or 'caller-name')
Example:
info = await lookup_phone_number(
phone_number="+1234567890",
type_="carrier"
)
Phone Number Format
All phone numbers must be in E.164 format:
- Start with
+followed by country code - Example US number:
+14155552671 - Example UK number:
+442071838750
Rate Limits and Pricing
Rate Limits
- SMS: 100 messages per second per account (contact Twilio to increase)
- Voice: 100 concurrent calls per account (contact Twilio to increase)
- API Requests: 10,000 requests per second
Pricing (as of 2024, subject to change)
- SMS (US): $0.0079 per message
- WhatsApp: $0.005 per conversation (first 1,000 free monthly)
- Voice (US): $0.0140 per minute
- Phone Number: $1.15 per month
- Lookup API: $0.005 per request (carrier info extra)
Visit Twilio Pricing for current rates.
Security Best Practices
- Never commit credentials: Keep
TWILIO_ACCOUNT_SIDandTWILIO_AUTH_TOKENin environment variables - Use API keys: Consider using Twilio API Keys for additional security
- Enable IP filtering: Restrict API access to specific IP addresses in Twilio Console
- Monitor usage: Set up usage alerts in Twilio Console to detect unusual activity
- Rotate credentials: Periodically rotate your Auth Token
- Use test credentials: Use test credentials for development (prefix with
ACfor test accounts)
TwiML Resources
For making calls with make_call, you need a URL that returns TwiML (Twilio Markup Language):
Simple TwiML example:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hello! This is a call from Twilio.</Say>
</Response>
Learn more about TwiML at twilio.com/docs/voice/twiml
API Documentation
For detailed information about the Twilio API:
Error Handling
Common errors and solutions:
- 21211: Invalid phone number - Ensure E.164 format
- 21608: Unverified number - Verify trial account numbers in Console
- 21610: Message blocked - Check compliance and opt-in requirements
- 20003: Authentication error - Verify credentials are correct
- 20429: Rate limit exceeded - Implement exponential backoff
Support
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.