Provides tools for sending, receiving, and scheduling SMS and MMS messages, managing conversation threads, and retrieving Twilio account and phone number information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Twilio SMS MCP ServerSend a text to +12025551234 asking if they're free for lunch today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Twilio SMS MCP Server
Production-grade Model Context Protocol server for Twilio SMS.
Send, receive, schedule, redact, and inspect SMS/MMS conversations through any MCP-compatible client — VS Code Copilot, Codex CLI, Claude Desktop, and more.
Features
Tools (16)
Tool | Description |
| Send a single SMS or MMS |
| Send the same message to up to 100 recipients with bounded concurrency |
| Schedule a message for future delivery (requires Messaging Service) |
| Cancel a scheduled message |
| List outbound messages with optional filters |
| Fetch one message by SID, enriched with delivery status |
| Delete a message record from Twilio |
| NEW — Redact message body for GDPR / privacy compliance |
| List inbound webhook-captured messages |
| Merge local inbox with Twilio history for a full thread |
| Mark inbox messages as read |
| List Twilio phone numbers on the account |
| Carrier and line-type intelligence lookup |
| NEW — Validate any phone string and return E.164 + national format |
| NEW — Daily SMS/MMS usage and cost analytics |
| Account balance, status, and metadata |
Resources
URI | Description |
| High-level account summary (SID, sender, version) |
Prompts
Prompt | Description |
| AI-assisted SMS drafting given a recipient and topic |
| Summarize all messages exchanged with a number |
Production Hardening
Retry with exponential backoff on transient Twilio API errors (429, 5xx, network failures)
Webhook rate limiting — in-memory per-IP throttle (120 req/min)
Structured logging — timestamped, leveled, consistent format on stderr
Input validation — Pydantic v2 strict schemas with E.164, SID pattern enforcement
Webhook signature verification — Twilio
RequestValidatoron all inbound hooksHealth and readiness endpoints —
/healthz,/readyzfor orchestratorsDocker multi-stage build with non-root user, health checks, persistent volume
py.typedmarker for downstream type-checker compatibility
Requirements
Python 3.11+
A Twilio account and a Twilio phone number
For scheduled messages: a Twilio Messaging Service SID
For inbound messages: a publicly reachable webhook URL
Docker Desktop (optional, for container deployment)
Quick Start
cp env.example .env # fill in your Twilio credentials; for local runs set TWILIO_DB_PATH=inbox.db
pip install -e ".[dev]"
pytest # run the test suite
python -m twilio_sms_mcp.boot # start MCP + webhook serverClient Configuration
VS Code (GitHub Copilot / Copilot Chat)
Add to your VS Code settings.json or .vscode/mcp.json:
{
"mcp": {
"servers": {
"twilio-sms": {
"command": "python",
"args": ["-m", "twilio_sms_mcp.boot"],
"env": {
"TWILIO_ACCOUNT_SID": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"TWILIO_AUTH_TOKEN": "your_auth_token_here",
"TWILIO_FROM_NUMBER": "+12025551234"
}
}
}
}
}Claude Desktop
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"twilio-sms": {
"command": "python",
"args": ["-m", "twilio_sms_mcp.boot"],
"env": {
"TWILIO_ACCOUNT_SID": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"TWILIO_AUTH_TOKEN": "your_auth_token_here",
"TWILIO_FROM_NUMBER": "+12025551234"
}
}
}
}Codex CLI
codex mcp add twilio-sms \
-- docker run --rm -i \
--env-file .env \
-p 8080:8080 \
-v twilio_sms_data:/data \
twilio-sms-mcpVerify:
codex mcp get twilio-sms
codex mcp listDocker
Build and run:
docker build -t twilio-sms-mcp .
docker run --rm -i \
--env-file .env \
-p 8080:8080 \
-v twilio_sms_data:/data \
twilio-sms-mcpOr use Docker Compose:
docker compose up -dWebhook Notes
Configure Twilio to POST to
<your-host>/webhook/smsfor inbound messages.Configure Twilio to POST to
<your-host>/webhook/statusfor delivery callbacks.Set
TWILIO_PUBLIC_WEBHOOK_BASE_URLwhen behind a reverse proxy or ngrok.Keep
TWILIO_VALIDATE_WEBHOOK_SIGNATURES=truein production.
Environment Variables
Variable | Required | Default | Description |
| Yes | — | Twilio Account SID (starts with |
| Yes | — | Twilio Auth Token |
| Yes | — | Default sender in E.164 format |
| No | — | Required for |
| No | — | Override for webhook signature validation |
| No | — | Public URL for webhook signature validation |
| No |
| Disable only for local debugging |
| No |
| Max parallel sends for |
| No |
| Logging verbosity |
| No |
| SQLite database location |
| No |
| Webhook HTTP server port |
| No |
| Retry count for transient API errors |
| No |
| Base delay in seconds between retries |
| No |
| MCP transport: |
| No |
| Bind address for SSE/HTTP transport |
| No |
| Port for SSE/HTTP transport |
Testing
pip install -e ".[dev]"
pytest -vProduction Checklist
Use HTTPS for webhook delivery
Set
TWILIO_VALIDATE_WEBHOOK_SIGNATURES=trueUse a Messaging Service SID for sender pooling and scheduled messages
Persist
/datavolume so inbox state survives restartsNever commit
.env— it is excluded via.gitignoreand.dockerignoreMonitor
/healthzand/readyzfrom your orchestratorSet
TWILIO_LOG_LEVEL=WARNINGin high-traffic environments
License
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.