MCP server/communication

IMAP MCP Server

An IMAP Model Context Protocol (MCP) server to expose IMAP operations

★ 12dominik1001/imap-mcp ↗by dominik1001updated
1

Add it to Claude Code

claude mcp add -e "IMAP_HOST=${IMAP_HOST}" -e "IMAP_PORT=${IMAP_PORT}" -e "IMAP_USERNAME=${IMAP_USERNAME}" -e "IMAP_PASSWORD=${IMAP_PASSWORD}" -e "IMAP_USE_SSL=${IMAP_USE_SSL}" imap-mcp-9c7b -- npx imap-mcp
Required:IMAP_HOSTIMAP_PORTIMAP_USERNAMEIMAP_PASSWORDIMAP_USE_SSL
2

Make your agent remember this setup

imap-mcp-9c7b's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.

npx conare@latest

Free · one command · indexes the sessions already on disk. Set up in the browser instead →

What it does

  • Create draft emails directly in your IMAP server's drafts folder
  • Connect to any IMAP-compatible email provider like Gmail or Outlook
  • Secure credential management via environment variables
  • Full TypeScript support with type definitions
  • Native integration with Claude and other MCP-compatible assistants

Tools 1

create-draftCreates a draft email message and saves it to the IMAP server's drafts folder.

Environment Variables

IMAP_HOSTrequiredThe hostname of the IMAP server
IMAP_PORTrequiredThe port number for the IMAP server
IMAP_USERNAMErequiredThe username for email authentication
IMAP_PASSWORDrequiredThe password for email authentication
IMAP_USE_SSLrequiredWhether to use SSL for the connection (true or false)

Try it

Create a draft email to my manager with the subject 'Project Update' and tell them the project is on track.
Draft an email to [email protected] regarding the meeting reminder for tomorrow at 2 PM.
Please draft an email to [email protected] asking about my recent billing inquiry.
Original README from dominik1001/imap-mcp

imap-mcp

📧 An IMAP Model Context Protocol (MCP) server to expose IMAP operations as tools for AI assistants.

✨ Features

  • Email Draft Creation: Create draft emails that are saved to your IMAP server's drafts folder
  • IMAP Integration: Connect to any IMAP-compatible email server (Gmail, Outlook, etc.)
  • Secure Authentication: Uses environment variables for secure credential management
  • MCP Compatible: Works with Claude and other AI assistants that support the Model Context Protocol
  • TypeScript: Full TypeScript support with proper type definitions

Setup

{
  "mcpServers": {
    ...,
    "imap": {
      "command": "npx",
      "args": [
        "imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<IMAP host>",
        "IMAP_PORT": "<IMAP port>",
        "IMAP_USERNAME": "<IMAP username>",
        "IMAP_PASSWORD": "<IMAP password>",
        "IMAP_USE_SSL": "<true or false>"
      }
    }
  }
}

Usage

  1. Compile TypeScript to JavaScript:
npx tsc
  1. Run the MCP server:
node dist/index.js

Available Tools

`create-draft`

Creates a draft email message and saves it to the IMAP server's drafts folder.

Parameters:

  • to (string, required): The recipient's email address
  • subject (string, required): The email subject line
  • body (string, required): The email body content
  • from (string, optional): The sender's email address (defaults to IMAP_USERNAME)

Example:

{
  "to": "[email protected]",
  "subject": "Meeting Reminder",
  "body": "Don't forget about our meeting tomorrow at 2 PM.",
  "from": "[email protected]"
}

The tool will attempt to save the draft to either "INBOX.Drafts" or "Drafts" folder, depending on your email server's folder structure.

License

MIT

Frequently Asked Questions

What are the key features of IMAP MCP?

Create draft emails directly in your IMAP server's drafts folder. Connect to any IMAP-compatible email provider like Gmail or Outlook. Secure credential management via environment variables. Full TypeScript support with type definitions. Native integration with Claude and other MCP-compatible assistants.

What can I use IMAP MCP for?

Automating the creation of recurring email drafts for routine reports. Drafting complex emails using AI-generated content directly within your mail client. Streamlining email workflows by allowing AI to prepare messages for final review.

How do I install IMAP MCP?

Install IMAP MCP by running: npx imap-mcp

What MCP clients work with IMAP MCP?

IMAP MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Conare · memory for coding agents

Turn this server into reusable context

Keep IMAP MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Set up free$npx conare@latest