Use asms with Codex
Add asms to Codex with one command. Codex can then get verification codes, rent numbers and read their SMS from your terminal, IDE or the Codex app.
> Get me a US number for Telegram and give me the code when it arrives.
● asms.get_pricing({ "country": "us", "service": "telegram" }) → in stock
US Telegram numbers are in stock at the listed price, and you're only charged if a code arrives. Order one?
> Yes, go ahead.
● asms.create_otp_order({ "country": "us", "service": "telegram" }) → +1 347 •••-••18
● asms.poll_sms({ "orderId": "…" }) → code received
Your number is +1 347 •••-••18 and the Telegram code is 504913.
What you can ask Codex
Once asms is connected, Codex can order numbers, read the SMS they receive and check your account, all paid from your asms wallet.
Get a verification code
“Order a UK number for WhatsApp and wait for the code.”
Rent a number you keep
“Rent a US number for a month for our app's SMS login tests, and show me any texts it gets.”
Check the account
“What's my asms balance, and which orders are still waiting for a code?”
Setup
Sign in with your asms account, or use an API key from your dashboard. Either way Codex uses your asms wallet.
The quick way: paste a prompt
Paste this into Codex. It reads this page and follows the steps for agents below.
Connect the asms MCP server to Codex by following the steps for AI agents at https://asms.ai/agents/codex. My asms API key is in the ASMS_API_KEY environment variable; don't print it.Or step by step
- 1
Add the server with your API key
Keep your key in ASMS_API_KEY; Codex reads it from the environment and never stores it.
API keycodex mcp add asms --url https://asms.ai/mcp --bearer-token-env-var ASMS_API_KEY - 2
Or sign in with asms
sign incodex mcp add asms --url https://asms.ai/mcp codex mcp login asms - 3
Check it
Or type /mcp in Codex. The CLI, the IDE extension and the Codex app share this setup (~/.codex/config.toml).
should list asmscodex mcp list
For AI agents reading this page
If a user asked you to connect asms to Codex, follow these steps in order.
- Check whether the ASMS_API_KEY environment variable is set, without printing its value. If it is not set, the user can either sign in with asms when Codex prompts for it, or create a key at https://asms.ai/dashboard#api-keys and set ASMS_API_KEY.
- Register the server: run `codex mcp add asms --url https://asms.ai/mcp --bearer-token-env-var ASMS_API_KEY` (or without the flag, then `codex mcp login asms` for the user to sign in).
- Check it worked: run `codex mcp list` and confirm asms is listed and enabled.
- Ask the user to start a new Codex session (`codex resume --last` keeps the conversation) so the tools load.
- Start read-only: call
get_balance, thenget_pricingorget_rental_offers, and report what you found. - Before any tool that spends from the wallet (
create_otp_order,rent_number), tell the user the price and wait for their OK. - Never create an asms account or API key, top up the wallet, or approve a sign-in on the user's behalf, and never print the key.
Reference
| MCP endpoint | https://asms.ai/mcp |
| Transport | Streamable HTTP (stateless) |
| Auth | OAuth sign-in with asms, or the header Authorization: Bearer <ASMS_API_KEY> |
| REST API | https://asms.ai/api-docs |
| For LLMs | https://asms.ai/llms.txt |
Tools
| Tool | What it does | Needs your OK? |
|---|---|---|
get_balance | Wallet balance | No |
get_pricing | Verification code prices | No |
get_inventory | Verification number stock | No |
create_otp_order | Order a verification number | Yes |
poll_sms | Check for the verification code | No |
list_active_orders | List verification orders | No |
cancel_order | Cancel a verification order | Yes |
get_rental_offers | Number rental prices | No |
rent_number | Rent a phone number | Yes |
list_rentals | List rented numbers | No |
read_rental_sms | Read a rented number's SMS | No |
cancel_rental | Cancel a rental for a refund | Yes |
Other agents and tools
Questions
What does the config look like?+
codex mcp add writes this to ~/.codex/config.toml: [mcp_servers.asms] url = "https://asms.ai/mcp" and bearer_token_env_var = "ASMS_API_KEY". You can also add it there by hand.
What does it cost?+
Connecting is free. You pay from your asms wallet: verification codes from $0.50, charged only when a code arrives and refunded automatically when none does, and rented numbers priced by country and period. Top up by card, PayPal or crypto.
Will Codex spend money without asking?+
Ordering a code and renting a number are marked as spending tools, so clients that support it ask for your approval first, and asms tells the agent to confirm the price with you before buying. Reading prices, balances and messages never spends anything.
What's the difference between a code and a rented number?+
A verification code order gives you a number for one code, for one service, and refunds itself if nothing arrives. A rented number is yours for a set period, from a day to a year, and receives every SMS sent to it: useful for testing your own app's SMS login or for an account you'll need to verify again later.
How do I disconnect it?+
Delete the API key in your asms dashboard, or remove asms under Connected apps if you signed in. Either one cuts off access straight away.
Give Codex a phone number
Create an account, top up from a few dollars, and connect. Codes from $0.50, refunded automatically when none arrives.