Give Claude Code its own email address
Connect Claude Code to a Mailly inbox over Remote MCP so it can read mail, save reply drafts and send after you approve the exact text.
Claude Code can work from a real inbox: search threads, read incoming mail, save reply drafts and send once you approve the final text. Mailly gives it an address such as your-name@mailly.site (or one on your own domain) and connects over Remote MCP, so nothing runs on your machine.
What you get
- A two-way inbox on
@mailly.site, or on your own domain on the Developer plan. - About 70 typed MCP tools for threads, drafts, sending, domains, contacts, templates, campaigns and workflows, limited to the permissions you grant.
- Sending under your control: Claude Code shows the exact text and recipients, and sends only after you confirm.
- The same inbox in the Mailly workspace, the CLI and the HTTP API.
Get an inbox
Already have a Mailly account? Skip to the next step.
Paste this prompt into Claude Code. It reads Mailly's setup instructions, asks for the name you want, reserves it over HTTP and gives you a verification link.
Read https://mailly.site/auth.md
and set up a Mailly inbox for me over HTTP.
Ask me for the name if unknown; if taken, ask for another,
with no blind retries.
Send me the verification link.
After I confirm the inbox in my browser,
store the API key securely, tell me the address,
and ask me before sending any email.Open the link, sign in or register with your own verified email, and confirm the inbox. Claude Code then receives the address and your account's API key. You can also start at mailly.site/onboard without an agent. See Let an agent set up an inbox for the rules.
Add the Mailly MCP server
claude mcp add --transport http --scope user mailly https://mcp.mailly.site/mcp--scope user makes Mailly available in all your projects. Leave it out to add Mailly to the current project only, or use --scope project to share the entry with your team through .mcp.json.
Sign in and choose permissions
In Claude Code, run /mcp, select mailly and authenticate. Your browser opens Mailly's sign-in and consent page, where you choose what Claude Code may do:
| Permission | What Claude Code can do |
|---|---|
mail:read | Read your inboxes, threads, sent mail, drafts and settings. Always granted. |
mail:draft | Save, edit and discard reply drafts. No sending. |
mail:send | Send replies, forwards and new emails you have reviewed. |
workspace:manage | Manage addresses, domains, templates, contacts, campaigns, workflows and webhooks. |
Start with mail:read and mail:draft if you only want summaries and drafts; add mail:send when you want Claude Code to send after your approval. To sign in from a shell instead, run claude mcp login mailly.
Share the server with a project
claude mcp add --scope project writes this to .mcp.json. You can also commit it by hand; each teammate signs in with their own Mailly account through /mcp.
{
"mcpServers": {
"mailly": {
"type": "http",
"url": "https://mcp.mailly.site/mcp"
}
}
}Headless runs
claude -p and Agent SDK runs can't complete OAuth. Sign in once from an interactive session (/mcp) or with claude mcp login mailly; Claude Code stores and refreshes the tokens. For CI, you can send your Mailly API key as a header instead. Claude Code expands ${VAR} in .mcp.json headers:
{
"mcpServers": {
"mailly": {
"type": "http",
"url": "https://mcp.mailly.site/mcp",
"headers": { "Authorization": "Bearer ${MAILLY_API_KEY}" }
}
}
}An API key carries full account access; permission scopes don't apply to it. Keep it in an environment variable, never in chat or committed files. Find it under Integration in the workspace.
Verify the connection
- Run
claude mcp list. Themaillyentry should show✔ Connected. - Ask Claude Code: "Use Mailly to list my inbox addresses and my five most recent threads." It should call
mailly_list_inbox_addressesandmailly_list_threads. - Send an email from your personal account to your Mailly address, then ask: "Read my latest Mailly thread and save a reply draft. Show me the exact text and don't send it." Claude Code calls
mailly_read_threadandmailly_save_draft. Approve or discard the draft in the conversation.
Use the CLI instead
Claude Code can also drive mailly-cli through its shell. Every command accepts --json, which suits agents.
npm install -g mailly-cli # Node.js 18+
mailly login # browser sign-in; --no-browser on remote machines
mailly inbox addresses list --json
mailly inbox threads list --jsonTroubleshooting
! Needs authentication: run/mcpand authenticate, or runclaude mcp login mailly.✘ Failed to connectwith anAuthorizationheader: Claude Code reports a rejected key as a failed connection. Check the key, or remove the header to use OAuth.claude mcp get maillyshows anIssue:line with the HTTP status.- A tool you expected is missing: it needs a permission you didn't grant. In
/mcp, choose Clear authentication, then authenticate again and grant the permission. Mailly never widens an existing grant on its own. - The browser redirect fails after sign-in: paste the full callback URL from the address bar into the prompt in Claude Code.
- No mail arrives: check the address in the workspace and look in the inbox's Spam folder.
- A send is refused: check your balance and limits with
mailly_account. The Free plan allows 100 send recipients per rolling 24 hours; see pricing.
To remove Mailly, run claude mcp remove mailly; Claude Code also deletes the stored tokens.
Overview
Step-by-step guides to connect Claude Code, Claude, ChatGPT, Codex, Cursor, VS Code Copilot, Gemini CLI and OpenClaw to a Mailly inbox over Remote MCP.
Claude.ai and Desktop
Add Mailly as a custom connector in Claude.ai or Claude Desktop so Claude can read your inbox, save reply drafts and send after you approve.