Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

IMAP mailbox

MCP server by ni-c Community

Reads, searches and organises any IMAP mailbox from MCP clients such as Claude Code, Claude Desktop and Codex. Write tools are off by default, and the server cannot send mail.

  • Score 81
  • 9 stars
  • 897 a week
  • MIT
  • Updated

Install IMAP mailbox

Built from the published package, never by AI.

claude mcp add imap-mailbox -e IMAP_HOST=YOUR_IMAP_HOST -e IMAP_USER=YOUR_IMAP_USER -e IMAP_PASSWORD=YOUR_IMAP_PASSWORD -- npx -y @ni-c/imap-mcp

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install IMAP mailbox in Claude Code

MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the imap-mailbox block.

About

IMAP mailbox is a Model Context Protocol server for any IMAP mail account. It speaks IMAP rather than one vendor's API, so it works with whatever mail provider the user already has. MCP clients such as Claude Code, Claude Desktop and Codex can use it to read and search mail, organise messages into folders, save attachments and draft replies. Every message is fenced as untrusted content, and the server adds a security assessment of sender authentication and possible prompt-injection patterns.

Write tools are off until the user sets IMAP_READ_ONLY to false. The server cannot send mail. The save_draft tool places a reply in the Drafts folder, and the user sends it from their own mail client. Deleting and moving messages ask the user for confirmation where the client supports elicitation. It is aimed at people who want an assistant to work with their mailbox without giving it a way to send messages.

Written from the project's README and checked against it.

Tools it gives your assistant

  • list_mailboxesLists the mailboxes (folders) in the account, with a cleaned display name for each.
  • list_new_messagesReturns messages not yet handed over, tagged with a custom keyword so each appears once.
  • list_messagesLists messages in a mailbox, with a default page size set by IMAP_MAX_MESSAGES.
  • get_messageReads one message, with its content fenced as untrusted and an authentication assessment.
  • get_attachmentsReturns attachments inline or saves them to disk when IMAP_DOWNLOAD_DIR is set.
  • set_message_flagsChanges flags on messages. This is a write tool and needs IMAP_READ_ONLY set to false.
  • move_messagesMoves or copies messages between folders. Asks the user for confirmation where supported.
  • delete_messagesDeletes messages. Asks the user for confirmation where the client supports elicitation.
  • save_draftWrites a reply into the Drafts folder so the user can review and send it themselves.

What you need

  • Node.js 24 or newer
  • An IMAP account with host, username and password
  • An app-specific password for providers with two-factor authentication
  • Docker, optional, to run the published container image
SettingNeededWhat it is
IMAP_HOSTEnvironment variableRequiredHostname of the IMAP server, e.g. imap.example.net
IMAP_USEREnvironment variableRequiredMailbox user name
IMAP_PASSWORDEnvironment variable, secretRequiredMailbox password or app password
IMAP_PORTEnvironment variableOptionalDefaults to 993 with implicit TLS, 143 otherwise
IMAP_TLSEnvironment variableOptionalimplicit (default), starttls or none
IMAP_MAILBOXEnvironment variableOptionalDefault mailbox to work in (default: INBOX)
IMAP_SEEN_KEYWORDEnvironment variableOptionalIMAP keyword marking what the assistant has already seen (default: AiSeen)
IMAP_READ_ONLYEnvironment variableOptionalSet to false to register the mailbox write tools; defaults to true
IMAP_ALLOW_TOOLSEnvironment variableOptionalComma-separated tool names or list_* prefixes to register; 'essential' selects a curated preset (default: all tools)
IMAP_DENY_TOOLSEnvironment variableOptionalComma-separated tool names or list_* prefixes to remove from whatever IMAP_ALLOW_TOOLS left
IMAP_DOWNLOAD_DIREnvironment variableOptionalDirectory attachments may be written to; unset means the server never touches the filesystem
IMAP_INSECURE_TLSEnvironment variableOptionalSet to true to accept self-signed certificates, scoped to this connection
IMAP_DRAFTS_MAILBOXEnvironment variableOptionalDrafts folder to save into; by default the one flagged \Drafts is used
IMAP_MAX_MESSAGESEnvironment variableOptionalDefault number of messages a listing returns (default: 100)
IMAP_MAX_ATTACHMENT_BYTESEnvironment variableOptionalCeiling for returning an attachment inline (default: 1048576)
IMAP_MAX_DOWNLOAD_BYTESEnvironment variableOptionalCeiling for writing an attachment to disk (default: 26214400)
IMAP_MAX_EXTRACT_BYTESEnvironment variableOptionalCeiling for reading a document's text with mode=text (default: 10485760, maximum: 67108864)
IMAP_COMMAND_TIMEOUT_SECONDSEnvironment variableOptionalSeconds one IMAP command may take before the call is abandoned (default: 30, maximum: 600)
IMAP_ATTACHMENT_TYPESEnvironment variableOptionalComma-separated content-type allowlist for attachments
IMAP_TRUSTED_AUTHSERV_IDEnvironment variableOptionalauthserv-id your provider stamps into Authentication-Results; without it every verdict is reported as forgeable

From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.

Try asking

  • Show me the new messages in my inbox since this morning
  • Search my mail for invoices from last month and list them
  • Save a draft reply to the latest message from my manager

Good to know

  • Write tools are off by default and need IMAP_READ_ONLY set to false.
  • The server cannot send mail. Replies are saved as drafts only.
  • move_messages both moves and copies, so denying it removes both modes.
  • IMAP_COMMAND_TIMEOUT_SECONDS applies per IMAP command, not per tool call.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to IMAP mailbox

All alternatives →

Compare with Jitsu, Vexa or Linkedin MCP server

IMAP mailbox: common questions

Can the AI send emails from my account with this server?

No. The source says the server cannot send mail. The save_draft tool writes a reply to the Drafts folder, and the user sends it from their own mail client.

Are write actions enabled by default?

No. IMAP_READ_ONLY defaults to true, and only the exact value false registers the mailbox write tools.

Does this work with any email provider?

The server speaks IMAP rather than one vendor's API, so it is described as working with any IMAP mailbox and whatever provider the user already has.

How do I install IMAP mailbox?

In Claude Code run claude mcp add imap-mailbox -e IMAP_HOST=YOUR_IMAP_HOST -e IMAP_USER=YOUR_IMAP_USER -e IMAP_PASSWORD=YOUR_IMAP_PASSWORD -- npx -y @ni-c/imap-mcp. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is IMAP mailbox the official server?

IMAP mailbox is a community project by ni-c, not verified by a company domain.

Is IMAP mailbox free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is IMAP mailbox safe to use?

It scores 81 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to IMAP mailbox?

Similar MCP servers: Jitsu, Vexa, Linkedin MCP server, Netsapiens MCP.

Does IMAP mailbox work with ChatGPT?

Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.

IMAP mailbox Install

Add to stack

Loading.