@twilio-alpha/mcp
v0.7.0
Published
This is a Model Context Protocol server that exposes all of Twilio APIs.
Maintainers
Readme
This is a Proof of Concept (PoC) project by the ETI team, exploring the use of Model Context Protocol (MCP) for the exchange of model context information between different tools.
Prerequisites
- Node.js 18 or higher
- npm 9 or higher
- A Twilio account with API credentials
Getting Started
The easiest way to get started is to edit the configuration of your client to point to the MCP server using npx.
{
"mcpServers": {
"twilio": {
"command": "npx",
"args": [
"-y",
"@twilio-alpha/mcp",
"YOUR_ACCOUNT_SID/YOUR_API_KEY:YOUR_API_SECRET"
]
}
}
}Visit Twilio API Keys docs for information on how to find/create your apiKey/apiSecret.
Security Recommendations
To guard against injection attacks that may allow untrusted systems access to your Twilio data, the ETI team advises users of Twilio MCP servers to avoid installing or running any community MCP servers alongside our official ones. Doing so helps ensure that only trusted MCP servers have access to tools interacting with your Twilio account, reducing the risk of unauthorized data access.
Configuration Parameters
You can pass the following optional parameters to the mcp server:
--services (optional)
The name of the services you want to use - this corresponds to the filename https://github.com/twilio/twilio-oai/tree/main/spec/yaml
--tags (optional)
The tag name as defined in each of the individual endpoints. If you want to filter by tags only, make sure you pass --services '' as an empty object.
Loading Separate APIs
Due to the context size limitation of LLMs and the vast number of APIs available, you need to load separate APIs by passing the --services/--tags parameter. For example, to load the chat_v3 API, you can pass --services chat_v3. If you need particular APIs from separate service files, you can use the --tags to individually select the endpoints.
Examples: Serverless Tools
Load all the Serverless API tools.
{
"mcpServers": {
"twilio": {
"command": "npx",
"args": [
"-y",
"@twilio-alpha/mcp",
"YOUR_ACCOUNT_SID/YOUR_API_KEY:YOUR_API_SECRET",
"--services",
"twilio_serverless_v1"
]
}
}
}Examples: A Collection of Tools
Load the Incoming Phone Number and the Studio Flows API tools.
{
"mcpServers": {
"twilio": {
"command": "npx",
"args": [
"-y",
"@twilio-alpha/mcp",
"YOUR_ACCOUNT_SID/YOUR_API_KEY:YOUR_API_SECRET",
"--tags",
"Api20100401IncomingPhoneNumber,StudioV2Flow"
]
}
}
}Modifying Server
If you prefer to play around with the server, you can clone the repository and run the server locally. Once you've installed the server, npm run build and update your client's configuration to use
{
"mcpServers": {
"twilio": {
"command": "node",
"args": [
"PATH_TO_REPO/build/index.js",
"YOUR_ACCOUNT_SID/YOUR_API_KEY:YOUR_API_SECRET"
]
}
}
}Available Services
The following services can be used with the --services parameter:
twilio_accounts_v1- Account Management APItwilio_api_v2010- Core Twilio APItwilio_assistants_v1- Autopilot APItwilio_bulkexports_v1- Bulk Exports APItwilio_chat_v1,twilio_chat_v2,twilio_chat_v3- Chat APItwilio_content_v1,twilio_content_v2- Content APItwilio_conversations_v1- Conversations APItwilio_events_v1- Events APItwilio_flex_v1,twilio_flex_v2- Flex APItwilio_frontline_v1- Frontline APItwilio_iam_v1- Identity and Access Management APItwilio_insights_v1- Insights APItwilio_intelligence_v2- Intelligence APItwilio_ip_messaging_v1,twilio_ip_messaging_v2- IP Messaging APItwilio_lookups_v1,twilio_lookups_v2- Lookups APItwilio_marketplace_v1- Marketplace APItwilio_messaging_v1- Messaging APItwilio_microvisor_v1- Microvisor APItwilio_monitor_v1,twilio_monitor_v2- Monitor APItwilio_notify_v1- Notify APItwilio_numbers_v1,twilio_numbers_v2- Phone Numbers APItwilio_oauth_v1- OAuth APItwilio_pricing_v1,twilio_pricing_v2- Pricing APItwilio_proxy_v1- Proxy APItwilio_routes_v2- Routes APItwilio_serverless_v1- Serverless APItwilio_studio_v1,twilio_studio_v2- Studio APItwilio_supersim_v1- Super SIM APItwilio_sync_v1- Sync APItwilio_taskrouter_v1- TaskRouter APItwilio_trunking_v1- Trunking APItwilio_trusthub_v1- Trust Hub APItwilio_verify_v2- Verify APItwilio_video_v1- Video APItwilio_voice_v1- Voice APItwilio_wireless_v1- Wireless API
For example, to use the Chat API v3, you would specify --services twilio_chat_v3 in your configuration.
Available Tags
The following tags can be used with the --tags parameter to select specific API endpoints:
Accounts API Tags
AccountsV1AuthTokenPromotion- Auth Token PromotionAccountsV1Aws- AWS IntegrationAccountsV1BulkConsents- Bulk Consents ManagementAccountsV1BulkContacts- Bulk Contacts ManagementAccountsV1PublicKey- Public Key ManagementAccountsV1Safelist- Safelist ManagementAccountsV1SecondaryAuthToken- Secondary Auth Token Management
API 2010 Tags (Core Twilio API)
Api20100401Account- Account ManagementApi20100401AddOnResult- AddOn ResultsApi20100401Address- Address ManagementApi20100401Application- Application ManagementApi20100401Call- Call ManagementApi20100401Conference- Conference ManagementApi20100401IncomingPhoneNumber- Incoming Phone Number ManagementApi20100401Message- Message ManagementApi20100401Recording- Recording ManagementApi20100401Token- Token ManagementApi20100401Transcription- Transcription ManagementApi20100401Usage- Usage Management
Studio API Tags
StudioV2Execution- Flow Execution ManagementStudioV2ExecutionContext- Flow Execution ContextStudioV2ExecutionStep- Flow Execution StepsStudioV2Flow- Flow ManagementStudioV2FlowRevision- Flow Revision Management
Conversations API Tags
ConversationsV1Conversation- Conversation ManagementConversationsV1Message- Message ManagementConversationsV1Participant- Participant ManagementConversationsV1Service- Service ManagementConversationsV1User- User Management
Serverless API Tags
ServerlessV1Asset- Asset ManagementServerlessV1AssetVersion- Asset Version ManagementServerlessV1Build- Build ManagementServerlessV1Deployment- Deployment ManagementServerlessV1Environment- Environment ManagementServerlessV1Function- Function ManagementServerlessV1Service- Service ManagementServerlessV1Variable- Environment Variable Management
TaskRouter API Tags
TaskrouterV1Activity- Activity ManagementTaskrouterV1Event- Event ManagementTaskrouterV1Task- Task ManagementTaskrouterV1TaskChannel- Task Channel ManagementTaskrouterV1TaskQueue- Task Queue ManagementTaskrouterV1TaskReservation- Task Reservation ManagementTaskrouterV1Worker- Worker ManagementTaskrouterV1WorkerChannel- Worker Channel ManagementTaskrouterV1WorkerReservation- Worker Reservation ManagementTaskrouterV1Workflow- Workflow ManagementTaskrouterV1Workspace- Workspace ManagementTaskrouterV1WorkspaceStatistics- Workspace Statistics
This list includes the most commonly used tags. Each service has its own set of tags that follow the pattern {ServiceName}{Version}{Resource}. You can combine multiple tags by separating them with commas in your configuration.
Local Development
# Clone the repository
git clone https://github.com/twilio/mcp.git
cd mcp
# Install dependencies
npm install
# Build the packages
npm run build