Send Letters from Codex

Add Mailsnail to Codex with two commands, ask for a letter, read the proof, and pay for that letter by card. From $1.51, with no subscription.

codexmcptutorial

Add Mailsnail to Codex

  1. Run the first command in a terminal to add the server.
  2. Codex may open our sign-in page right away. If it does not, or you closed it before finishing, run the second command. The first time, you create your Mailsnail account on that page.
  3. Ask for your letter in a new chat: “Use Mailsnail to mail a letter for me.” Give it the recipient’s name and address, your return address and what the letter should say. You see the proof and the price before anything is mailed.
codex mcp add mailsnail --url https://api.mailsnail.dev/mcp
codex mcp login mailsnail

Adding the server and signing in are two steps. Until the sign-in is done, Codex asks our server at every start and is turned away, and the Mailsnail tools are not there. In a terminal with no browser of its own (over SSH, in a container), run codex mcp login mailsnail --no-browser and open the address it prints.

Menus move. These steps were checked against OpenAI’s page on MCP servers in Codex on November 18, 2026.

Codex already reads your code and runs your commands. With Mailsnail added it can also put a real letter in the US mail: it checks the address, shows you a proof and the exact price, and mails the letter when you say so. Nothing to install, no API key, and you pay only for the letters you send.

Signing in is its own step

Adding the server and signing in are two steps. codex mcp add may open our sign-in page right away. If it did not, or the page was closed before you finished, Codex keeps the server and has no sign-in for it: it then asks our server for its tools at every start and is turned away, and the mail tools are not there. If you added Mailsnail a while ago and Codex has never offered to mail anything, this is the likely reason, and codex mcp login mailsnail puts it right.

  • On a machine with a browser, codex mcp login mailsnail opens our sign-in page. There is no sign-up form on this website: the first time, you create your account on that page with an email and a password.
  • Over SSH, in a container or on a remote box, run codex mcp login mailsnail --no-browser. It prints the sign-in address; open it in a browser and sign in.
  • To check, type /mcp in Codex to see its servers.

The app and the IDE extension share the setup

The Codex CLI, the Codex IDE extension and the ChatGPT desktop app share one configuration, so Mailsnail added in one is there in all three. To add it without a terminal:

  • ChatGPT desktop app: open Settings, then MCP servers, then Add server. Name it mailsnail, choose Streamable HTTP and paste https://api.mailsnail.dev/mcp. Save, then select Restart.
  • IDE extension: open the gear menu, then MCP servers, then Add server, and fill in the same. Save, then select Restart extension.
  • In both, select Authenticate next to mailsnail to sign in.

Or write it into ~/.codex/config.toml yourself, and then sign in as above:

[mcp_servers.mailsnail]
url = "https://api.mailsnail.dev/mcp"

Ask for a letter

Once Mailsnail is added and signed in, ask the way you would ask a person:

Mail a letter to Jane Doe, 1 Main St, Brooklyn NY 11201, from me at 500 Oak Ave, Austin TX 78701. Thank her for the referral and say I will call next week. Show me the proof and the price first.

Codex works through four steps:

  1. verify_address checks the recipient against USPS records. Free.
  2. preview_letter lays the letter out and returns a proof PDF with the exact price. Free: nothing is charged or mailed.
  3. You open the proof and say yes, or ask for changes and get a new proof.
  4. send_letter mails exactly the proof you approved, and hands back a receipt that get_letter later turns into the letter's status.

The letter can be text Codex writes, text from a file in your project, or a finished PDF at a public address. For Certified Mail, with or without a return receipt, say so in the request.

What it costs

A one-page first-class letter is $1.51 paid by card, or $1.21 from a prepaid balance. Certified Mail is $8.83 by card, or $8.61 from a balance. Those are our own costs with no markup, and there is no subscription. The proof shows the exact price of your letter before you pay anything. See all prices and how they compare with fourteen other services.

Paying for it

You do not set up payment first. The first time you approve a letter, send_letter answers with a link instead of mailing it: a Mailsnail page where you pay for that one letter by card. Your card is not saved. Pay, tell Codex you have paid, and it sends the same letter again. This time it is mailed.

  • Several letters at once. Approve them all. From the second one on, the answer also carries a single link that pays for every letter waiting, in one payment.
  • Many letters over time. Ask Codex to add funds, from $10. Letters then cost the lower balance price.
  • Paying later is fine. A proof you approved keeps for seven days, so Codex sends that same proof and does not have to make a new one.

Good to know

  • Read the proof before you say yes. A letter can be cancelled only until the printer starts on it, usually about a day. The proof is free, so there is never a reason to skip the look.
  • Addresses in a file work well. Point Codex at a CSV or JSON file of recipients and ask for a proof for each.
  • Have Codex save each receipt. Ask it to write the receipt from every send_letter to a file in the project. A new session can then look a letter up with get_letter; without the receipt it cannot.
  • US addresses. Letters are printed and mailed on the next business day, then travel by USPS.
  • Signed out later? Run codex mcp login mailsnail again. Your balance and your letters are kept on our side, not in Codex.

Using another app as well?

One Mailsnail account works in every app you sign in from, with the same balance: Claude, ChatGPT, Claude Code, Cursor, VS Code and Codex. Steps for every app →

See also