跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Twilio,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 使用 Twilio:发送和查询 SMS 与 WhatsApp 消息,查看通话和电话号码,用 Lookup 检查号码,用 Verify 发送和校验一次性验证码,并随时掌握用量、费用和余额。
试试这样问
Twilio 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Twilio、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Twilio + ChatGPT
让你的 AI 使用 Twilio:发送和查询 SMS 与 WhatsApp 消息,查看通话和电话号码,用 Lookup 检查号码,用 Verify 发送和校验一次性验证码,并随时掌握用量、费用和余额。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
TWILIO_ACCOUNT_SID, TWILIO_API_KEY_SID, TWILIO_API_KEY_SECRET
步骤 1 — 获取凭证
- 登录 console.twilio.com。首页的 Account Info 面板会显示 Account SID(以
AC开头)和 Auth Token。 - 推荐:创建一个 API key,而不是使用 Auth Token。在 Console 中打开 Settings → Account settings → API keys & auth tokens(旧版 Console 为 Admin → Account management → API keys & tokens),点击 Create API key,类型选择 Standard,然后复制 SID(以
SK开头)和 Secret:Twilio 只显示一次 secret。key 可以单独撤销,无需更改 Auth Token。 - 把 Account SID 填入
TWILIO_ACCOUNT_SID。然后二选一:把 key 的 SID(SK...)填入TWILIO_API_KEY_SID、其 secret 填入TWILIO_API_KEY_SECRET;或者把 Account SID(AC...)再次填入TWILIO_API_KEY_SID、把 Auth Token 填入TWILIO_API_KEY_SECRET。 - 安装连接器,先运行
twilio_list_phone_numbers:它会列出你拥有的号码,也就是 AI 可以用作发送方的号码。Standard 类型的 API key 可能无法读取账户记录本身,因此twilio_get_account可能返回 401 或 403;其他工具都能正常使用。
发送会产生费用,并会送达真实的人:twilio_send_message 和 twilio_send_verification 会向真实的人发送真实的消息或验证码,Twilio 按条计费。AI 会先说明收件人、发送方、渠道和内容,等你确认后再发送。twilio_cancel_scheduled_message 也是如此。
安装时默认关闭:twilio_delete_message,它会永久删除一条消息记录及其内容。只有在 AI 需要删除消息时才打开它。
试用账户:试用账户最多只能向五个已验证的号码发送(否则报错 21608),且只能发往注册时所在的国家。试用期间,通过 API 发送的 SMS 正文只能使用 Twilio 的示例模板之一(如 sms_2fa 或 sms_appointment_reminders);发送自定义文本需要升级账户。
WhatsApp:在两个号码前都加上 whatsapp:(whatsapp:+4915112345678)。首次测试请使用旧版 Console 中的 WhatsApp Sandbox:对方向沙盒号码发送 join <code>,之后三天内你可以从 whatsapp:+14155238886 给对方发消息。距离对方最后一条消息超过 24 小时后,WhatsApp 只投递已审核通过的模板,需用 content_sid(HX...)和 content_variables 发送(否则报错 63016)。
号码:始终使用 E.164 格式,即 +、国家代码和不带空格的号码(+4915112345678)。twilio_list_phone_numbers 显示可用于发送的号码;twilio_list_messaging_services 列出你的 Messaging Service,定时消息需要用到它(schedule_type 设为 fixed 并配合 send_at)。
投递状态:新消息的初始状态是 queued。稍后让 AI 用 twilio_get_message 查看:failed 或 undelivered 会附带 error_code,可在 Twilio 错误列表 中查询。twilio_list_messages 和 twilio_list_calls 按从新到旧显示历史记录。
Lookup:不带 fields 的 twilio_lookup_phone_number 免费,用于检查格式和国家。fields 中的每个数据包(如 line_type_intelligence、sms_pumping_risk 或 caller_name)都按次计费,因此 AI 会先征求你的同意。
Verify:在 Console 中创建一次 Verify 服务(Verify → Services → Create new);twilio_list_verify_services 会显示它的 VA... sid。twilio_send_verification 通过 SMS、语音电话、WhatsApp 或电子邮件发送验证码,twilio_check_verification 检查对方输入的验证码(正确时状态为 approved)。每次验证通过约收费 0.05 USD,另加渠道费用。
用量和费用:twilio_list_usage_records 按日期范围统计,twilio_list_usage_records_by_period 按日、月或年拆分,或使用 ThisMonth 这样的时间窗口。类别 totalprice 是总支出;twilio_get_balance 显示剩余余额。
分页:列表会返回 next_page_uri(最后一页为 null);获取下一页时,AI 会传入其中的 page 和 page_token。
常见错误:401 或 20003 表示 SID 或 secret 错误,或 API key 与不属于它的 Account SID 搭配使用。404 或 20404 表示该账户中没有这条消息、通话、号码或服务。21211 表示 to 号码无效,21606 表示 from 号码不是本账户的 Twilio 号码或无法发送 SMS,21610 表示收件人回复了 STOP。429 或 20429 表示请求过多:稍等后再试。
连接器不会拨打电话,不会购买或配置号码,也不处理 Conversations、Studio、Flex、Voice TwiML 和 Webhook。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 ChatGPT 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
ChatGPT 通过开发者模式(Developer mode)将 MCP 服务器作为自定义应用接入,仅付费套餐可用,免费套餐不可用。在 Business 和 Enterprise 工作区中,可能需要管理员先开启。
- 在 ChatGPT 中打开 Settings → Security and login,开启 Developer mode。
- 前往 chatgpt.com/plugins,点击 +。
- 填写名称和简短描述,例如 Name:
Twilio。 - 在 Connection 下填入 MCP 服务器 URL
https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID,然后创建连接。 - ChatGPT 提示时,登录 AnythingMCP(OAuth)并允许访问。
可用工具
| Tool | What it does |
|---|---|
twilio_get_account | Read the Twilio account the connector works with: friendly_name, status (active, suspended, closed), type (Trial or Full)… |
twilio_get_balance | Read the account balance and its currency |
twilio_list_messages | List SMS, MMS and WhatsApp messages of the account, newest first, with sid, from, to, body, status (queued, sending, sent, delivered… |
twilio_get_message | Read one message by its sid (SM... or MM...): status, error_code and error_message when it failed, price, segments, sender and recipient… |
twilio_send_message | Send an SMS, MMS or WhatsApp message |
twilio_cancel_scheduled_message | Cancel a message that was scheduled with schedule_type fixed and has not been sent yet; its status becomes canceled |
twilio_list_message_media | List the media (images, files) attached to an MMS or WhatsApp message, with each item's sid and content_type |
twilio_delete_message | Delete a message record from the account for good, including its body |
twilio_list_calls | List phone calls of the account, newest first, with sid, from, to, status, direction, duration (seconds), price, start_time and end_time |
twilio_get_call | Read one call by its sid (CA...): status, direction, from and to, duration, price, answered_by, parent_call_sid and the start and end times |
twilio_list_phone_numbers | List the phone numbers the account owns, with sid (PN...), phone_number, friendly_name, capabilities (voice, sms, mms, fax), the voice and… |
twilio_get_phone_number | Read one owned phone number by its sid (PN...): number, capabilities, webhooks, emergency address status and bundle |
twilio_list_messaging_services | List the Messaging Services of the account (Messaging API v1), with sid (MG...), friendly_name, use case and settings |
twilio_lookup_phone_number | Look up a phone number with Lookup v2 |
twilio_list_verify_services | List the Verify services of the account (sid VA..., friendly_name, code_length, enabled channels) |
twilio_send_verification | Send a one-time code through a Verify service by SMS, voice call, WhatsApp or email |
twilio_check_verification | Check the code a person received from twilio_send_verification |
twilio_get_verification | Read a verification by its sid (VE...): to, channel, status (pending, approved, canceled, max_attempts_reached, deleted, failed, expired)… |
twilio_list_usage_records | List usage and cost per category for a date range: category, description, count with count_unit, usage with usage_unit, price and price_unit |
twilio_list_usage_records_by_period | List usage and cost per category split into periods (one record per category and day, month or year), or for a fixed window: Today… |
示例提示
- “显示我们今天发送的 SMS 和 WhatsApp 消息,并标出发送失败或未送达的消息及其错误代码。”
- “我们这个月在 Twilio 上按类别各花了多少钱?剩余余额是多少?”
- “检查 +4915112345678 是否是有效号码,以及它属于哪个国家。”
- “从我们的 Twilio 号码向 +4915112345678 发送一条 SMS,告诉客户订单 1042 已发货,明天送达。”
FAQ
ChatGPT 免费套餐能用自定义 MCP 连接器吗? 不能。自定义 MCP 连接需要开发者模式,只有付费套餐提供。
下一步
这份指南对你有帮助吗?