Send Physical Mail from Claude Code

Wire Mailsnail into Claude Code with one command and your terminal-resident agent can drop letters in the mail. End-to-end setup, tool reference, and a worked example.

claude-codemcptutorial

· Updated

Why this is interesting

Claude Code already runs your terminal: it can edit files, hit APIs, run tests, deploy. The one thing it couldn't do until recently was reach the physical world. Mailsnail closes that gap. Once you've registered the MCP server, the agent can call send_letter and a real, postmarked envelope shows up at any US address.

One-line setup

From inside any Claude Code project:

claude mcp add mailsnail -- npx -y mailsnail

Then set MAIL_PROVIDER=managed and MAIL_API_BASE_URL=https://api.mailsnail.dev in your Claude Code env (see /setup for the exact config). After that, the agent has verify_address, send_letter, send_postcard, get_letter, list_letters, and cancel_letter available the next time it's invoked.

A worked example

In a Claude Code session:

Send a thank-you note to my landlord at 1 Main St, Brooklyn NY 11201, signed from "Resident in 4B," thanking her for the quick repair this morning.

The agent calls send_letter with the recipient address and a short body, gets back a tracking ID, and the letter goes out the same business day.

What to do next

  • Walk through the full setup page for screenshots and edge cases.
  • Read the complete tool reference if you want to give the agent richer instructions.
  • Look at the OpenAPI spec if you'd rather call the HTTP API directly.

Wire Mailsnail into your agent

Drop this into your client's MCP config (or use /setup for one-line installs).

mcp.json
{
  "mcpServers": {
    "mailsnail": {
      "command": "npx",
      "args": [
        "-y",
        "mailsnail"
      ],
      "env": {
        "MAIL_PROVIDER": "managed",
        "MAIL_API_BASE_URL": "https://api.mailsnail.dev"
      }
    }
  }
}

See also