Skip to main content
Glama
ajemba

codasms-mcp

CODASMS MCP Server

从你的 AI 智能体接收一次性短信/OTP 验证码。 一个基于 MCP 的服务器,封装 CODASMS 经销商 API —— 获取号码、 等待验证码、释放号码 —— 覆盖 700+ 服务和 180+ 国家,仅在成功接收时付费。

License: MIT 传输方式: stdio + HTTP


该服务器让 AI 智能体(Claude Desktop、Cursor,或任何支持 MCP 的工具)能够以编程方式购买电话号码 并读取验证码。它是对公开的 CODASMS Reseller API 的轻量封装 —— 本身不包含任何业务逻辑;所有扣费和退款均由 API 服务端决定。

你需要自带 API 密钥。注册免费获取:https://codasms.com/reseller

工具

工具

功能

get_balance

查询当前可用余额。

list_services

可购买的服务,含实时价格和库存(可按 service / country 过滤)。

list_countries

可购买号码的国家(可选 service 过滤条件)。

get_number

为指定服务和国家购买号码。会扣费余额(20 分钟内未收到验证码则自动退款)。

wait_for_otp

轮询订单直到验证码到达(或超时 / 退款)。

check_order

对订单进行一次性状态查询。

release

取消订单并立即退款(除非验证码已到达)。

get_number 接受可选的 max_price_cents 参数(或设置 CODASMS_MAX_PRICE_CENTS), 这样自主智能体无法购买超出你设定上限价格的号码。

Related MCP server: agentline-mcp

快速开始(本地 / stdio)

export CODASMS_API_KEY=coda_live_xxxxxxxx   # from https://codasms.com/reseller
npx codasms-mcp

Claude Desktop

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "codasms": {
      "command": "npx",
      "args": ["-y", "codasms-mcp"],
      "env": { "CODASMS_API_KEY": "coda_live_xxxxxxxx" }
    }
  }
}

然后询问:"帮我获取一个英国 Telegram 号码并读取验证码。"

远程(HTTP)模式

相同的工具通过 Streamable HTTP 提供服务,因此你可以部署一个实例供多个用户使用 —— 每个用户发送自己的密钥作为 Bearer token(服务端不存储任何内容):

npm run build && npm run start:http     # listens on :8080, POST /mcp
POST /mcp
Authorization: Bearer coda_live_xxxxxxxx
Content-Type: application/json

src/http.ts 是一个可移植的 Node 服务器(支持 Deno Deploy、Railway、Fly 及任何容器)。 对于 Cloudflare Workers,将 Node 的 http 处理器替换为 fetch 处理器即可 —— src/server.ts 中的服务器工厂与传输层无关,无需修改。

配置

环境变量

用途

默认值

CODASMS_API_KEY

你的 coda_live_ 经销商密钥(stdio 模式)。

—(必填)

CODASMS_API_BASE

API 基础 URL。

https://api.codasms.com

CODASMS_MAX_PRICE_CENTS

get_number 的全局价格上限,单位为美分。

未设置

PORT

HTTP 模式端口。

8080

注意事项

  • 速率限制: API 每个密钥允许 60 次请求/分钟;wait_for_otp 默认轮询间隔不低于 5 秒, 以确保远低于该限制。

  • 资金安全: get_number 在调用时立即消耗真实余额。如果验证码未到达, 订单将在 20 分钟后自动退款,或调用 release 立即退款。

  • 代码: 服务和国家使用 API 的代码(例如 tgwa、国家代码 6)—— 使用 list_services / list_countries 来查询。

开发

npm install
npm run build      # tsc -> dist/
npm start          # stdio

许可证

MIT —— 参见 LICENSE

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Real SIM-backed mobile numbers for AI agents to receive SMS and OTP codes.

  • Virtual phone numbers for AI agents — rent numbers in 200+ countries, receive SMS.

  • Real physical SIMs for AI agents: SMS verification and rentals. 145+ countries, 2500+ services.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ajemba/codasms-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server