Send Physical Mail from Claude Code

Wire Agent Mail 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. Agent Mail 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 --transport http agent-mail https://example.com/mcp

Replace the URL with whatever Agent Mail's MCP endpoint is for you. After that, the agent has send_letter, send_postcard, get_mail_status, and list_sent_mail 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",
        "physical-mail-mcp"
      ],
      "env": {
        "MAIL_PROVIDER": "managed",
        "MAIL_API_BASE_URL": "https://api.mailsnail.dev"
      }
    }
  }
}

See also