Twilio Manager MCP connects Claude AI or any host to Twilio through the Model Context Protocol (MCP)
Project description
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
- Clone this repository
- Copy
.env.exampleto.envand fill in your Twilio credentials:TWILIO_ACCOUNT_SID=your_account_sid TWILIO_AUTH_TOKEN=your_auth_token - Install dependencies:
uv pip install -e .
Usage
Starting the Connection
- Make sure your credentials are set in the
.envfile - Start the MCP server:
uvx twilio-manager-mcp - 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
.envfile - 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
AsyncTwilioHttpClientfor 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
.envfile 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twilio_manager_mcp-0.1.6.tar.gz.
File metadata
- Download URL: twilio_manager_mcp-0.1.6.tar.gz
- Upload date:
- Size: 47.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d8e66774ad57f5b4a2bd97439391be466feb0766d0e924f49ef00d2286778e4
|
|
| MD5 |
d460725b1d2405c179a655448a2594ec
|
|
| BLAKE2b-256 |
7920ac6b5f498876e6974885d96b42a9ee19794a57aeae21368669face93448d
|
File details
Details for the file twilio_manager_mcp-0.1.6-py3-none-any.whl.
File metadata
- Download URL: twilio_manager_mcp-0.1.6-py3-none-any.whl
- Upload date:
- Size: 61.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49827347cf4769713b86be92aa52138e210be2d1a968f723348e03585bf37909
|
|
| MD5 |
c6c8fdc1ded92ee3f114b472dcdb9234
|
|
| BLAKE2b-256 |
e05e52f48495c9cb354fcdb367f2e22e58389b984b1fe5d25bece2f445dbad4f
|