Use the Twilio Alpha MCP (Model Context Protocol) Server to Automate Development

April 01, 2025
Written by
Reviewed by
Noah Mogil
Twilion
Doa Jafri
Twilion
Paul Kamp
Twilion

Use the Twilio Alpha MCP (Model Context Protocol) Server to Automate Development

Model Context Protocol (MCP) is a new open standard designed by Anthropic to improve how AI models access and interact with external information and tools. At its core, MCP is about making AI agents more capable, scalable, and secure by decoupling the agent from the messy context management and custom tool integrations that developers currently juggle.

Model Context Protocol defines a shared protocol—an agreed-upon way for clients to discover and use external tools and context servers. By doing so, it standardizes the way AI agents access capabilities like Twilio APIs, while giving providers control over how those capabilities are presented and used.

We were excited to see the team at Anthropic launch the Model Context Protocol as an open standard – and today, we're equally excited to introduce the Twilio Alpha MCP server.

In this post, I’ll tell you what MCP is, why it matters, and how we’ve started using it at Twilio to make building with our APIs easier and more scalable. We’ll also walk through how you can start experimenting with the Twilio Alpha MCP server yourself.

How does the Twilio Alpha MCP Server work?

Imagine you’ve built an AI agent that’s supposed to send a Twilio SMS. Without MCP, that agent would have to send an SMS through multiple static configuration steps. The developer would integrate a Vector Database (VectorDB) with relevant knowledge or documentation and hard-code an SMS API as one of the tools for the agent. Multiply this by dozens of agents and you’ve suddenly created a maintenance nightmare. Every tool and every chunk of context is handled differently in each implementation. And from a platform perspective? Zero visibility and zero standardization.

MCP was developed to fix this.

With MCP, you don’t have to embed all possible knowledge and tools directly into your agent. Instead, agents can query MCP servers to discover what tools are available, understand what context is needed, and then execute actions safely and consistently.

The Twilio Alpha MCP server works a bit like this:

  • The agent (client) sends a request to our MCP server.
  • The server responds with a list of available tools and capabilities.
  • The agent reasons through what it needs to do—say, sending an SMS—and then calls the appropriate tool through the MCP interface.
Conveyer belts with packages

MCP manages API calls between an AI Agent and Twilio, while a Dev can manage their own.

Just like microservices changed how we build applications by decomposing functionality, MCP decomposes context and tool usage into a network of composable, specialized services. It enables multi-step, cross-domain reasoning at scale, with less cognitive load for the developer and far less overhead.

If you're building agents that need to do things in the real world: hit APIs, take actions, retrieve complex information…MCP is the way to do it without reinventing the wheel every time.

Follow along to get started using the Twilio Alpha MCP Server with an MCP client like Claude Desktop or Cursor.

Prerequisites

To get started building with the Twilio Alpha MCP server, you'll need:

Let’s go!

Set up the Twilio Alpha MCP

I’ll start by walking you through getting the Twilio MCP configuration setup in Claude Desktop.

[Option 1] Use the NPM Package

  1. Navigate to Developer Settings in the Claude Desktop app (Claude > Settings > Developer).
Add the MCP server from Twilio Alpha to Claude Desktop
  • Click on “Edit Config”. This will create a configuration file called claude_desktop_config.json if you don’t already have one, and will display the file in your file system.
  • Open this file in your text editor of choice. By default, that file will be an empty JSON object.
  • Add the following to claude_desktop_config.json to configure your Twilio MCP server:
{
  "mcpServers": {
    "twilio": {
      "command": "npx",
      "args": [
        "-y", 
        "@twilio-alpha/mcp",
        "YOUR_TWILIO_ACCOUNT_SID/YOUR_TWILIO_API_KEY:YOUR_TWILIO_API_SECRET"
       –services
       "twilio_api_v2010",
       "--tags",
       "Api20100401IncomingPhoneNumber"
      ]
    }
  }
}

Twilio has thousands of APIs, and including all of those tools in one MCP response is too large for most LLM’s context window token limits. Because of that, we need to filter down the total number of tools using the --services and --tags parameters.

--services specifies the name(s) of the services you want to use which corresponds to the filename of the spec in Twilio’s OpenAPI spec.

--tags are defined in each individual endpoint in the OpenAPI spec. If you only want to filter by tags, be sure to pass --services as an empty object.

You can find the full list of services and tags in the README.

  1. Restart the Claude desktop app and you should now see a hammer icon in the bottom right corner of the input box. Clicking on that icon will display information about the tools available through the Twilio MCP server.

[Option 2] Clone the Twilio MCP Repository

If you prefer to explore or modify the server, you can clone the repository and build the server locally.

  1. Start by cloning the package:
git clone git@github.com:twilio-labs/mcp.git
  • Next, install the required dependencies:
cd mcp
npm install
  • Finally, run the build command:
npm run build

Now update your MCP configuration file (claude_desktop_config.json) to the following:

{
  "mcpServers": {
    "twilio": {
      "command": "node",
      "args": [
        "PATH_TO_REPO/packages/mcp/build/index.js",
        "YOUR_TWILIO_ACCOUNT_SID/YOUR_TWILIO_API_KEY:YOUR_TWILIO_API_SECRET"
       –services
       "twilio_api_v2010",
       "--tags",
       "Api20100401IncomingPhoneNumber"
      ]
    }
  }
}

