Blog / Agents
Give Claude, ChatGPT or Cursor safe access to email
- Don't give an AI agent your whole mailbox. Give it only the mailboxes, categories and days its task needs.
- Reading an email's text, writing drafts and sending should each be a separate permission, off until you need it.
- Prefer drafts you send yourself. If an agent sends on its own, limit it to replies, known people and a few a day.
Why "full access" is the wrong default
Most ways of connecting an agent to email give it everything: every message, every attachment, years of history, and often the power to send. That's convenient, and it's also the setup security researchers warn about. An agent that can read your private data, reads text written by strangers (every email is), and can send things out is exactly what a malicious email tries to exploit. We explain how in Prompt injection through email.
The fix is the same as for any other access: give the agent only what the task needs. It's also cheaper: an agent that reads everything spends most of its tokens on email it will never act on, as we show in Don't make your AI agent read your whole inbox.
What your agent gets through MailTag
MailTag already sorts every new email into your own categories. Its MCP server (https://mailtag.app/mcp) lets an agent work with that sorting, within limits you set per agent when you connect it:
| You choose | Options |
|---|---|
| Mailboxes | all of them, or some |
| Emails | all, some categories (for example only Urgent and Needs reply), or the emails in some of your saved views |
| How far back | 30 days, 7 days, today, or only from the moment you connect it |
| Sender | hidden, only the domain, or name and address |
| Subject | shown or not |
| Read and answered | shown or not |
| The email's text | no, or yes; opening attachments is a separate switch |
| Changes | none, or relabel emails and edit categories or views (editing only for an agent that sees all emails) |
| Drafts | off, or on: replies only or new emails too, with or without attached files |
| Sending | off, or on: replies only or new emails too, only to people you've replied to or anyone, up to 10, 50 or 200 a day |
| Dangerous emails | shown marked, or hidden: dangerous ones, or dangerous and doubtful (when you turn on the safety check) |
What it always gets, within that scope: each email's category, date, mailbox and Message-ID, and a link to open it. Everything else is off until you allow it.
When you allow the text, the agent can open just the few emails that matter, instead of reading everything to find them. MailTag fetches that email from your mailbox when asked and doesn't keep it.
Drafts land in your mailbox's Drafts folder, and you see a reply under the email in MailTag before you send it. Sending is a separate switch, and each sent email shows in the agent's activity. Replies always go to whoever wrote the email, an agent's email reaches at most 10 people, and it can't answer or forward an email the safety check marked dangerous. An agent can never delete email or move it out of your mailbox.
Connect it
You need a MailTag account with your mailbox connected. The MCP server comes with every plan, including the 7-day free trial. Then:
Claude (web and desktop)
- Go to Customize → Connectors, click + Add and Add custom connector.
- Give it a name (MailTag), paste
https://mailtag.app/mcpand click Add. - Claude opens MailTag's sign-in. Choose the permissions, step by step, and allow.
In a chat, turn it on from + → Connectors. On Team and Enterprise, an owner first adds it under Organization settings → Connectors, and then each person connects. Custom connectors also work on Claude's free plan, limited to one (Anthropic's guide).
Claude Code
claude mcp add --transport http mailtag https://mailtag.app/mcp
Then run /mcp in a session (or claude mcp login mailtag) to sign in and choose the permissions.
ChatGPT
- Open Plugins, click + and Add custom MCP server.
- Name it, enter
https://mailtag.app/mcp, and choose OAuth as the sign-in. - Tick I understand and want to continue and click Create as a plugin. Sign in to MailTag and choose the permissions.
- In a new chat, type @ and pick it.
Per OpenAI's help page (checked on 27 October 2026), custom MCP servers with all their tools are for Business, Enterprise and Edu, on the web; on Business only admins and owners can add them. Pro can connect them with read tools only, so drafting and sending won't show there. ChatGPT renames these menus now and then; if a step doesn't match, check that page.
Cursor, VS Code and scripts
Cursor can sign in like Claude: add the URL alone to its MCP config and sign in from MailTag's page. For tools without sign-in, create a key in MailTag under Settings → Agents → For developers, with the same permission steps, and add it:
{
"mcpServers": {
"mailtag": {
"url": "https://mailtag.app/mcp",
"headers": { "Authorization": "Bearer mta_…" }
}
}
}
In Cursor that file is .cursor/mcp.json (project) or ~/.cursor/mcp.json (all projects), per Cursor's docs. The full reference is in the MCP docs.
A setup that works for most people
- Mailboxes: only your work one.
- Emails: the categories Urgent and Needs reply.
- How far back: 7 days.
- Sender and subject: shown, so the agent can tell you what's waiting.
- Text: on only if you want summaries or drafts; attachments off.
- Drafts: replies only. Sending: off; you press Send.
- Changes: none at first. Allow relabeling later if you want the agent to tidy up.
- Dangerous emails: turn on the safety check in Settings → Mailboxes and hide dangerous ones from the agent.
Ask it "what needs a reply today?" and it answers from a handful of emails, not thousands.
What you can see and undo
Every agent is listed under Settings → Agents, with when it was last used and which tools it called, kept for 90 days (never the emails or your questions). You can change its permissions or disconnect it there at any time, and it loses access on the spot.
FAQ
Does MailTag send my email to Anthropic or OpenAI?
Only what you allow. MailTag sorts your email on its own servers in the EU and never stores the content. The agent receives categories and dates, plus the sender, subject or an email's text only if you turned those on; whatever it receives goes to the agent's provider.
Can the agent send email through MailTag?
Only if you turn sending on for that agent, with your limits: replies only or new emails too, only to people you've replied to, and up to 10, 50 or 200 a day. Otherwise it can at most leave drafts for you to send.
Can the agent delete my email?
No. MailTag's MCP server has no tool to delete email or move it out of your mailbox, whatever you allow.
Which plan do I need?
Any plan: Lite, Pro or Business, and the 7-day free trial every account starts with. Reading text, drafting and sending are included too, each behind its own permission.
Can I give two agents different access?
Yes. Each agent has its own permissions: one can see only Receipt from the last 30 days, another only Urgent from today and write replies.
Does the agent get my email password?
No. The agent signs in to MailTag, or uses a MailTag key, and only reaches your mailbox through it. Disconnecting it in Settings → Agents cuts it off without changing any password.