# @busybee/twilio-mcp **The Twilio MCP that doesn't suck.** [![npm version](https://img.shields.io/npm/v/@busybee/twilio-mcp.svg)](https://www.npmjs.com/package/@busybee/twilio-mcp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![MCP Protocol](https://img.shields.io/badge/MCP-1.0-blue.svg)](https://modelcontextprotocol.io) A workflow-first Twilio integration for the Model Context Protocol (MCP). Built for Claude and other AI assistants that actually understand what you're trying to do โ€” not just dump 400+ raw API endpoints in your context window. --- ## ๐Ÿ”ฅ Why This Exists Twilio's official MCP (`@twilio-alpha/mcp`) is auto-generated from OpenAPI specs. It dumps **400+ raw API endpoints** as individual tools, requires manual `--services` filtering just to be usable, burns through your context window, and has zero understanding of actual workflows. **We built the alternative.** Instead of raw CRUD, we give you **compound workflow tools** like `twilio_campaign_launch`, `twilio_build_ivr`, and `twilio_number_hunt` โ€” tools that actually do things. We lazy-load only what you need. We ship **17 rich HTML dashboards** (MCP Apps) for visual exploration. And we annotate every tool with safety tiers so your AI knows what's safe to run autonomously. This is the Twilio MCP for people who want to *ship*, not wrestle with API docs. --- ## ๐Ÿ†š How We Stack Up | Feature | Official Twilio MCP | **This MCP** | |---------|---------------------|--------------| | **Tool philosophy** | Raw API endpoints (1:1 OpenAPI mapping) | Workflow-oriented compound tools | | **Default tool count** | 400+ (requires `--services` filtering) | 5 always-loaded + lazy packs | | **Context efficiency** | 28.5% more cache reads *(their own benchmark)* | Minimal โ€” only loads what you need | | **Visual UI** | None | **17 MCP Apps** with rich HTML dashboards | | **Tool safety** | No hints, no annotations | **Green/Yellow/Red safety tiers** with cost/destructive annotations | | **Lazy loading** | Nope โ€” all or manually filtered | **Auto-detects intent** and loads packs on-demand | | **Workflow awareness** | Zero | Built-in: campaigns, IVRs, number provisioning, compliance flows | --- ## ๐Ÿš€ Quick Start ### 1. Install via npx (no installation needed) ```bash npx @busybee/twilio-mcp ``` Or install globally: ```bash npm install -g @busybee/twilio-mcp ``` ### 2. Configure Claude Desktop Add to your `claude_desktop_config.json`: ```json { "mcpServers": { "twilio": { "command": "npx", "args": [ "-y", "@busybee/twilio-mcp" ], "env": { "TWILIO_ACCOUNT_SID": "your_account_sid", "TWILIO_API_KEY": "your_api_key", "TWILIO_API_SECRET": "your_api_secret" } } } } ``` **Where to get credentials:** - **Account SID**: [Twilio Console](https://console.twilio.com) (visible on dashboard) - **API Key/Secret**: [Create an API Key](https://console.twilio.com/account/keys-credentials/api-keys) (recommended for security) ### 3. Restart Claude and go Say things like: - *"Show me my Twilio dashboard"* - *"Send an SMS to +15551234567 saying 'Hello from Claude!'"* - *"What messaging tools are available?"* - *"Launch an SMS campaign to these 50 numbers"* - *"Build an IVR for customer support"* --- ## ๐Ÿ“ฆ Tool Catalog ### ๐ŸŸข Tier 1 โ€” Always Loaded (5 tools) These load instantly on startup. They help you navigate, send quick messages, and explore the rest. | Tool | Type | Description | |------|------|-------------| | `twilio_explore` | ๐ŸŽฏ Navigator | Discover available packs and load them on-demand. Your gateway to everything. | | `twilio_dashboard` | ๐Ÿ“Š **MCP App** | Visual dashboard of your account: balance, usage, message/call stats, active numbers. | | `twilio_quick_send` | ๐Ÿ“ฑ Messaging | Send an SMS/MMS/WhatsApp message. Auto-validates numbers and picks a sender. | | `twilio_quick_call` | ๐Ÿ“ž Voice | Place an outbound call. Say a message, connect to another number, or record. | | `twilio_lookup` | ๐Ÿ” Intelligence | Get phone number intel: validation, carrier, line type, caller name (3 depth levels). | **Example:** ``` > twilio_dashboard ``` โ†’ Renders a beautiful HTML dashboard with your balance, active numbers, recent message/call activity. --- ### ๐Ÿ“ฑ Messaging Pack (6 tools) **Load with:** `twilio_explore category=messaging` (or ask for "SMS campaign" / "WhatsApp" / etc.) | Tool | Type | Description | |------|------|-------------| | `twilio_campaign_launch` | ๐Ÿš€ **MCP App** | Launch a bulk SMS/MMS campaign to a list of numbers with throttling and retry. | | `twilio_conversation_thread` | ๐Ÿ’ฌ **MCP App** | View an SMS conversation thread with someone as a rich chat UI. | | `twilio_template_create` | ๐Ÿ“ Workflow | Create a reusable message template with variables (e.g., "Hi {{name}}!"). | | `twilio_auto_responder` | ๐Ÿค– Workflow | Set up keyword-based auto-replies (e.g., reply "HOURS" โ†’ "We're open 9-5"). | | `twilio_schedule_message` | โฐ Workflow | Schedule a message to send at a specific time (using Messaging Services). | | `twilio_message_log` | ๐Ÿ“‹ **MCP App** | Visual log of recent messages with filters, status badges, and sparklines. | **Use case:** *"Launch a campaign to these 100 customers reminding them about the sale"* โ†’ auto-loads messaging pack, uses `twilio_campaign_launch`. --- ### ๐Ÿ“ž Voice Pack (7 tools) **Load with:** `twilio_explore category=voice` | Tool | Type | Description | |------|------|-------------| | `twilio_build_ivr` | ๐ŸŒณ **MCP App** | Build an interactive voice response (IVR) phone tree with menu options and routing. | | `twilio_call_blast` | ๐Ÿ“ฃ Workflow | Place simultaneous calls to a list (announcements, alerts, political campaigns). | | `twilio_record_greeting` | ๐ŸŽ™๏ธ Workflow | Record or generate a voice greeting for voicemail/IVR. | | `twilio_voicemail_box` | ๐Ÿ“ฅ **MCP App** | Set up a voicemail system with transcription and notifications. | | `twilio_conference_room` | ๐ŸŽค Workflow | Create a conference call room with PIN, recording, hold music. | | `twilio_call_analytics` | ๐Ÿ“Š **MCP App** | Visual analytics dashboard for call volume, duration, outcomes. | | `twilio_call_transcribe` | ๐Ÿ“ Workflow | Transcribe a recorded call using Twilio's speech-to-text. | **Use case:** *"Build an IVR for our support line โ€” press 1 for sales, 2 for support"* โ†’ auto-loads voice pack, uses `twilio_build_ivr`. --- ### ๐Ÿ” Number Intelligence Pack (4 tools) **Load with:** `twilio_explore category=intelligence` | Tool | Type | Description | |------|------|-------------| | `twilio_deep_scan` | ๐Ÿ•ต๏ธ **MCP App** | Deep intelligence scan: fraud score, sim swap risk, caller reputation, everything. | | `twilio_fraud_check` | โš ๏ธ Workflow | Quick fraud/scam check on a number before calling or messaging. | | `twilio_number_validate_batch` | โœ… Workflow | Validate a list of phone numbers in bulk (check format, carrier, line type). | | `twilio_identity_verify` | ๐Ÿ†” Workflow | Verify someone's identity by cross-checking number ownership and reputation. | **Use case:** *"Is this number safe to call? Check for fraud"* โ†’ auto-loads intelligence pack, runs `twilio_fraud_check`. --- ### ๐Ÿ” Verify & Security Pack (4 tools) **Load with:** `twilio_explore category=verify` | Tool | Type | Description | |------|------|-------------| | `twilio_otp_send` | ๐Ÿ”‘ Workflow | Send a one-time passcode (OTP) via SMS or voice for 2FA. | | `twilio_otp_check` | โœ… Workflow | Verify an OTP that a user entered. | | `twilio_auth_flow_setup` | ๐Ÿ” **MCP App** | Set up a complete 2FA flow for your app (send + verify + retry logic). | | `twilio_silent_network_auth` | ๐Ÿ“ก Workflow | Silent Network Authentication (SNA) โ€” verify a phone without sending a code. | **Use case:** *"Send a 2FA code to this user"* โ†’ auto-loads verify pack, uses `twilio_otp_send`. --- ### ๐Ÿ“ž Phone Numbers Pack (5 tools) **Load with:** `twilio_explore category=numbers` | Tool | Type | Description | |------|------|-------------| | `twilio_number_hunt` | ๐ŸŽฏ **MCP App** | Search available numbers by area code, pattern, or features (toll-free, SMS, voice). | | `twilio_number_provision` | ๐Ÿ›’ Workflow | Buy a phone number (with confirmation prompt). | | `twilio_number_inventory` | ๐Ÿ“‹ **MCP App** | Visual inventory of your owned numbers with usage stats and capabilities. | | `twilio_number_configure` | โš™๏ธ Workflow | Configure a number's webhooks, friendly name, voice URL, SMS URL. | | `twilio_number_release` | ๐Ÿ—‘๏ธ Workflow | Release (delete) a phone number you no longer need. ๐Ÿ”ด **Destructive!** | **Use case:** *"Find me a 415 area code number with SMS"* โ†’ auto-loads numbers pack, uses `twilio_number_hunt`. --- ### ๐ŸŽจ Studio & Automation Pack (5 tools) **Load with:** `twilio_explore category=studio` | Tool | Type | Description | |------|------|-------------| | `twilio_flow_create` | ๐ŸŒŠ Workflow | Create a Twilio Studio flow from a JSON definition or natural language. | | `twilio_flow_list` | ๐Ÿ“‹ Workflow | List all Studio flows in your account. | | `twilio_flow_execute` | โ–ถ๏ธ Workflow | Trigger a Studio flow execution with parameters. | | `twilio_flow_diagram` | ๐Ÿ—บ๏ธ **MCP App** | Visualize a Studio flow as a diagram. | | `twilio_webhook_wizard` | ๐Ÿช„ Workflow | Generate TwiML or webhook code for common scenarios (auto-reply, forward, etc.). | **Use case:** *"Show me all my Studio flows"* โ†’ auto-loads studio pack, uses `twilio_flow_list`. --- ### ๐Ÿ“ž Contact Center Pack (5 tools) **Load with:** `twilio_explore category=contact-center` | Tool | Type | Description | |------|------|-------------| | `twilio_contact_center_setup` | ๐Ÿข **MCP App** | Set up a complete contact center: queues, workers, workflows, routing. | | `twilio_agent_status` | ๐Ÿ‘ค **MCP App** | View agent availability, active tasks, real-time status dashboard. | | `twilio_queue_manager` | ๐Ÿ“Š **MCP App** | Manage call queues: see wait times, abandon rates, queue depth. | | `twilio_route_call` | ๐Ÿ”€ Workflow | Route an incoming call to the best available agent based on skills/priority. | | `twilio_shift_schedule` | ๐Ÿ“… Workflow | Set up agent shifts and availability schedules. | **Use case:** *"Show me agent status"* โ†’ auto-loads contact-center pack, uses `twilio_agent_status`. --- ### ๐Ÿ’ฌ Conversations Pack (3 tools) **Load with:** `twilio_explore category=conversations` | Tool | Type | Description | |------|------|-------------| | `twilio_inbox` | ๐Ÿ“ฌ **MCP App** | Unified inbox view: all SMS, WhatsApp, chat messages in one dashboard. | | `twilio_conversation_create` | โž• Workflow | Create a multi-participant conversation (group chat). | | `twilio_omnichannel_send` | ๐Ÿ“ค Workflow | Send a message via any channel (SMS, WhatsApp, Messenger, etc.) from one tool. | **Use case:** *"Show me my inbox"* โ†’ auto-loads conversations pack, uses `twilio_inbox`. --- ### ๐Ÿ“Š Analytics Pack (4 tools) **Load with:** `twilio_explore category=analytics` | Tool | Type | Description | |------|------|-------------| | `twilio_cost_report` | ๐Ÿ’ฐ **MCP App** | Cost breakdown by service, date range, with spending trends and alerts. | | `twilio_usage_alert` | ๐Ÿ”” Workflow | Set up alerts for usage thresholds (e.g., "Alert me when I hit $100 this month"). | | `twilio_health_check` | ๐Ÿฉบ **MCP App** | System health dashboard: error rates, delivery rates, uptime. | | `twilio_error_log` | ๐Ÿšจ **MCP App** | Visual log of recent errors with filters, sparklines, and suggested fixes. | **Use case:** *"How much have I spent on SMS this month?"* โ†’ auto-loads analytics pack, uses `twilio_cost_report`. --- ### โš™๏ธ Serverless Pack (3 tools) **Load with:** `twilio_explore category=serverless` | Tool | Type | Description | |------|------|-------------| | `twilio_deploy_function` | ๐Ÿš€ Workflow | Deploy a Twilio Function (serverless code) from source. | | `twilio_deploy_status` | ๐Ÿ“Š Workflow | Check deployment status and logs. | | `twilio_env_vars` | ๐Ÿ”ง Workflow | Manage environment variables for your Twilio Functions. | **Use case:** *"Deploy this function to handle incoming SMS"* โ†’ auto-loads serverless pack, uses `twilio_deploy_function`. --- ### ๐Ÿ›ก๏ธ Compliance Pack (2 tools) **Load with:** `twilio_explore category=compliance` | Tool | Type | Description | |------|------|-------------| | `twilio_compliance_check` | โœ… **MCP App** | Check your account's A2P 10DLC compliance status and required registrations. | | `twilio_register_brand` | ๐Ÿ“ Workflow | Register your brand for A2P 10DLC messaging (US SMS compliance). | **Use case:** *"Am I compliant for A2P messaging?"* โ†’ auto-loads compliance pack, uses `twilio_compliance_check`. --- ## ๐Ÿง  Lazy Loading: Only Load What You Need **The problem with the official Twilio MCP:** It loads 400+ tools on startup, polluting your AI's context window and slowing down every response. **Our solution:** **Lazy loading with intent detection.** ### How It Works 1. **Tier 1 (Always Loaded):** 5 essential tools load instantly โ€” `twilio_explore`, `twilio_dashboard`, `twilio_quick_send`, `twilio_quick_call`, `twilio_lookup`. These cover 80% of quick tasks. 2. **Tier 2 (Lazy Loaded):** 11 specialized packs (50+ tools) sit dormant until needed. They load automatically when: - You explicitly call `twilio_explore category=messaging` - Your AI detects intent via keywords (e.g., you say *"SMS campaign"* โ†’ messaging pack auto-loads) - A Tier 1 tool suggests loading a pack (e.g., dashboard suggests exploring voice tools) 3. **Auto-Detection:** The lazy loader scans your queries for keywords: - *"Send a bulk SMS"* โ†’ `messaging` pack loads - *"Build an IVR"* โ†’ `voice` pack loads - *"Check if this number is fraud"* โ†’ `intelligence` pack loads 4. **MCP Notifications:** When a pack loads, we send `tools/list_changed` notifications so Claude instantly sees the new tools. ### Example Flow ``` User: "I want to send an SMS campaign to 100 customers" AI: [Detects keyword "SMS campaign" โ†’ auto-loads messaging pack] AI: "The messaging pack is now loaded. I can use twilio_campaign_launch to send your campaign..." ``` **Result:** Your context window stays lean, tools appear exactly when needed, zero manual configuration. --- ## ๐ŸŽจ MCP Apps: Visual Dashboards in HTML **17 tools** in this MCP are **MCP Apps** โ€” they return rich HTML dashboards using the `structuredContent` MCP spec. ### What You Get - **๐Ÿ“Š Data tables** with sorting, status badges, sparklines - **๐Ÿ“ˆ Charts & metrics** โ€” spending trends, call volume, error rates - **๐Ÿ’ฌ Chat UIs** โ€” view SMS threads as beautiful conversation bubbles - **๐ŸŒณ Flow diagrams** โ€” visualize IVRs and Studio flows - **๐ŸŽ›๏ธ Dashboards** โ€” balance, usage, agent status, health checks ### Example: `twilio_dashboard` Returns an HTML dashboard with: - Account balance and phone number count - Recent message activity (sent/received/failed) - Recent call activity (completed/no-answer/failed) - Phone number inventory table with capabilities (SMS/Voice/MMS) ### All MCP Apps 1. `twilio_dashboard` โ€” Account overview 2. `twilio_campaign_launch` โ€” Bulk message sender with progress 3. `twilio_conversation_thread` โ€” SMS conversation viewer 4. `twilio_message_log` โ€” Message history with filters 5. `twilio_build_ivr` โ€” IVR builder UI 6. `twilio_voicemail_box` โ€” Voicemail setup wizard 7. `twilio_call_analytics` โ€” Call volume dashboard 8. `twilio_deep_scan` โ€” Phone number intelligence report 9. `twilio_auth_flow_setup` โ€” 2FA flow configurator 10. `twilio_number_hunt` โ€” Number search results 11. `twilio_number_inventory` โ€” Phone number inventory 12. `twilio_flow_diagram` โ€” Studio flow visualizer 13. `twilio_contact_center_setup` โ€” Contact center builder 14. `twilio_agent_status` โ€” Agent availability dashboard 15. `twilio_queue_manager` โ€” Queue metrics 16. `twilio_inbox` โ€” Unified message inbox 17. `twilio_cost_report` โ€” Spending dashboard 18. `twilio_health_check` โ€” System health monitor 19. `twilio_error_log` โ€” Error log with filters 20. `twilio_compliance_check` โ€” Compliance status --- ## ๐Ÿšฆ Tool Safety Tiers Every tool is annotated with a **safety tier** and MCP annotations (`readOnlyHint`, `destructiveHint`, `costHint`) so Claude knows what's safe to run autonomously. ### ๐ŸŸข Green Tier: Run Freely **Read-only, no side effects, no cost.** Examples: - `twilio_explore` โ€” List available packs - `twilio_dashboard` โ€” View account stats - `twilio_lookup` (basic) โ€” Validate a phone number (free) - `twilio_message_log` โ€” View message history Claude can run these without asking. They're informational. ### ๐ŸŸก Yellow Tier: Proceed with Note **Writes data, sends messages, may cost small amounts (~$0.01).** Examples: - `twilio_quick_send` โ€” Send an SMS (~$0.0079) - `twilio_quick_call` โ€” Place a call (~$0.014/min) - `twilio_otp_send` โ€” Send a 2FA code - `twilio_auto_responder` โ€” Set up auto-replies Claude will notify you: *"I'm about to send an SMS which will cost ~$0.01. Proceed?"* ### ๐Ÿ”ด Red Tier: Requires Confirmation **Destructive, expensive, or irreversible.** Examples: - `twilio_number_provision` โ€” **Buy a phone number** (~$1-$2/month) - `twilio_number_release` โ€” **Delete a phone number** (destructive) - `twilio_campaign_launch` โ€” Send 1000s of messages ($$) - `twilio_call_blast` โ€” Place simultaneous calls ($$) Claude will always ask: *"This tool will purchase a phone number for ~$1/month. Confirm?"* ### MCP Annotations We use the official MCP annotations spec: ```typescript { readOnlyHint: true, // Green: safe to run autonomously destructiveHint: true, // Red: requires confirmation idempotentHint: true, // Safe to retry costHint: true, // Costs money estimatedCost: "~$0.01" // Human-readable cost } ``` Claude respects these and adjusts its behavior accordingly. --- ## โš™๏ธ Configuration ### Environment Variables The recommended way to authenticate: ```bash export TWILIO_ACCOUNT_SID="ACxxxxx" export TWILIO_API_KEY="SKxxxxx" export TWILIO_API_SECRET="your_secret" ``` ### CLI Arguments Alternatively, pass credentials as a CLI argument: ```bash twilio-mcp "ACxxxxx:SKxxxxx:your_secret" ``` Format: `account_sid:api_key:api_secret` ### Claude Desktop Config Full example: ```json { "mcpServers": { "twilio": { "command": "npx", "args": ["-y", "@busybee/twilio-mcp"], "env": { "TWILIO_ACCOUNT_SID": "ACxxxxx", "TWILIO_API_KEY": "SKxxxxx", "TWILIO_API_SECRET": "your_secret" } } } } ``` ### Getting Credentials 1. **Account SID:** Visible on your [Twilio Console dashboard](https://console.twilio.com) 2. **API Key/Secret:** [Create an API Key here](https://console.twilio.com/account/keys-credentials/api-keys) **Why API Keys?** They're more secure than using your auth token. You can rotate them, revoke them, and scope their permissions. --- ## ๐Ÿ› ๏ธ Development ### Build from source ```bash git clone https://github.com/yourusername/twilio-mcp.git cd twilio-mcp npm install npm run build npm link # Use locally ``` ### Run in dev mode ```bash npm run dev # Watch mode npm start # Run the built server ``` ### Testing ```bash npm test ``` --- ## ๐Ÿ“– Examples ### Send a quick SMS ``` User: "Send an SMS to +15551234567 saying 'Meeting at 3pm'" ``` โ†’ `twilio_quick_send` auto-selects a sender, validates the number, sends. ### Launch a campaign ``` User: "Send 'Sale ends tonight!' to these 500 customers" ``` โ†’ Loads messaging pack, uses `twilio_campaign_launch`, shows progress dashboard. ### Build an IVR ``` User: "Build an IVR: press 1 for sales, 2 for support, 3 for billing" ``` โ†’ Loads voice pack, uses `twilio_build_ivr`, generates TwiML and webhook code. ### Check for fraud ``` User: "Is +15559876543 safe to call?" ``` โ†’ Loads intelligence pack, uses `twilio_fraud_check`, returns fraud score and sim swap risk. ### View account dashboard ``` User: "Show me my Twilio dashboard" ``` โ†’ `twilio_dashboard` returns rich HTML: balance, usage, active numbers, recent activity. --- ## ๐Ÿค Contributing We welcome contributions! If you want to add a tool, improve a pack, or fix a bug: 1. Fork the repo 2. Create a feature branch (`git checkout -b feature/cool-tool`) 3. Add your tool to the appropriate pack (extend `BasePack`) 4. Add keywords to `PACK_KEYWORDS` in `lazy-loader.ts` 5. Update this README with your new tool 6. Submit a PR ### Adding a New Tool 1. Extend the appropriate pack class (e.g., `MessagingPack`) 2. Use `registerTool()` helper: ```typescript this.registerTool({ name: 'twilio_my_tool', description: 'Does something awesome', category: 'messaging', safety: 'yellow', tier: 2, annotations: { costHint: true, estimatedCost: '~$0.01' }, inputSchema: z.object({ param: z.string().describe('A parameter'), }), handler: async (params) => { // Your logic here return this.textResult('Success!'); }, }); ``` 3. Add keywords to `PACK_KEYWORDS` for auto-detection. --- ## ๐Ÿ“œ License MIT License โ€” see [LICENSE](LICENSE) file. **Built with โค๏ธ by the BusyBee team.** *Twilioยฎ is a registered trademark of Twilio Inc. This project is not affiliated with, endorsed by, or sponsored by Twilio Inc.* --- ## ๐Ÿ About BusyBee We build tools that don't suck. MCP servers, AI workflows, and infrastructure that just works. **More projects:** - [@busybee/postgres-mcp](https://github.com/busybee/postgres-mcp) โ€” PostgreSQL MCP that doesn't dump your entire schema - [@busybee/github-mcp](https://github.com/busybee/github-mcp) โ€” GitHub MCP with PR workflows, not raw REST endpoints - [@busybee/stripe-mcp](https://github.com/busybee/stripe-mcp) โ€” Stripe MCP that understands subscriptions and payments **Follow us:** [@busybee_tools](https://twitter.com/busybee_tools) --- ## ๐Ÿš€ Get Started Now ```bash npx @busybee/twilio-mcp ``` Then add it to your Claude Desktop config and say: *"Show me my Twilio dashboard"* Welcome to Twilio MCP that doesn't suck. ๐ŸŽ‰