TutorialGmailOutlookIMAP

How to Connect Your Email to an AI Agent in Under 2 Minutes (Gmail, Outlook, iCloud, Fastmail & IMAP)

Connect your email to an AI agent in under 2 minutes. Step-by-step setup for Gmail, Outlook, iCloud, Fastmail, and any IMAP inbox over MCP — no email ever stored.

Connect your email to an AI agent in under 2 minutes — Gmail, Outlook, iCloud, Fastmail, and IMAP over MCP

You connect your email to an AI agent in two moves: connect the inbox in the MCP Emails dashboard, then point your agent at one endpoint URL. With an OAuth-capable client like claude.ai, that's it. No code, no SDK, and your email is never stored anywhere — every read and send hits your provider live and is discarded the moment the agent has it.

This is the fast guide. Pick your provider below, follow the four or five steps, and you'll have Claude (or Cursor, or a custom script) reading and sending real mail in about the time it takes to read this paragraph twice. For the deeper "what is this and is it safe" version, start with the complete guide to giving your AI agent email access.

The one step every provider shares: connect your client

Before you touch a provider, decide how your AI agent will talk to MCP Emails. There are two paths and they both use the same endpoint and the same tools.

Path A — OAuth client (claude.ai, Claude Desktop, Cursor). No API key. You paste a URL and approve a sign-in:

  1. In claude.ai, go to Customize → Connectors → Add connector.
  2. Paste the endpoint: https://www.mcpemails.com/api/mcp
  3. Click Connect, sign in to your MCP Emails account, and approve the scopes you want (read:email, send:email, or both).

That's the whole client side. Tokens are scoped to exactly what you approved, and you can revoke the connection from the dashboard in one click. If you want the trade-offs spelled out, see OAuth vs API keys for AI email access.

Path B — API-key client (Cline, JetBrains, cURL, custom agents). For anything without built-in OAuth:

  1. Go to Dashboard → API Keys and create a key.
  2. Pick its scopes (read:email, send:email).
  3. Copy it once (it's only shown once) and pass it as a header: Authorization: Bearer <your-api-key>, again against https://www.mcpemails.com/api/mcp.

If you live in an editor, the email setup for Cursor, Cline, and VS Code covers that path end to end.

Now the inbox. Every provider below starts the same way: Dashboard → Inboxes → Connect Inbox, then pick your provider.

Connect each provider

Gmail (OAuth)

The fastest of the bunch, because Google does the work.

  1. Dashboard → Inboxes → Connect Inbox → Gmail.
  2. You're bounced to Google's sign-in. Choose the account.
  3. Approve read and send access on the consent screen.
  4. You land back in the dashboard with the inbox connected. Done.

No password ever changes hands. MCP Emails holds an encrypted OAuth token and calls the Gmail API directly. Searches use Gmail's native operators (from:, is:unread, after:), so your agent can be precise.

Outlook / Microsoft 365 (OAuth)

Same shape as Gmail, different identity provider.

  1. Dashboard → Inboxes → Connect Inbox → Outlook / Microsoft 365.
  2. Sign in with your Microsoft account on Microsoft's page.
  3. Approve the permissions.
  4. The inbox shows up connected. Sending goes out through Microsoft Graph, so it's a normal message from your own account.

If your tenant has conditional access or admin consent rules, the Outlook and Microsoft 365 setup guide walks through the admin-side gotchas.

iCloud (app-specific password)

iCloud doesn't hand third parties OAuth, so you generate an app-specific password. It takes one extra minute.

  1. Go to appleid.apple.com, sign in, and open the Sign-In and Security section.
  2. Under App-Specific Passwords, create a new one and label it "MCP Emails."
  3. Copy the generated password (it looks like xxxx-xxxx-xxxx-xxxx).
  4. In Dashboard → Inboxes → Connect Inbox → iCloud, enter your iCloud address and paste that app password.

iCloud runs over IMAP/SMTP under the hood, so you get the same tool set as everyone else.

Fastmail (app-specific password — not OAuth)

A quick correction if you've read older docs: Fastmail connects with an app password, not OAuth. Don't go looking for a "Sign in with Fastmail" button — there isn't one here.

  1. In Fastmail, open Settings → Privacy & Security → Integrations (or App Passwords).
  2. Create a new app password. Give it mail (IMAP/SMTP) access and name it "MCP Emails."
  3. Copy the password Fastmail generates.
  4. In Dashboard → Inboxes → Connect Inbox → Fastmail, enter your Fastmail address and paste it.

That's it — Fastmail behaves exactly like the other IMAP providers from the agent's side.

Generic IMAP (Yahoo, Zoho, Yandex, and the rest)

Anything that speaks IMAP/SMTP works through one connector. The pattern is identical to iCloud and Fastmail: make an app password at your provider, then paste it.

  1. In your provider's security settings, create an app password (Yahoo, Zoho, and Yandex all bury this under account security). Use a real app password, not your login password — most providers block plain-password IMAP now anyway.
  2. Dashboard → Inboxes → Connect Inbox → IMAP.
  3. Enter your email address and the app password. MCP Emails autodetects common servers; if yours is unusual, drop in the IMAP and SMTP host/port your provider lists.
  4. Save. The inbox connects and is ready.

For provider-specific quirks across iCloud, Fastmail, and the long tail of IMAP hosts, the iCloud, Fastmail, and IMAP deep-dive is the troubleshooting reference.

First call: discover, then act

Whichever provider you picked, the agent's first move is always the same. Have it call inbox_list to discover what's connected and grab each inbox's inbox_id — the agent never copy-pastes a UUID. From there it works through a small set of consolidated tools — email_read (with an action of list, read, or search), email_compose (send, reply, or forward), and email_organize for moving, flagging, and archiving — plus folder, draft, schedule, and contact_search:

{
  "tools": [
    "inbox_list",
    "email_read",
    "email_compose",
    "email_organize"
  ]
}

A good smoke test: ask your agent "summarize my three most recent unread emails." It'll run inbox_list, then email_read with action: "list" and unread_only: true, then email_read with action: "read" on each. If that works, your connection is live.

One honest caveat worth setting up front: MCP Emails is poll-based. There are no webhooks or push events, so an agent reacts to new mail by checking on a schedule rather than getting pinged. That's the right model for most workflows, and it's how the inbox triage and summarize patterns work.

Why this is safe to do quickly

Speed here doesn't come from cutting corners on security. Email is fetched live on every call and never stored — bodies, subjects, and attachments are handed to the agent and dropped immediately. The only thing persisted per inbox is your OAuth token or app password, encrypted with AES-256-GCM, and decrypted only inside an isolated function at call time. Sending always goes through your own provider, so your domain reputation stays yours. If you want the architecture in detail, read why "email is never stored" actually matters.

Wrap-up

That's the whole thing: one inbox connection, one endpoint, a handful of tools. Every plan is unlimited on inboxes, calls, and keys, and the Free tier costs nothing and needs no card — check pricing if you need higher burst limits or SSO. Ready to try it? Start free, connect your inbox, and paste the endpoint into your agent.

Asgeir Albretsen
Written by
Asgeir Albretsen

Asgeir builds MCPEmails — the bridge that lets AI agents read, search, and send real email over the Model Context Protocol. He writes about agents, email infrastructure, and developer experience.

@mcpemails

Give your agent an inbox

Connect Gmail, Fastmail, or any IMAP account to your AI agent in minutes.