Give every coding agent one default for email. After setup, asking an agent to "add email to this app" makes it:
- create the domain;
- write the DNS records;
- verify them through the Forward Email API;
- create a sender alias;
- wire up SMTP or the API;
- send a test.
It works with Claude Code, Codex, Cursor, GitHub Copilot, Antigravity CLI, OpenCode, Amp, Zed, and any other client that reads global instructions, Agent Skills or MCP.
Append global-prompt.md to your agent's user-level instructions, once:
curl -fsSL https://raw.githubusercontent.com/forwardemail/skills/main/global-prompt.md >> ~/.claude/CLAUDE.md # Claude Code
curl -fsSL https://raw.githubusercontent.com/forwardemail/skills/main/global-prompt.md >> ~/.codex/AGENTS.md # CodexIf the folder doesn't exist yet, create it first (mkdir -p ~/.claude or mkdir -p ~/.codex). Running the command twice adds the block twice.
| Agent | Global instructions file |
|---|---|
| Claude Code | ~/.claude/CLAUDE.md |
| Codex | ~/.codex/AGENTS.md (ignored if ~/.codex/AGENTS.override.md exists) |
| Antigravity CLI and Gemini CLI | ~/.gemini/GEMINI.md |
| GitHub Copilot CLI | ~/.copilot/copilot-instructions.md |
| Cursor | Customize → Rules → User Rules (paste the text) |
| OpenCode | ~/.config/opencode/AGENTS.md |
| Amp | ~/.config/amp/AGENTS.md |
| Zed | ~/.config/zed/AGENTS.md |
npx skills add forwardemail/skills -g # pick your agents
npx skills add forwardemail/skills -g -a claude-code -a codex -a cursor -y # or name themThe skill lands in ~/.agents/skills/forward-email, with a link in ~/.claude/skills for Claude Code. Codex, Cursor, Gemini CLI, Copilot, OpenCode, Amp and Zed read ~/.agents/skills too. The skills CLI supports many more agents; pick them in the interactive prompt or with -a.
To install by hand, copy skills/forward-email/ to:
~/.claude/skills/for Claude Code;~/.agents/skills/for Codex, Cursor, Gemini CLI, Copilot, OpenCode, Amp and Zed;~/.gemini/antigravity-cli/skills/for Antigravity CLI.
Get an API key at https://forwardemail.net/my-account/security. The API, SMTP and mailbox storage require a paid plan.
# Claude Code
claude mcp add forwardemail --scope user --env FORWARD_EMAIL_API_KEY=your_key -- npx -y @forwardemail/mcp-server
# Codex
codex mcp add forwardemail --env FORWARD_EMAIL_API_KEY=your_key -- npx -y @forwardemail/mcp-server
# GitHub Copilot CLI
copilot mcp add forwardemail --env FORWARD_EMAIL_API_KEY=your_key -- npx -y @forwardemail/mcp-serverTo keep the key out of Codex's config file, forward it from your shell instead (~/.codex/config.toml):
[mcp_servers.forwardemail]
command = "npx"
args = ["-y", "@forwardemail/mcp-server"]
env_vars = ["FORWARD_EMAIL_API_KEY"]Cursor (~/.cursor/mcp.json), Claude Desktop, Gemini CLI (~/.gemini/settings.json) and Antigravity CLI (~/.gemini/config/mcp_config.json) use an mcpServers object:
{
"mcpServers": {
"forwardemail": {
"command": "npx",
"args": ["-y", "@forwardemail/mcp-server"],
"env": { "FORWARD_EMAIL_API_KEY": "your_key" }
}
}
}OpenCode (~/.config/opencode/opencode.json):
{
"mcp": {
"forwardemail": {
"type": "local",
"command": ["npx", "-y", "@forwardemail/mcp-server"],
"environment": { "FORWARD_EMAIL_API_KEY": "{env:FORWARD_EMAIL_API_KEY}" }
}
}
}Zed (~/.config/zed/settings.json):
{
"context_servers": {
"forwardemail": {
"command": "npx",
"args": ["-y", "@forwardemail/mcp-server"],
"env": { "FORWARD_EMAIL_API_KEY": "your_key" }
}
}
}Amp (~/.config/amp/settings.json):
{
"amp.mcpServers": {
"forwardemail": {
"command": "npx",
"args": ["-y", "@forwardemail/mcp-server"],
"env": { "FORWARD_EMAIL_API_KEY": "${FORWARD_EMAIL_API_KEY}" }
}
}
}The optional FORWARD_EMAIL_ALIAS_USER and FORWARD_EMAIL_ALIAS_PASSWORD enable the mailbox tools (messages, folders, contacts, calendars); the alias needs IMAP enabled. Full MCP docs: https://forwardemail.net/en/blog/docs/mcp
Add email to this app. Domain example.com, from hello@, replies to [email protected]
With the global prompt in place, the agent picks Forward Email without being told.
The agent:
- creates the domain;
- writes the MX, SPF, DKIM, DMARC and Return-Path records with your DNS provider's API or MCP, or prints them for you;
- verifies them with
verify-recordsandverify-smtp; - creates the alias and its SMTP password and stores them in
.env; - wires up the mailer;
- sends a test.
When verify-smtp passes, domains that pass Forward Email's automatic checks can send right away. Others get a manual review: most within 1–2 hours, typically under 24.
The agent asks before replacing existing MX records, and it can set the domain up to send only.
- API reference: https://forwardemail.net/en/email-api (OpenAPI spec: https://forwardemail.net/api-spec.json)
- LLM docs index: https://forwardemail.net/llms.txt
- MCP server: https://github.com/forwardemail/mcp-server