agent-mail-mcp
MCP server that lets AI agents create reviewable physical mail drafts, validate quotes, and pay for postage via MPP or x402 protocols.
README
agent-mail-mcp - Send physical mail from an AI agent
An open MCP server for physical mail. Use PostalForm to create reviewable mail drafts, hosted checkout sessions, validate-only quotes, and explicitly approved agent-payable mail through MPP (Machine Payment Protocol) or x402 physical mail.
This repo is the reference implementation and example pack for terms like "send physical mail from an AI agent", "MCP server for physical mail", "agent-payable mail", "x402 physical mail", "pay for mail with x402", and "MPP mail".
Quick Start
Run the local stdio MCP server:
npm install
npm run server
Or configure an MCP client to run it from npm after publication:
{
"mcpServers": {
"agent-mail": {
"command": "npx",
"args": ["-y", "@postalform/agent-mail-mcp"]
}
}
}
The local server exposes safe agent-mail tools:
| Tool | Purpose | Side effect |
|---|---|---|
agent_mail_discovery |
Returns PostalForm MCP, OpenAPI, x402, A2A, and docs URLs | Read-only |
list_postalform_tools |
Lists live PostalForm remote MCP tools | Read-only |
validate_letter_mail |
Validates and quotes a letter machine-order payload | No payment, printing, or mailing |
create_letter_checkout_draft |
Creates an unpaid hosted-checkout draft | No mail is sent until checkout is reviewed and paid |
Remote PostalForm MCP
If your client supports remote streamable HTTP MCP servers, you can connect directly:
https://postalform.com/mcp
For most agents, the default pattern should be:
draft -> preview -> approve/pay -> send -> track
Hosted checkout is the safer default for chat-style assistants because the owner reviews the PDF, sender, recipient, mailing options, and price before PostalForm prints or posts real mail. The local confirm_create_unpaid_draft flag is a soft client-side guard for creating an unpaid draft, not proof of human payment approval.
Validate Before Paying
Validate a machine-order payload without sending mail:
POSTALFORM_VALIDATE_EXAMPLE=1 npm run rest:validate-letter
Direct MPP (Machine Payment Protocol) or x402 machine payment should only be used when the runtime already has explicit owner approval, a spend limit, and retry-safe request IDs.
Examples
| Path | What it demonstrates |
|---|---|
| examples/01-claude-mcp | Claude Desktop and Claude Code setup for a local agent-mail MCP server |
| examples/02-send-a-letter | Creating an unpaid PostalForm checkout draft for one letter |
| examples/03-x402-paywalled-send | Validate-first x402 and MPP machine-order payloads |
| examples/04-langchain-tool | Wrapping PostalForm validation as a LangChain-style tool |
| examples/05-openai-responses-mcp | OpenAI Responses API remote MCP configuration |
Discovery
Canonical PostalForm URLs:
| Field | URL |
|---|---|
| MCP endpoint | https://postalform.com/mcp |
| Developer docs | https://postalform.com/developers |
| Agent guide | https://postalform.com/agents |
| OpenAPI | https://postalform.com/openapi.json |
| MCP registry manifest | https://postalform.com/.well-known/mcp/server.json |
| MCP server card | https://postalform.com/.well-known/mcp/server-card.json |
| A2A Agent Card | https://postalform.com/.well-known/agent-card.json |
| x402 discovery | https://postalform.com/.well-known/x402 |
| LLM overview | https://postalform.com/llms.txt |
Run the live discovery check:
npm run check:discovery
Repository Map
| Path | Purpose |
|---|---|
| src/server.mjs | Local stdio MCP server for agent-mail discovery, validation, and unpaid checkout drafts |
| .well-known/mcp.json | Repo-level MCP discovery descriptor |
| manifest/mcp-server.json | Directory-ready local MCP server descriptor |
| manifest/x402-payment.json | x402 physical mail payment descriptor |
| docs/quickstart.md | First-run guide |
| docs/tools-reference.md | Tool behavior and side-effect reference |
| docs/machine-payments.md | MPP and x402 guidance |
| docs/compliance.md | Abuse, privacy, and approval guidance |
| docs/directory-listing.md | Copy-paste directory listing fields |
Directory-Ready Summary
PostalForm is a remote MCP server and physical-mail API for AI agents. Agents can create reviewable mail drafts from PDFs, text, HTML, Markdown, RTF, or form payloads, return hosted checkout for human approval, or use owner-approved MPP/x402 machine-payment flows to pay for and track real postal mail.
Safety Defaults
- Prefer hosted checkout for chat-style agents.
- Require approval before sharing private documents, addresses, or payment credentials.
- Use stable
request_idvalues for direct machine-payment retries. - Show a PDF preview when available before payment.
- Enforce spend limits outside the model prompt.
- Do not use PostalForm for spam, harassment, illegal content, checks, keys, packages, notarization, process serving, or legal advice.
Maintainers
Maintained by PostalForm and Gabriel Garrett (ggaabe), who also maintains rrule-temporal.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。