An MCP server for sending SMS messages via Twilio API. This server provides tools, resources, and prompts for interacting with the Twilio Messaging API.
- Send SMS messages via Twilio
- Get status callbacks from Twilio with enhanced handling via
@deshartman/mcp-status-callback
- Integrates with Claude AI via the Model Context Protocol (MCP)
- Node.js >= 18.0.0
- Twilio account with:
- Account SID
- API Key and Secret
- Twilio phone number
- ngrok account with:
- Auth token
- Custom domain (optional)
npm install @deshartman/twilio-messaging-mcp-server
Or run directly with npx:
npx @deshartman/twilio-messaging-mcp-server <accountSid> <apiKey> <apiSecret> <number>
NGROK_AUTH_TOKEN
: Your ngrok authentication token (required for callback handling)NGROK_CUSTOM_DOMAIN
: Your custom ngrok domain (optional)
You can run the server using the provided script:
# Set your ngrok auth token
export NGROK_AUTH_TOKEN=your_ngrok_auth_token
# Run the server
./run-server.sh <accountSid> <apiKey> <apiSecret> <number> [ngrokDomain]
Example:
./run-server.sh YOUR_ACCOUNT_SID YOUR_API_KEY YOUR_API_SECRET YOUR_TWILIO_PHONE_NUMBER your-domain.ngrok.dev
env NGROK_AUTH_TOKEN=your_ngrok_auth_token NGROK_CUSTOM_DOMAIN=your_domain.ngrok.dev node build/index.js <accountSid> <apiKey> <apiSecret> <number>
This server provides the following MCP capabilities:
send-sms
: Send an SMS message via Twilio with server readiness validation
twilio://statuscallback
: Get the last raw status callback data from Twilio with enhanced error handling
SendSMS
: Prompt for sending an SMS using Twilio Messaging MCP Server
If you encounter an error like:
failed to start tunnel: The endpoint 'https://your-domain.ngrok.dev' is already online.
You have a few options:
- Stop your existing endpoint first
- Use a different domain name
- Start both endpoints with
--pooling-enabled
to load balance between them
If you encounter an npm error like:
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
Try running the server directly with Node.js instead of using npx.
MIT