This Twilio Messaging MCP Server allows you to send SMS messages via the Twilio API while providing integration with Claude AI through the Model Context Protocol (MCP). The server offers built-in status callback handling and can be run with minimal setup.
You can install the package globally or use it directly with npx:
npm install @deshartman/twilio-messaging-mcp-server
The simplest way to run the server is using npx with your Twilio credentials:
npx @deshartman/twilio-messaging-mcp-server <accountSid> <apiKey> <apiSecret> <number>
To handle callbacks properly, you'll need to provide ngrok credentials:
env NGROK_AUTH_TOKEN=your_token NGROK_CUSTOM_DOMAIN=your_domain.ngrok.dev npx @deshartman/twilio-messaging-mcp-server <accountSid> <apiKey> <apiSecret> <number>
For better security, you can use a .env
file with your credentials:
.env
file with the following content: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
./run-server.sh
You can also run the server 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>
The server provides several MCP capabilities for integration with Claude AI:
If you see an error like:
failed to start tunnel: The endpoint 'https://your-domain.ngrok.dev' is already online.
You can:
--pooling-enabled
to load balance between themFor npm errors like:
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
Try running the server directly with Node.js instead of using npx.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "twilio-messaging-mcp-server" '{"command":"npx","args":["@deshartman/twilio-messaging-mcp-server"],"env":{"NGROK_AUTH_TOKEN":"","NGROK_CUSTOM_DOMAIN":""}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"twilio-messaging-mcp-server": {
"command": "npx",
"args": [
"@deshartman/twilio-messaging-mcp-server"
],
"env": {
"NGROK_AUTH_TOKEN": "",
"NGROK_CUSTOM_DOMAIN": ""
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"twilio-messaging-mcp-server": {
"command": "npx",
"args": [
"@deshartman/twilio-messaging-mcp-server"
],
"env": {
"NGROK_AUTH_TOKEN": "",
"NGROK_CUSTOM_DOMAIN": ""
}
}
}
}
3. Restart Claude Desktop for the changes to take effect