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 (app password, or Sign in with Google)

Gmail connects with a Google app password by default, over IMAP.

  1. Turn on 2-Step Verification in your Google account, then create an app password at myaccount.google.com/apppasswords. It is 16 lowercase letters in four groups.
  2. Dashboard → Inboxes → Connect Inbox → Gmail.
  3. Enter your full Gmail address, paste the app password, and click Connect inbox.
  4. The connection is tested against Gmail and the inbox shows up connected. Done.

Your normal Google password never works here and is never needed. If you would rather sign in with Google, open Prefer to sign in with Google? in the same window and click Connect with Google; Google shows an unverified-app warning first (click Advanced, then Go to mcpemails.com). That route uses the Gmail API, so searches can use Gmail's own operators (from:, is:unread, after:) and Claude works with real labels. The app-password route uses IMAP text search, shows labels as folders, and can delete permanently. The Gmail walkthrough has the details.

Outlook / Microsoft 365 (Sign in with Microsoft)

Outlook connects with a Microsoft sign-in instead of a password. No app password and no IMAP settings.

  1. Dashboard → Inboxes → Connect Inbox → Outlook.
  2. Click Connect with Microsoft and 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.

Personal Outlook.com, Hotmail, Live and MSN accounts connect this way with no admin involved. Work or school Microsoft 365 accounts may need an IT admin to approve the app first: many organisations block employees from approving mailbox access themselves. If that happens, the dashboard gives you a link to send to your IT admin, who approves the app once for the whole organisation, and then you connect as above. The Outlook and Microsoft 365 setup guide walks through it.

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: 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. The Free tier connects one inbox and needs no card; Personal is $9/month for up to three inboxes, and Pro connects every mailbox you own. See pricing. 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.

Give your agent an inbox

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