x402-sms-mcp
A paid MCP server that lets AI agents send SMS messages to US phone numbers via x402 micropayments, with automatic compliance and opt-out handling.
README
x402-sms-mcp
A paid MCP server that lets AI agents send SMS messages to US phone numbers.
Each send_sms tool call:
- Sends a transactional SMS via a verified toll-free number
- Auto-appends
Reply STOP to opt outif the body doesn't include opt-out language - Costs $0.03 USDC per message, paid automatically from the configured wallet via x402
No API keys. No Twilio account. The agent pays the toll, the message goes out.
Status (2026-05-22): Public beta on Base Sepolia (testnet). The seller's toll-free number is undergoing Twilio TFV approval (submitted 2026-05-14, still in queue). During this window
/sendcalls short-circuit to a503 delivery_pending_tfv_approvalresponse before the buyer wallet signs anything, so no USDC is moved. The day Twilio approves the number, delivery flips on; pricing flips to Base mainnet shortly after.
Install in Claude Desktop / Cursor / Windsurf
Add this to your MCP config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"x402-sms": {
"command": "npx",
"args": ["-y", "x402-sms-mcp"],
"env": {
"BUYER_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY"
}
}
}
}
Restart your MCP client. A send_sms tool will appear.
What you need
A wallet on Base Sepolia (testnet) funded with:
- A small amount of ETH for gas (free from https://www.coinbase.com/faucets/base-ethereum-sepolia-faucet)
- USDC for payments (free from https://faucet.circle.com, select Base Sepolia)
Generate a throwaway key:
node -e "const {generatePrivateKey,privateKeyToAccount}=require('viem/accounts');const k=generatePrivateKey();console.log('PRIVATE_KEY=',k);console.log('ADDRESS=',privateKeyToAccount(k).address)"
Use the printed address to claim from faucets, then put the printed key into your MCP config.
Try it
In Claude Desktop, ask:
Text my cell at +15551234567 when this long-running task finishes. The recipient (me) consents to receive this message.
Claude will call send_sms with opt_in_attestation: true. You'll get back a Twilio SID + the on-chain settlement hash. The transfer is visible at https://sepolia.basescan.org.
Compliance — please read
This MCP wraps a regulated SMS gateway. The operator (you) is responsible for ensuring every recipient has consented to receive messages before invoking send_sms. The opt_in_attestation: true argument is your legal attestation under TCPA and CTIA short-code/long-code rules.
Do NOT use this MCP to:
- Send marketing or promotional content
- Text strangers, scraped lists, or anyone who hasn't opted in
- Send to non-US numbers (the seller currently rejects non-
+1E.164) - Send anything related to S.H.A.F.T.-C (Sex, Hate, Alcohol, Firearms, Tobacco, Cannabis)
The seller-side automatically:
- Appends
Reply STOP to opt outto every message - Honors carrier-level STOP/HELP keyword handling
- Logs each send for audit purposes
If you have any doubt about consent, do not call this tool.
Configuration
| Env var | Required | Default |
|---|---|---|
BUYER_PRIVATE_KEY |
yes | — |
SMS_URL |
no | https://x402-sms-server-production.up.railway.app/send |
To point the MCP server at your own seller deployment, override SMS_URL.
Errors you might see
The MCP surfaces three distinct error shapes so the model can explain what happened to the user and decide whether to retry.
| Cause | What you'll see in chat | Was payment taken? |
|---|---|---|
Seller's toll-free number still in TFV review (HTTP 503) |
"SMS not sent — service is in pre-launch wait" + the seller's submitted date and retry guidance | no |
Buyer wallet exceeded per-minute/hour/day rate limit (HTTP 429) |
"SMS not sent — this buyer wallet hit the per-X rate limit" + retry_after_seconds |
no |
Twilio-side rejection (e.g. invalid number 21211, opted-out 21610) |
Friendly hint mapped from the Twilio error code + the full response body | yes (the send tried) |
For the full mapping of Twilio error codes the MCP recognizes, see TWILIO_HINTS in src/index.ts.
How it works
Claude Desktop ──tool call──> MCP server (this package, on your machine)
│
│ x402 payment (USDC, Base Sepolia)
│ + to/message/opt_in_attestation
▼
Public seller (Hono + Twilio on Railway)
│
│ Twilio dispatch
▼
SMS lands on recipient's phone
│
│ Twilio SID + status
▼
MCP server ──tool result──> Claude Desktop
The MCP server doesn't talk to Twilio directly. It signs an x402 payment with the buyer's wallet, sends the payment + message details to the seller endpoint, and the seller's verified toll-free number dispatches the SMS. Your private key never leaves your machine. The seller never sees it.
Roadmap
- Now (2026-05-22): Base Sepolia testnet, TFV pending. Payment flow verified end-to-end; deliveries gated on Twilio approval.
- Once TFV clears: Real US SMS delivery, testnet pricing held while we collect early traffic.
- A few weeks out: A2P 10DLC Brand approval → higher per-day throughput tier.
- Mainnet flip: Production launch, USDC settles on Base mainnet; Solana facilitator on roadmap after.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。