---
title: "Mail letters and PDFs from Codex"
description: "Add SendForMe to Codex CLI, the Codex IDE extension or the Codex app with two commands. Codex can write letters, mail PDFs from your disk and track them."
url: https://sendforme.co/agents/codex
updated: 2026-11-29
---

# Mail letters and PDFs from Codex

> Run codex mcp add sendforme --url https://sendforme.co/mcp, then codex mcp login sendforme. The login opens a tab that signs you in by itself, with nothing to fill in. Codex CLI, the IDE extension and the Codex app share ~/.codex/config.toml, so one setup covers all three.

**Say to your agent:** "Mail ./contracts/notice.pdf to our landlord at 900 Commerce St Ste 300, Dallas, TX 75202, certified with a return receipt."

Codex CLI, the Codex IDE extension and the Codex app share `~/.codex/config.toml`, so one setup covers all three.

## Install in Codex

### Two commands

```bash
codex mcp add sendforme --url https://sendforme.co/mcp
codex mcp login sendforme
```

The second line opens a browser tab that signs you in by itself. Check it with `codex mcp list`, or `/mcp` inside a session.

### Or edit config.toml

Add this to `~/.codex/config.toml`:

```toml
[mcp_servers.sendforme]
url = "https://sendforme.co/mcp"
```

Restart Codex, then run `codex mcp login sendforme`.

### In the app or IDE extension

- **Codex app:** open **Settings**, then **MCP servers**, then **Add server**. Name it `sendforme`, choose **Streamable HTTP**, paste `https://sendforme.co/mcp`, save, click **Restart**, then **Authenticate**.
- **IDE extension:** gear menu, then **MCP servers**, then **Add server**, with the same details, then **Restart extension**.

## Signing in

`codex mcp login sendforme` opens a tab that closes by itself. There's no email, no form and no card. That creates your SendForMe account.

## Using an API key

On a server, in CI, or anywhere a browser can't open, use a key instead:

1. Make a key on the [account page](/account). It starts with `sfm_`.
2. Export it: `export SENDFORME_KEY=sfm_...`
3. Point Codex at it in `~/.codex/config.toml`:

```toml
[mcp_servers.sendforme]
url = "https://sendforme.co/mcp"
bearer_token_env_var = "SENDFORME_KEY"
```

Codex sends it as `Authorization: Bearer`, and letters go straight to your account with no setup link while there's credit. For unattended runs, set a price limit and a longer undo window: see [approvals and limits](/docs/approvals-and-limits).

## Your first letter

The first time Codex sends a real letter, SendForMe returns a setup link like `https://sendforme.co/go/QF6S-2U4Z` and Codex shows it. Open it, check the proof, and add credit once. Codex waits with `wait_for_setup`; the letter goes out by itself once you pay. After that, letters go straight out with a 10-minute undo window. More in [setup links](/docs/setup-links).

## Things to try

> Mail ./out/invoice-1042.pdf to Ridgeline Print Co, 220 Elm St, Austin, TX 78701. First-Class. Tell me if it needs an address page.

> Write a records request letter to Parkland Family Medicine for my full chart under HIPAA, from my notes in requests.md. Show me the proof.

> We're moving offices. Mail the notice in notice.md to every customer in customers.csv. Preview the batch and show me the total before sending.

## Tips for Codex

- **PDFs:** Codex uploads with `curl -T ./file.pdf "<upload_url>"`. In a sandbox without network access for shell commands, allow the network for that step, or pass a public https URL instead.
- **Address pages:** if page 1 of your PDF has content in the top-left 4.7 x 3 inches, an address page is added in front (one extra page). See [bring your own PDF](/docs/bring-your-own-pdf).
- **Approvals:** Codex asks before running tools that change things. Approve `send_letter` once you've seen the proof.
- **Scripts:** if your own code decides what to mail (no model in the loop), the [REST API](/docs/rest-api) with an `Idempotency-Key` is simpler than MCP.
- **Follow-ups:** "check on the invoice letter" calls `get_letter` with the current status and, for certified mail, the USPS tracking number.

## The skill

Codex reads Agent Skills too. Save [https://sendforme.co/skill.md](https://sendforme.co/skill.md) into your skills folder as `sendforme/SKILL.md` and Codex follows the guide, preview, proof, send, track flow without extra prompting.

## Related

- [Claude Code](/agents/claude-code)
- [ChatGPT](/agents/chatgpt)
- [MCP reference](/docs/mcp)

## FAQ

### Do I have to run codex mcp login?

It's best to. Without it, SendForMe still works, but each new Codex session starts without an account and shows a fresh setup link for its first letter. Logging in keeps one account across sessions.

### Can Codex mail a PDF from my repo?

Yes. It calls upload_file, runs curl -T on the file, and previews the letter with the upload id.

### Does the SendForMe key replace my OpenAI login?

No. Codex still needs its own OpenAI sign-in or API key to run. The SendForMe key only covers mailing letters.
