
Developer guide
IMAP MCP: connect any mailbox to your AI agent, hosted
Bring any IMAP mailbox into your AI agent without running a server or pasting your password into its config. Unipile hosts it, for coding agents and AI assistants.
Show each customer's emails on their ticket.
unipileread endpointGET /v2/{account_id}/emailsschema loaded
Added the email thread to the ticket view.2 files changed · tested on the Development app
Unipile
Any IMAP mailbox: OVH, Zoho, Fastmail or your own server
What came in on the support inbox this morning?
IMAPsearch unread emails7 unread
Three need a reply: a refund on order 4821, a new delivery date and a supplier invoice.
Table of Contents
Short answer
An IMAP MCP server turns a mailbox into tools an AI client can call: list folders, search, read and draft. Unipile hosts one, and the IMAP password never sits in the assistant's configuration.
This guide is about your own mailbox, the inbox you already use.
The basics
What is an IMAP MCP server?
An IMAP MCP server exposes a mailbox as tools that an AI client calls through the Model Context Protocol. The model picks a tool; the server talks IMAP to read and SMTP to send.
1 · MCP client
AI client



Reads the request and picks a tool.
2 · MCP server
Tools
list folderssearchreaddraft
Describes what the agent can do.
3 · Protocols
IMAP and SMTP
IMAPport 993 · SSL/TLS
IMAP reads the mailbox, SMTP sends.
4 · Mailbox
Any provider
Folders and threads.
Tools, not raw IMAP commands
The server decides which actions exist and returns clean emails, not raw IMAP responses. A read-only server leaves out the tools that write.
Host, port and encryption
Every IMAP connection needs a host, a port and an encryption mode: the IMAP server connection guide lists them by provider.
Why IMAP
Why IMAP, when ChatGPT and Claude already connect Gmail and Outlook?
Built-in connectors cover Gmail and Microsoft 365. Mailboxes at OVH, Zoho, Fastmail, Yahoo, iCloud or on a company mail server only speak IMAP, so they need an IMAP MCP server.
Covered by built-in connectors
Needs IMAP
OVHZoho MailFastmailYahoo MailiCloud MailYour web hostCompany mail server
Linked once to Unipile with the IMAP form.
Gmail and Outlook too: same connection, same tools
Unipile links Gmail and Outlook through their own sign-in, IMAP mailboxes through the IMAP form, and the agent gets one set of email tools for all of them.
Compare
Local IMAP MCP servers vs a hosted MCP: what changes
Most open-source IMAP MCP servers run on your machine, with host, username and password (often an app-specific password) in their configuration. A hosted MCP keeps credentials server side and lets an admin share access.
| Local serverOpen source, self-run | User MCPYour inbox in an assistant | Developer MCPBuild email into a product | |
|---|---|---|---|
| Where it runs | Local serverOn your computer, started by the AI client | User MCPHosted by Unipile | Developer MCPHosted by Unipile |
| Where the mailbox password lives | Local serverIn the client config or environment variables | User MCPEntered once in the Unipile connection form | Developer MCPEntered by each user in Hosted Auth |
| Sign-in to the AI client | Local serverNone, it reads its own config | User MCPOAuth per person and per client, up to 30 days | Developer MCPAccount API key for real requests |
| Mailboxes | Local serverOften one per server | User MCPEvery account in the person's Scope | Developer MCPEvery mailbox your users link |
| Team access and revocation | Local serverEach person installs and configures a copy | User MCPGranted by an Owner or Admin, revocable | Developer MCPDecided by your product |
| Outlook after Basic Auth | Local serverPassword sign-in being retired by Microsoft | User MCPMicrosoft sign-in, as an Outlook account | Developer MCPMicrosoft sign-in, as an Outlook account |
| Sending | Local serverVaries, many are read-only | User MCPReads, searches, drafts for your review | Developer MCPFrom the user's own mailbox, through the API |
One mailbox on your laptop? A local server can do. For a shared inbox, a team or a product, a hosted MCP keeps passwords out of every client. On Outlook and Basic Authentication, see the IMAP connection guide.
Unipile MCP
Two Unipile MCP servers for IMAP: one to build, one to use
The developer MCP helps a coding agent build IMAP features into your product. The user MCP brings an IMAP inbox into a person's AI assistant. Both reach the same connected mailboxes, which also work with the REST API.
Developer MCPFor developers building a product
Coding agentClaude Code, Cursor, Codex
API keyNone to read the docs
Hosted AuthIMAP settings detected
Your productCalls the REST API
User MCPFor people using an assistant
AI assistantChatGPT, Claude, Grok
OAuth sign-inNo password in the client
ScopeSet by an Owner or Admin
Your mailboxPersonal or shared
Unipile platform
One API, the same connected mailboxes
Any IMAP mailbox, with SMTP for sending
Build email into your product
Developer MCP
Your coding agent reads the API reference with no key and tests real requests with an Account API key. Users connect their mailbox through Hosted Auth, which detects IMAP and SMTP settings.
Use your own inbox
User MCP
An Owner or Admin grants MCP Access and picks the Scope, which can include a shared mailbox. Each person authorizes each assistant with OAuth, for up to 30 days.
Setup
How to connect an IMAP inbox, step by step
Three steps on each path: one ends in your product, the other in your assistant.
Building a productDeveloper MCP, then the REST API
Get an API key
In your Development application, create an Account API key for your test mailboxes.
Development appAccount API key
Add the developer MCP to your coding agent
Paste the configuration from the documentation into Claude Code, Cursor, Codex or Gemini CLI. Command on the Claude Code setup page.
Let your users connect their mailbox
In Hosted Auth, users type an address and password; Unipile detects the settings or asks for host, port and encryption.
Settings detected
account_id
Using your own inboxUser MCP in ChatGPT, Claude or Grok
Connect the mailbox to Unipile once
Link it in My MCP accounts with its address and password. The assistant never sees them.
support@yourcompany.comIMAP
An admin adds it to a Scope
An Owner or Admin grants MCP Access and picks the accounts each person can use.
MCP AccessScope: Support inbox
Two-factor authentication. Your provider may ask for an app password when you connect the mailbox to Unipile; it is entered once, never in your AI client.
Capabilities
What an AI agent can do in an IMAP inbox
Both MCP servers sit on the same Unipile email API. Each action runs on behalf of the authenticated user.
| Feature family | What the agent can do |
|---|---|
| Folders | List folders and emails |
| Search | By sender, subject or unread status |
| Threads | Read full threads and their attachments |
| Drafts | Draft replies for a person to review |
| Sending | Send from the user's own mailbox, through the API |
The full list lives on the Unipile IMAP API page; the IMAP API guide compares it with raw IMAP.
Developer MCP
In a coding agent: an IMAP inbox, built into your CRM
The agent reads the exact schema, tests on your Development app and writes the code.
Add an IMAP inbox to the contact page of our CRM.
unipilesearch endpoints"emails"4 matches
unipileread endpointGET /v2/{account_id}/emailsschema loaded
unipilerun requestGET /v2/{account_id}/emails/{email_id}200 OK
// src/email/inbox.ts export async function listEmails(accountId, apiKey) { const res = await fetch( `https://api.unipile.com/v2/${accountId}/emails`, { headers: { 'X-API-KEY': apiKey } } ); return res.json(); }
Added the contact's emails and a reply box.3 files changed · tested on the Development app
User MCP
What you can ask your assistant about your inbox
Pick a chat to see the request, the Unipile calls the assistant makes on your IMAP mailbox, and the answer. Replies stay drafts until you confirm.
New chat
Recent
Sort the unread emails in the support inbox.
Unipile2 calls
IMAPsearch unread emails11 unread
IMAPread emails11 emails
The support inbox, sorted:
- Urgent: Nora Fischer asks for a refund on order 4821.
- To answer: four questions on delivery dates.
- No action: six notifications and receipts.
Draft a reply to NoraGroup the delivery questions
Find the Brightline invoice from October.
Unipile2 calls
IMAPsearch by sender3 emails
IMAPread attachments1 PDF
Found in your Invoices folder:
Invoice_Brightline_October.pdfReceived on 3 November, due on 30 NovemberOpen
It is the only October invoice from Brightline.
Forward it to accountingAny other invoice due?
Draft a reply to Paul about his delivery date.
Unipile2 calls
IMAPread threadPaul Martin
IMAPcreate draftSaved in Drafts
Paul asks if his order can arrive before 5 December. The draft is in your Drafts folder:
Draft to Paul Martin
Hi Paul, yes, we can ship on 2 December so it arrives before the 5th. I will send the tracking link.
ReviewNot nowNothing is sent until you confirm.
Where are we with Halden? Read the whole thread.
Unipile2 calls
IMAPsearch by subjectHalden
IMAPread thread9 emails
The Halden thread, in short:
- 3 Nov: they approved the proposal.
- 10 Nov: their legal team asked to change clause 4.
- 18 Nov: you sent the new version, no reply yet.
Draft a follow-upWho is in the thread?
What were the important emails this week?
Unipile2 calls
IMAPsearch emails146 emails
IMAPread emails9 kept
Three things mattered this week:
- Halden sent back the contract with one change.
- Brightline invoice due on 30 November.
- Nora Fischer still waits for her refund.
Draft a reply to NoraSame recap every Friday
What is new in my Clients folder?
Unipile2 calls
IMAPlist folders14 folders
IMAPlist emails7 new in Clients
Seven new emails, one needs care: Verano says their order arrived late. An apology to review:
Draft to Verano
Hello, sorry for the late delivery. We have checked the shipment and your next order ships first.
ReviewNot nowNothing is sent until you confirm.
Ask anything
Unipile
Use it in your assistant
- 1An Owner or Admin gives you MCP Access and picks the accounts in your Scope.
- 2Link your mailbox once in Unipile.
- 3Add Unipile as a custom connector in ChatGPT or Claude and approve with OAuth.
Set it up in ChatGPTSet it up in ClaudeHow the User MCP works
Security
Is it safe to give an AI agent access to your mailbox?
It depends on what the agent can reach, how long it keeps access and where the password lives.
What the agent can reach
Only the accounts in the person's Scope, chosen by an Owner or Admin. A shared Scope also covers accounts added later.
Consent and revocation
Each assistant asks for its own consent, valid up to 30 days and revocable at any time in My MCP accounts.
Where credentials live
The IMAP password goes into the Unipile connection form, once. It never sits in the assistant, the coding agent or a local config file. See the User MCP docs.
Build any IMAP inbox into your product with an AI agent
Start with the developer MCP, then ship on the REST API. The same API covers Gmail, Outlook, LinkedIn, WhatsApp and more.
IMAP MCP: FAQ
Quick answers on email and IMAP MCP servers.
An email MCP server gives an AI client tools to work in a mailbox: list folders, search, read and draft. It works in your own inbox, the one you read every day. For IMAP, Unipile hosts one.
Not for Gmail or Microsoft 365 alone: ChatGPT and Claude have built-in connectors. You need an MCP server for IMAP mailboxes such as OVH, Zoho, Fastmail or a company mail server.
An official server comes from the company behind the service; a community server is an open-source project you run yourself. IMAP has no single owner, so IMAP MCP servers are community projects or hosted services such as Unipile.
The Unipile developer MCP works with Claude Code, Cursor, Codex and Gemini CLI. Setup is on the Claude Code page.
No. Unipile is not affiliated with, endorsed by, or sponsored by LinkedIn. It is an independent technical intermediary: every call runs on behalf of the authenticated user who linked their own account.
No. Unipile is an independent company, not a Meta Partner, and it is not endorsed, sponsored or approved by Meta. Facebook, Instagram and WhatsApp are trademarks of Meta Platforms, Inc.
Still have questions? Our team is here to help.
Talk to an expert
