Blog

Connect iCloud Mail to ChatGPT

Connect iCloud Mail to ChatGPT through Fluxmail with an app-specific password, then choose which mailboxes and actions ChatGPT can use.

Richard Chu

Fluxmail Founder

5 min read

A paper cloud inside an open envelope, tied by a glowing thread to a paper speech bubble

Apple doesn't let other apps sign in to iCloud Mail with your Apple Account password. It supports IMAP, the protocol desktop mail apps use, with an app-specific password that you create for each app.

Fluxmail uses that password to reach your iCloud mailbox and makes it available to ChatGPT as an MCP server. ChatGPT can then search your mail, read messages and attachments, and save drafts. It works with @icloud.com, @me.com, and @mac.com addresses. Fluxmail works with your mailbox on Apple's servers, so drafts it saves and messages it files show up in Mail on your Mac and iPhone.

You choose which mailboxes ChatGPT can use and what it's allowed to do. One connection can include more than one mailbox, so you can add a Gmail or Outlook account next to iCloud and search both.

You can set it up two ways. Fluxmail Cloud is hosted, and you add it to ChatGPT on chatgpt.com or in the ChatGPT desktop app. Self-hosted Fluxmail runs on your Mac, keeps the password encrypted there, and works with the ChatGPT desktop app. Both start with an app-specific password.

1. Create an app-specific password

Apple requires two-factor authentication on your Apple Account before you can create one. Most accounts already have it.

  1. Sign in at account.apple.com.
  2. In Sign-In and Security, select App-Specific Passwords.
  3. Select Generate an app-specific password, name it something like "Fluxmail", and copy the password.

Use this password only for Fluxmail. If you stop using it, revoke it on the same page without changing your Apple Account password.

2. Connect iCloud to Fluxmail Cloud

  1. Sign up for Fluxmail Cloud. A new workspace gets a seven-day trial, and you don't need a card to start it.
  2. Open Mailboxes, choose Other email provider, and enter your iCloud address. The dashboard fills in Apple's server settings.
  3. Paste the app-specific password and select Connect.

3. Add Fluxmail to ChatGPT

Your ChatGPT account or workspace has to allow custom MCP servers. In a Business or Enterprise workspace, an administrator may need to allow them first.

  1. Go to chatgpt.com/plugins, select the plus button, then Add custom MCP server.

  2. Fill in these settings. The URL goes under Connection.

    Name: Fluxmail
    Description: Email
    URL: https://cloud.fluxmail.ai/mcp
    Authentication: OAuth
    
  3. Accept the warning, select Create as a plugin, then install the plugin.

  4. Sign in to Fluxmail and pick your iCloud mailbox. Send emails is checked, so uncheck it if you don't want ChatGPT to send. For draft-only access, also uncheck Organize emails and Move to/from Trash. Then approve.

On chatgpt.com, start a new conversation, type @, and select Fluxmail.

If you use the ChatGPT desktop app instead, open Settings > Plugins, select Add, then Add MCP server. Enter a name such as Fluxmail, choose Streamable HTTP, and enter the same URL. Save the server and restart the app. When the app opens the Fluxmail page, sign in and approve access, unchecking permissions as in step 4 above. If the page doesn't open or sign-in doesn't finish, select Authenticate next to Fluxmail on the MCPs tab.

4. Or run Fluxmail on your Mac

Skip this step if you connected through Fluxmail Cloud.

Connect the mailbox

Install the Fluxmail CLI and create the local administrator:

npm install -g fluxmail
fluxmail setup --name "Your name" --email you@example.com

Then connect iCloud with Apple's server settings:

fluxmail accounts add imap \
  --email johnappleseed@icloud.com \
  --imap-host imap.mail.me.com \
  --imap-user johnappleseed \
  --smtp-host smtp.mail.me.com \
  --smtp-user johnappleseed@icloud.com

Replace each occurrence of johnappleseed with the part of your address before the @. iCloud uses only the part before the @ as the IMAP username and the full address for SMTP. Fluxmail's other defaults already match iCloud: IMAP over TLS on port 993 and SMTP with STARTTLS on port 587.

Fluxmail asks for the password without showing it. Paste the app-specific password, which works for both IMAP and SMTP. Fluxmail tests both connections before saving, then encrypts the password in its local database.

If the IMAP login fails with the short username, try the full address with --imap-user johnappleseed@icloud.com. Apple suggests that as a fallback.

Connect the ChatGPT desktop app

chatgpt.com can't reach a server on your Mac, so use the ChatGPT desktop app. Open Settings > Plugins, select Add, then Add MCP server, and enter these settings. Start with read-only access while you try it out:

Name: Fluxmail
Type: STDIO
Command to launch: fluxmail
Arguments: stdio --profile read-only

Save the server and restart the app. If the app can't find the fluxmail command, run which fluxmail in Terminal and enter the full path it prints as the command.

5. Try it

Ask ChatGPT something only your inbox can answer:

Using Fluxmail, find the five most recent emails in my iCloud inbox. Which ones look like they need a reply?

ChatGPT searches with Fluxmail's search_emails tool and opens messages with get_email. Fluxmail fetches each message from Apple's servers when ChatGPT asks for it. With self-hosted Fluxmail, that mail goes straight to your Mac.

Attachments work too:

Using Fluxmail, find the most recent receipt in my iCloud inbox and tell me the total from the attached PDF.

6. Allow more when you need it

In Fluxmail Cloud, a connection keeps the permissions you approved. To change them, connect ChatGPT again and approve the permissions you want, then revoke the old connection in Connections.

In self-hosted Fluxmail, change the arguments to stdio --profile read-write to let ChatGPT organize mail and write drafts, or to stdio --profile full to let it send. Save the server and restart the app.

With read and write access, ChatGPT can file messages into your iCloud folders and save drafts that appear in Mail on your Mac and iPhone. You still send them yourself. IMAP mailboxes have folders but no labels, so ask ChatGPT to move messages rather than label them.

If something looks off

  • Fluxmail doesn't appear when you type @. Check that the plugin is installed at chatgpt.com/plugins. In the desktop app, check that Fluxmail is listed on the MCPs tab under Settings > Plugins, and restart the app after any change.
  • A folder is missing. Fluxmail finds Sent, Drafts, Trash, Archive, and Spam (Junk in iCloud) from the folder flags iCloud reports. If one is missing, connect the mailbox again in Cloud and set it by name under Folder mappings, or use fluxmail accounts configure <account-id> --trash-folder 'Deleted Messages' in self-hosted Fluxmail. Get the account ID from fluxmail accounts list.
  • Sent messages appear twice. Some servers save their own copy of mail sent over SMTP. If you see duplicates in Sent, connect the mailbox again with Save sent mail to the Sent folder turned off in Cloud, or add --no-save-sent to the fluxmail accounts add imap command.
  • An iCloud+ custom domain. You can send from a custom domain address that belongs to your account. Register it in Fluxmail first, as described in Send from another address.

Next steps

Try Fluxmail Cloud

Connect your AI agent to your Gmail, Outlook, or IMAP email accounts.