Skip to main content

TwilioManager MCP - Twilio Model Context Protocol Integration

TwilioManager MCP connects Claude AI to Twilio through the Model Context Protocol (MCP), enabling Claude to interact directly with Twilio's API. This integration allows for prompt-assisted Twilio account management, subaccount creation, phone number management, and regulatory compliance handling.

Features

  • Two-way communication: Connect Claude AI to Twilio through a socket-based server
  • Subaccount management: Create, list, and manage Twilio subaccounts
  • Phone number control: Transfer, configure, and manage phone numbers across accounts
  • Regulatory compliance: Manage regulatory bundles and compliance requirements
  • Address management: Create and manage addresses for regulatory compliance
  • Asynchronous API: High-performance async implementation of Twilio API interactions

Components

The system consists of two main components:

  • MCP Server (twilio_manager_mcp.py): A Python server that implements the Model Context Protocol and provides tools for Twilio management
  • Async Twilio API (api/async_twilio_api.py): An asynchronous wrapper around the Twilio API for efficient operations

Installation

Prerequisites

  • Python 3.10 or newer
  • uv

If you're on Mac:

brew install uv

On Windows:

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
set Path=C:\Users\[USERNAME]\.local\bin;%Path%

⚠️ Do not proceed before installing UV

Claude for Desktop Integration

Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json to include the following:

{
    "mcpServers": {
        "twilio": {
            "command": "uvx",
            "args": [
                "twilio-manager-mcp"
            ]
        }
    }
}

Cursor Integration

Run twilio-manager-mcp without installing it permanently through uvx. Go to Cursor Settings > MCP and paste this in the Json

{
    "mcpServers":{
        "twilio_manager_mcp": {
            "command": "uvx",
            "args": ["twilio-manager-mcp"],
            "env": {
                "TWILIO_ACCOUNT_SID": "AC00000000000000000000000000000000",
                "TWILIO_AUTH_TOKEN": "00000000000000000000000000000000"
            }
        }
    }
)

⚠️ Only run one instance of the MCP server (either on Cursor or Claude Desktop), not both

Environment Setup

  1. Clone this repository
  2. Copy .env.example to .env and fill in your Twilio credentials:
    TWILIO_ACCOUNT_SID=your_account_sid
    TWILIO_AUTH_TOKEN=your_auth_token
    
  3. Install dependencies:
    uv pip install -e .
    

Usage

Starting the Connection

  1. Make sure your credentials are set in the .env file
  2. Start the MCP server:
    uvx twilio-manager-mcp
    
  3. In Claude, look for the Twilio MCP tool icon in the toolbar

Using with Claude

Once the config file has been set on Claude and the MCP server is running, you will see a tool icon for the Twilio Manager MCP.

Capabilities

  • List and filter Twilio subaccounts
  • View phone numbers associated with accounts
  • Transfer phone numbers between accounts
  • Create and manage addresses
  • Handle regulatory compliance and bundles
  • Execute comprehensive Twilio account management tasks

Example Commands

Here are some examples of what you can ask Claude to do:

  • "List all my Twilio subaccounts"
  • "Show all phone numbers on my main account"
  • "Transfer phone number X from account A to account B"
  • "Create a new address for regulatory compliance"
  • "Duplicate a regulatory bundle to a subaccount"
  • "Show all phone numbers of a specific type"

Troubleshooting

  • Connection issues: Make sure the MCP server is running, and the MCP server is configured on Claude
  • Authentication errors: Verify your Twilio credentials in the .env file
  • Rate limiting: Twilio API has rate limits; consider adding delays between operations if hitting limits
  • Timeout errors: Try simplifying your requests or breaking them into smaller steps

Technical Details

Communication Protocol

The system uses a JSON-based protocol over TCP sockets:

  • Commands are sent as JSON objects with a type and optional params
  • Responses are JSON objects with status and result or message

Async Implementation

The Twilio API wrapper uses Python's asyncio for high-performance, non-blocking operations:

  • Custom AsyncTwilioHttpClient for managing HTTP requests asynchronously
  • Context manager pattern for resource management
  • Error handling and retry logic

Limitations & Security Considerations

  • The system requires valid Twilio credentials with appropriate permissions
  • Keep your .env file secure and never commit it to version control
  • Consider adding additional validation for critical operations
  • API keys should be rotated regularly for security
  • Some operations may require multiple steps to complete successfully

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Disclaimer

This tool interacts with a paid service (Twilio). Be aware that API calls made through this tool may incur charges to your Twilio account. Always test in development environments before using in production.

Metadata

Release files for twilio-manager-mcp 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twilio-manager-mcp 0.1.6
File Size Uploaded Provenance
twilio_manager_mcp-0.1.6.tar.gz 47.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for twilio-manager-mcp 0.1.6
File Interpreter ABI Platform
twilio_manager_mcp-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 108.8 kB

Release files / twilio_manager_mcp-0.1.6.tar.gz

Download URL twilio_manager_mcp-0.1.6.tar.gz
Size 47.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2d8e66774ad57f5b4a2bd97439391be466feb0766d0e924f49ef00d2286778e4
BLAKE2b-256 checksum
How to use checksums
7920ac6b5f498876e6974885d96b42a9ee19794a57aeae21368669face93448d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.9

Release files / twilio_manager_mcp-0.1.6-py3-none-any.whl

Download URL twilio_manager_mcp-0.1.6-py3-none-any.whl
Size 61.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49827347cf4769713b86be92aa52138e210be2d1a968f723348e03585bf37909
BLAKE2b-256 checksum
How to use checksums
e05e52f48495c9cb354fcdb367f2e22e58389b984b1fe5d25bece2f445dbad4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.9

Security for twilio-manager-mcp 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page