Twilio 消息 MCP 服务器
一个 MCP(模型上下文协议)服务器,可通过 Twilio API 发送短信。
特征
通过 Twilio 发送短信
与 Claude Desktop 等 MCP 客户端集成
无需环境变量的安全凭证处理
使用 Twilio API 密钥来提高安全性
Related MCP server: TTS-MCP
安装
您可以通过 npx 直接使用此服务器:
npx twilio-messaging-mcp-server <accountSid> <apiKey> <apiSecret> <number>或者全局安装:
npm install -g twilio-messaging-mcp-server
twilio-messaging-mcp-server <accountSid> <apiKey> <apiSecret> <number>配置
服务器需要以下参数:
accountSid:您的 Twilio 帐户 SID(必须以“AC”开头,将被验证)apiKey:您的 Twilio API 密钥(以“SK”开头)apiSecret:您的 Twilio API 密钥number:发送消息的 Twilio 电话号码(E.164 格式,例如 +1234567890)
安全说明
此服务器使用 API 密钥和机密信息(而非身份验证令牌)来提高安全性。此方法提供了更好的访问控制,并能够在需要时撤销凭证。有关更多信息,请参阅Twilio API 密钥文档。
与 Claude Desktop 一起使用
本地开发
对于本地开发(当软件包未发布到 npm 时),将以下内容添加到您的 Claude Desktop 配置文件(macOS 上的~/Library/Application Support/Claude/claude_desktop_config.json或 Windows 上的%APPDATA%\Claude\claude_desktop_config.json )中:
{
"mcpServers": {
"twilio-messaging": {
"command": "node",
"args": [
"/PATHTONODE/twilio-messaging-mcp-server/build/index.js",
"your_account_sid_here",
"your_api_key_here",
"your_api_secret_here",
"+1234567890"
]
}
}
}用您的实际 Twilio 凭证替换这些值:
第一个参数:您的 Twilio 帐户 SID(以“AC”开头)
第二个参数:您的 Twilio API 密钥(以“SK”开头)
第三个参数:您的 Twilio API 密钥
第四个参数:您的 Twilio 电话号码(E.164 格式)
您可以通过在项目目录中运行以下命令来获取绝对路径:
# On macOS/Linux
echo "$(pwd)/build/index.js"
# On Windows (PowerShell)
Write-Output "$((Get-Location).Path)\build\index.js"发布到 npm 后
一旦包发布到 npm,您就可以使用以下配置:
{
"mcpServers": {
"twilio-messaging": {
"command": "npx",
"args": [
"-y",
"twilio-messaging-mcp-server",
"your_account_sid_here",
"your_api_key_here",
"your_api_secret_here",
"+1234567890"
]
}
}
}可用工具
发送短信
通过 Twilio 发送短信。
参数:
to:E.164 格式的目标电话号码(例如 +1234567890)message:要发送的消息内容
Claude 中的用法示例:
Can you send an SMS to +1234567890 saying "Hello from MCP!"发展
要构建项目:
npm install
npm run build手动运行服务器
要手动启动服务器进行测试(在 Claude Desktop 之外):
# Run with actual credentials
node build/index.js "your_account_sid_here" "your_api_key_here" "your_api_secret" "+1234567890"
# Or use the npm script (which uses ts-node for development)
npm run dev -- "your_account_sid_here" "your_api_key_here" "your_api_secret" "+1234567890"服务器将启动并等待 MCP 客户端连接。您应该看到如下输出:
[TwilioMessagingServer] Server started successfully与 Claude Desktop 一起使用时,Claude 加载配置文件时服务器会自动启动。您无需手动启动它。
执照
麻省理工学院
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.