Add project instructions

Once you’ve set up the Twilio Alpha MCP, you’ll want to add an instructions file that contains your Twilio account information – specifically your account SID and other service SIDs. There are some instances where the service SID is necessary in the body of the API request and today the LLM doesn’t always set this accurately based on your MCP configuration. Adding instructions is an extra safeguard to ensure your account identifiers are sent correctly.

See how to add and configure project instructions in Claude Desktop

Try it out

Now you should be able to ask Claude to:

List the active phone numbers in my Twilio account

Claude will prompt you to allow the tool to run, and then should list the numbers available in your Twilio account!

Measuring the impact: What MCP actually changes for builders

MCP sounds promising, but what does it actually mean in practice? We wanted to find out if using MCP makes a tangible difference in how developers (or their AI agents) complete real-world tasks.

To test this, we ran a small benchmarking experiment using Cline, an Open Source AI coding VS Code extension that supports "auto run" which allows the agent to autonomously issue MCP commands, making it ideal for testing multi-step workflows with minimal human interference.

We focused on three representative tasks using Twilio APIs:

  • Purchasing a Canadian phone number in a specific area code (which turned out to be unavailable—forcing the agent to iterate)
  • Creating a TaskRouter activity with a name that already exists (which requires handling the error gracefully)
  • Setting up a queue with a task filter to block agents associated with a particular activity

These aren’t necessarily pure developer tasks, they also cross into the realm of business operations, but they’re a good stress test for real-world execution. The idea was to compare Cline using its vanilla tools (like terminal commands, file and web search) versus Cline using the Twilio MCP server.1

Here’s what we found:

Task time – Significant improvement


The MCP-powered agent completed tasks 20.6% faster on average (49.7s vs 62.5s). This is a substantial improvement that directly impacts productivity and user experience when working with AI agents.

API call reduction

The MCP-powered agent required 19.3% fewer API calls on average (8.3 vs 10.3 calls). While not as dramatic as initially estimated, this reduction still represents an important efficiency improvement for both performance and cost management.

Human interaction dropped slightly

Agents using MCP needed slightly fewer interactions (1.0 vs 1.1), representing a 3.3% reduction. Though subtle, this means less back-and-forth when the agent has clearer context and better tools at its disposal.

Success rate

Perfect execution
MCP achieved a 100% success rate compared to 92.3% for standard agents. This 8.3% improvement demonstrates significantly enhanced reliability that could be critical for production environments.

Cost implications:

Understanding the tradeoff
MCP tasks cost 27.5% more on average ($0.169 vs $0.133 per task). This cost increase directly correlates with significantly higher caching activity:

  • 28.5% more cache reads
  • 53.7% more cache writes

The upshot: MCP gives AI agents clearer context and access to better-aligned tools, which leads to fewer API calls and fewer human interventions. Although it’s more costly per task we expect this to go down as MCP Clients better optimize Agent frameworks and LLM model lower costs. It’s an early signal that MCP is genuinely raising the ceiling on what agents can do more efficiently, and with fewer headaches for developers.

What’s next?

MCP is already unlocking major improvements in how AI agents access tools, but there are still limitations. Here’s what we’re focused on next here at Twilio:

Authentication and cloud hosting

Authentication is currently the biggest blocker to running MCP servers in secure, shared environments. Right now, most MCP implementations, including Twilio’s, are limited to local execution with no user authentication support.

The Emerging Tech and Innovation team at Twilio is actively researching an authentication mechanism that will allow users to securely access Twilio APIs via the MCP server. Once this is in place, we hope to host our MCP server in the cloud, enabling broader access and a production-ready developer experience. This aligns with the MCP roadmap, which highlights standardizing authentication and introducing per-user context as key next steps.

Managing large toolsets and context windows

MCP defines tools with full request schemas, which means large APIs like Twilio's (with nearly 2,000 endpoints) can quickly exceed token limits. To address this, we're working on:

  • Tool filtering by service: Developers can already scope tools using the --services flag (e.g., --services api_v2010) when running the server.
  • Smarter init configuration: Soon, users will be able to configure services during init to avoid manual flag-passing.
  • Dynamic tool updates: MCP supports notifications/tools/list_changed to help clients update their toolsets dynamically, but this feature is not yet widely implemented by MCP clients. Full support for this would allow remote servers to manage context size more intelligently.

Improving tool discovery and filtering is essential to make MCP work with complex APIs and avoid overloading client context windows.

Try the Twilio Alpha MCP server

You can start experimenting today by running the Twilio MCP server locally and connecting it to a compatible client like Claude Desktop or Cursor.

Try it out by…

  • Setting up a local Twilio Alpha MCP server
  • Use an MCP client to complete basic tasks (e.g., buying a phone number, sending an SMS)
  • Test how context and tool filtering affect performance and agent reliability

And let us know how it goes! We are eager to get feedback and hear about what you’re building at twilioalpha@twilio.com

Emily Shenfield (eshenfield@twilio.com) brings her background in software engineering, teaching, and theater to her role as a Technical Marketing Engineer at Twilio on the Emerging Tech and Innovation team. She's excited about exploring the future of customer engagement and how it impacts developers. Outside of work, she enjoys yelling the answers at the TV during Jeopardy and eating cookies.


1 Using Cline v3.8.4, the Anthropic Claude 3.7 API, and the Twilio Alpha MCP server on March 31, 2025.