imap-mcp

imap-mcp

An MCP server that exposes IMAP operations as tools for AI assistants, enabling email management including listing mailboxes, reading, searching, moving, flagging emails, and creating drafts.

Category
访问服务器

README

imap-mcp

<div align="center">

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

MIT License MCP Compatible

</div>

Fork of dominik1001/imap-mcp

This MCP-Server was originally created by dominik1001 and has been forked for customization and additional features.

✨ Features

  • List Mailboxes: Browse all available mailboxes with their special use flags
  • List Emails: View the most recent emails in any mailbox
  • Read Emails: Read full email content including headers and body
  • Search Emails: Search emails by sender, recipient, subject, date range, and flags
  • Move Emails: Move emails between mailboxes
  • Flag Emails: Add or remove flags (Seen, Flagged, Answered, etc.)
  • Create Drafts: Create draft emails 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
  • MCPB Compatible: Easy integration with MCPB-compatible AI assistants like Claude Desktop

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

list-mailboxes

Lists all available mailboxes on the IMAP server with their path, special use designation, flags, and subscription status.

Parameters: None

list-emails

Lists the most recent emails from a mailbox.

Parameters:

  • mailbox (string, optional): Mailbox to list (default: "INBOX")
  • limit (number, optional): Number of emails to return, 1–100 (default: 20)

read-email

Reads a single email by UID, returning full headers and body content.

Parameters:

  • mailbox (string, optional): Mailbox containing the email (default: "INBOX")
  • uid (number, required): The UID of the email to read

search-emails

Searches for emails using optional filter criteria.

Parameters:

  • mailbox (string, optional): Mailbox to search (default: "INBOX")
  • from (string, optional): Filter by sender
  • to (string, optional): Filter by recipient
  • subject (string, optional): Filter by subject
  • since (string, optional): Emails since this ISO date
  • before (string, optional): Emails before this ISO date
  • seen (boolean, optional): Filter by read/unread status
  • flagged (boolean, optional): Filter by flagged status
  • limit (number, optional): Maximum results, 1–100 (default: 20)

move-email

Moves an email to a different mailbox.

Parameters:

  • mailbox (string, optional): Source mailbox (default: "INBOX")
  • uid (number, required): The UID of the email to move
  • destination (string, required): Target mailbox path

flag-email

Adds or removes flags on an email.

Parameters:

  • mailbox (string, optional): Mailbox containing the email (default: "INBOX")
  • uid (number, required): The UID of the email
  • action (string, required): "add" or "remove"
  • flags (string[], required): Flags to modify (e.g., \Seen, \Flagged, \Answered, \Draft, \Deleted)

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)

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选