Skip to main content
Glama
deshartman

Twilio Messaging MCP Server

by deshartman

Twilio Messaging MCP Server

An MCP server for sending SMS messages via Twilio API. This server provides tools, resources, and prompts for interacting with the Twilio Messaging API.

Features

  • 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)

  • Executable via npx for easy usage without installation

Related MCP server: Twilio MCP Server

Prerequisites

  • 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)

Installation

npm install @deshartman/twilio-messaging-mcp-server

Or run directly with npx:

npx @deshartman/twilio-messaging-mcp-server <accountSid> <apiKey> <apiSecret> <number>

NPX Usage

The package can be executed directly using npx without installation:

# Run with required parameters
npx @deshartman/twilio-messaging-mcp-server <accountSid> <apiKey> <apiSecret> <number>

# With environment variables for ngrok
env NGROK_AUTH_TOKEN=your_token NGROK_CUSTOM_DOMAIN=your_domain.ngrok.dev npx @deshartman/twilio-messaging-mcp-server <accountSid> <apiKey> <apiSecret> <number>

This is possible because the package includes the "bin" field in package.json, making it executable via npx.

Environment Variables

  • NGROK_AUTH_TOKEN: Your ngrok authentication token (required for callback handling)

  • NGROK_CUSTOM_DOMAIN: Your custom ngrok domain (optional)

Usage

Running the Server

You can run the server using the provided script with a .env file:

# Create a .env file with your credentials
# See .env.example for the required format

# Run the server (no arguments needed)
./run-server.sh

The .env file should contain:

ACCOUNT_SID=YOUR_ACCOUNT_SID
API_KEY=YOUR_API_KEY
API_SECRET=YOUR_API_SECRET
TWILIO_NUMBER=YOUR_TWILIO_PHONE_NUMBER
NGROK_AUTH_TOKEN=YOUR_NGROK_AUTH_TOKEN
NGROK_CUSTOM_DOMAIN=your-domain.ngrok.dev

This approach improves security by keeping credentials out of command history and simplifies the execution process.

Directly with Node.js

env NGROK_AUTH_TOKEN=your_ngrok_auth_token NGROK_CUSTOM_DOMAIN=your_domain.ngrok.dev node build/index.js <accountSid> <apiKey> <apiSecret> <number>

MCP Integration

This server provides the following MCP capabilities:

Tools

  • send-sms: Send an SMS message via Twilio with server readiness validation

Resources

  • twilio://statuscallback: Get the last raw status callback data from Twilio with enhanced error handling

Prompts

  • SendSMS: Prompt for sending an SMS using Twilio Messaging MCP Server

Troubleshooting

ngrok Tunnel Issues

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:

  1. Stop your existing endpoint first

  2. Use a different domain name

  3. Start both endpoints with --pooling-enabled to load balance between them

ENOTEMPTY Error

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.

License

MIT

Related MCP Connectors

  • The Mobile Text Alerts SMS MCP server enables your AI to send SMS messages & manage contacts

  • The Telnyx MCP server is an official implementation of the Model Context Protocol that enables AI clients (like Claude Desktop, Cursor, and OpenAI Agents) to interact with Telnyx's telephony, messaging, and AI assistant APIs. It provides comprehensive capabilities including making and managing phone calls, sending SMS/MMS messages, purchasing and configuring phone numbers, creating AI assistants with custom instructions, managing cloud storage buckets, scraping and embedding website content, and handling integration secrets. The server exists as both a local implementation and a remotely hosted version, allowing developers to integrate real-world communication infrastructure directly into AI applications.

  • Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.

  • WhatsMCP connects Claude and other MCP-compatible AI agents directly to WhatsApp. Send and receive text, images, documents, and voice notes; manage groups (create, add/remove members, promote admins); look up contacts and profiles; follow channels; and read call and message history — all through a standard MCP interface. For voice use cases, WhatsMCP offers SIP-based calling plans (inbound-only, or full inbound/outbound) so AI voice agents can answer and place WhatsApp calls, plus low-latency WebSocket integrations with voice agent providers like ElevenLabs. Multiple WhatsApp accounts can be paired and managed per workspace, with webhook support for real-time inbound message delivery to your own infrastructure.

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    A server that connects Claude AI to Twilio through the Model Context Protocol, enabling prompt-assisted management of Twilio accounts, phone numbers, and regulatory compliance.
    4
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A Model Context Protocol server that enables Claude and other AI assistants to send SMS and MMS messages using Twilio.
    12 npm
    15
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that allows AI agents like Claude to interact with the Aligo SMS API to send text messages and retrieve related information.
    1
    1
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    MCP server for sending SMS via the SMSPM API. Send transactional SMS from Claude Desktop, Cursor, Windsurf, Cline, or any MCP client.
    1
    26 npm
    MIT