# Give an AI Agent a Real Email Inbox over Remote MCP (with Human Approval)

> Source: <https://dev.to/emailforagents/give-an-ai-agent-a-real-email-inbox-over-remote-mcp-with-human-approval-3kgb>
> Published: 2026-11-24 06:07:55+00:00

**Recommendation:** Give each agent its own inbox with read-and-draft scopes plus human approval, and omit ungranted tools from tools/list so injected email text cannot invoke send.
More in the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

**By Aljay Miskino, VP of Partnerships at Email for Agents**

If you have already wired an AI agent into Claude Code, Cursor, or another MCP client, the next request is often: “now let it handle email.” The usual shortcuts are to connect a personal Gmail account or to stand up a send-only API. Both work for a demo. Both get awkward in production: the agent either borrows a person’s identity, or it can send mail but cannot own a conversation.

This walkthrough shows a third shape: give the agent its own inbox, connect it over remote MCP with OAuth, and keep a human in control of what actually leaves. The examples use [Email for Agents](https://emailforagents.ai/docs/quickstart), where I work. The same design questions apply if you build the mailbox yourself.

Sign in to the console, create a project, and create an inbox in it. The address you get depends on the project’s environment:

`.mail.invalid`. It uses a simulated transport. You cannot ask for a custom local part or a custom domain there — that restriction is what makes it safe to point an unproven agent at.`ada@agents.emailforagents.ai`). Custom domains are a later, paid-plan step.
Do the first end-to-end test in a test project. If the agent tries to send to a real person, the message cannot leave.

The MCP endpoint is:

```
https://mcp.emailforagents.ai/mcp
```

Paste that URL into the client’s remote MCP settings, start the connection, and sign in in the browser window that opens. On the consent screen you pick:

The grant expires after 30 days and can be revoked sooner. The server identifies itself as `email-for-agents-mcp` and expects a client that supports remote MCP and OAuth (authorization code with S256 PKCE). A project API key (`efa_live_…` or `efa_test_…`) presented at `/mcp` is rejected on purpose. If your client cannot do OAuth, use the REST API at `https://api.emailforagents.ai/v1` instead — same permissions, same send pipeline, different credential.

No named client is certified or one-click. Claude Code, Claude Desktop, and Cursor are listed as testing targets only. Connect one, then prove a round trip in a test project before you rely on it.

The server exposes six tools. A tool the grant does not cover is omitted from `tools/list`, not merely refused at call time.

| Tool | Needs | What it does | 
|---|---|---|
| `list_inboxes` | read | Lists the inboxes this grant covers | 
| `list_threads` | read | Lists conversations in one inbox | 
| `list_messages` | read | Lists message ids, recipients, attachment metadata, and previews | 
| `get_message` | read | Reads one message body, bounded in size | 
| `create_draft` | draft | Composes a new message or a threaded reply. It cannot transmit mail | 
| `send_message` | send | Transmits a message, still subject to the inbox’s approval policy | 

A `read` grant sees four tools. Adding draft adds `create_draft`. Only a send grant sees `send_message`. Before the draft tool runs, the send scope is stripped from the calling principal, so draft access is not a side door into sending.

That filtering is the point of using MCP this way. A hostile email body is untrusted text in the model’s context. It can argue. It cannot invoke a tool the session never advertised.

Permission on the grant is only half of the control plane. Each inbox can also:

Approvals are a record with a lifecycle, not a label you invent in your own code. A held send expires if nobody acts on it (seven days in the current product). The decision is bound to the exact draft that was reviewed; if the body or recipients change, the approval does not apply to the new version.

For a support-triage agent, a typical setup is **read and draft** plus “ask me first.” For invoice intake that should never reply, use **read** only and do not grant send. For follow-ups to people you already know, you might grant send and restrict the allow list to one domain, with a daily cap.

If you call REST instead of MCP, send with an `Idempotency-Key` on every request that can transmit mail. The same key and the same body return the original result. A retry does not produce a second email. A key reused with a different body is a conflict, which is almost always a bug in the client.

Treat inbound mail, links, and attachments as untrusted data. Permissions come from the grant you configured, never from the text of a message. The product does not claim to be prompt-injection proof — that is why the approval queue exists.

`list_inboxes` only returns the inboxes you picked.
If you want the worked quickstart, including client-specific setup steps, it lives in the [Email for Agents docs](https://emailforagents.ai/docs/quickstart). Read it, then run the first mail in test mode.

*Aljay Miskino is VP of Partnerships at Email for Agents (emailforagents.ai).*
