Skip to main content
Glama
concurrent2024

mcp-email-server

mcp-email-server

一个能收发邮件的 MCP 服务器。通过标准 IMAP 读信、标准 SMTP 发信,因此 Gmail、QQ、163、Outlook、企业自建邮箱都能接入,不依赖任何单一服务商的私有 API。

用 Python 编写,基于 MCP Python SDK v2

它能做什么

读信

工具

作用

search_emails

按发件人、主题、正文、日期、未读状态搜索,返回简要列表

read_email

读取单封邮件全文、头信息与附件清单

wait_for_new_emails

阻塞等待新邮件到达(例如等验证码),超时返回

list_folders

列出邮箱文件夹及其特殊用途标记

download_attachment

把附件保存到本地目录

写信

工具

作用

send_email

发送邮件,支持抄送、密送、HTML、附件、回复原邮件

save_draft

只存草稿不发送,交给人工在自己的客户端里过目

管理与诊断

工具

作用

mark_email

标记已读/未读、加星/取消

move_email

移动到其他文件夹

delete_email

移入垃圾箱(是移动不是彻底删除,可恢复)

check_connection

分别验证 IMAP 与 SMTP 是否可用,且绝不回显密码

此外还提供资源 email://{文件夹}/{uid}(把某封邮件当作上下文附件挂进对话),以及提示词 draft_reply(带原文引用地起草回复)。

Related MCP server: Email MCP Server

安装

需要 Python 3.10 及以上。

git clone <this-repo> && cd mcp-email-server
python3 -m venv .venv
.venv/bin/pip install -e .

配置

复制 .env.example.env 并填写,或者直接用环境变量。

cp .env.example .env

最小可用配置:

IMAP_HOST=imap.qq.com
IMAP_USERNAME=you@qq.com
IMAP_PASSWORD=你的授权码
SMTP_HOST=smtp.qq.com
EMAIL_FROM=you@qq.com
EMAIL_ALLOW_SEND=true

填完先自检,不用启动客户端:

.venv/bin/mcp-email-server --check

它会分别连接 IMAP 与 SMTP 并报告结果,成功时退出码为 0。

各邮箱服务商参数

服务商

IMAP

SMTP

密码填什么

Gmail

imap.gmail.com:993 ssl

smtp.gmail.com:465 ssl

应用专用密码(需先开两步验证)

QQ 邮箱

imap.qq.com:993 ssl

smtp.qq.com:465 ssl

授权码(设置 → 账户 → 开启 IMAP/SMTP 服务)

163 / 126

imap.163.com:993 ssl

smtp.163.com:465 ssl

客户端授权密码(设置 → POP3/SMTP/IMAP)

Outlook / M365

outlook.office365.com:993 ssl

smtp.office365.com:587 starttls

见下方说明

自建(Dovecot 等)

mail.example.com:993 ssl

mail.example.com:587 starttls

账号密码

几个务必注意的点:

  • 绝大多数服务商不接受登录密码。Gmail、QQ、163 都要求单独生成一串"授权码"或"应用专用密码",填错了会得到一条含糊的登录失败信息。

  • Microsoft 已停用个人 Outlook.com 与多数 M365 租户的基本认证(basic auth)。也就是说密码方式在那里多半已经行不通,需要 OAuth2 —— 本项目当前尚未实现完整的 OAuth2 授权流程(见下文"扩展 OAuth2")。

  • 163/126 需要 IMAP ID 命令,否则登录后每条命令都会被拒绝并返回 Unsafe Login。本服务器会在服务端声明支持时自动发送该命令,你不需要做任何事。

  • SMTP_USERNAME / SMTP_PASSWORD 留空时自动复用 IMAP_* 的值,同一个账号不必填两遍。

安全开关

默认配置是保守的:装好之后只能读信,不能发信也不能删信。这是刻意的——模型可能误解意图,而发出去的邮件收不回来。

变量

默认

作用

EMAIL_ALLOW_SEND

false

不显式打开就无法发信

EMAIL_ALLOW_DELETE

false

不显式打开就无法移动或删除邮件

EMAIL_RECIPIENT_ALLOWLIST

空(放行所有人)

收件人白名单,可写完整地址或域名

EMAIL_ATTACHMENT_DIR

./attachments

附件读写只允许发生在此目录内

EMAIL_MAX_BODY_CHARS

20000

单封正文返回上限,避免撑爆模型上下文

EMAIL_SAVE_SENT_COPY

false

发信后往"已发送"追加一份副本

刚接入时强烈建议先把白名单设成你自己的地址,确认整条链路行为符合预期后再放开:

EMAIL_RECIPIENT_ALLOWLIST=me@example.com

白名单支持三种写法:完整地址 bob@example.com、域名 @example.comexample.com。匹配的是真实地址,不是显示名,所以 me@example.com <attacker@evil.com> 这类伪装会被拒绝。

关于 EMAIL_SAVE_SENT_COPY:Gmail 会在服务端自动保存通过 SMTP 发出的邮件,而 QQ、163 等大多数服务商不会——在那些邮箱上如果不打开这个开关,你发出去的信除了对方收件箱之外哪儿都不存在。

接入 Cursor

在项目里建 .cursor/mcp.json(或用户级 ~/.cursor/mcp.json):

{
  "mcpServers": {
    "email": {
      "command": "/绝对路径/mcp-email-server/.venv/bin/mcp-email-server",
      "env": {
        "IMAP_HOST": "imap.qq.com",
        "IMAP_USERNAME": "you@qq.com",
        "IMAP_PASSWORD": "你的授权码",
        "SMTP_HOST": "smtp.qq.com",
        "EMAIL_FROM": "you@qq.com",
        "EMAIL_ALLOW_SEND": "true",
        "EMAIL_RECIPIENT_ALLOWLIST": "you@qq.com"
      }
    }
  }
}

Claude Desktop 的 claude_desktop_config.json 格式相同。

如果不想把密码写进配置文件,可以省略 env,改为在项目根目录放一个 .env——服务器启动时会自动读取。此时记得把 .env 加入 .gitignore(本仓库已经加了)。

想通过 HTTP 而不是 stdio 提供服务:

mcp-email-server --transport streamable-http --host 127.0.0.1 --port 8000

注意 HTTP 模式没有内置鉴权,只应绑定在本机或可信网络内。

用起来是什么样

配好之后直接用自然语言指挥即可:

  • "看看我收件箱里有没有来自财务的未读邮件" → search_emails

  • "把第二封的完整内容念给我听" → read_email

  • "帮我回复她,说方案我同意,周五之前给她初稿" → draft_reply / send_email(带 reply_to_uid,回复会正确挂在原会话线程上)

  • "等一下验证码邮件,收到告诉我" → wait_for_new_emails

  • "把那封带发票的附件下载下来" → download_attachment

服务器的 instructions 里明确要求模型在调用 send_email 前先把收件人、主题、正文摆给你确认,各工具也带了 readOnlyHint / destructiveHint 标注,支持的客户端会据此决定是否弹出确认框。但这些是提示而非强制——真正的兜底是上面那几个开关和白名单。

开发

.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest

测试不需要任何真实邮箱账号:

  • SMTP 发信路径用 aiosmtpd 起一个本地真实 SMTP 服务(含 AUTH),断言信封收件人、MIME 结构、附件内容、中文主题的 RFC 2047 编码。

  • IMAP 路径用真实构造的 RFC 5322 报文喂给假 mailbox,覆盖编码头解码、HTML-only 正文降级、超长截断、附件文件名消毒。

  • 工具契约用 SDK 自带的内存客户端 Client(mcp) 直连服务器对象,不起进程不占端口。

  • 安全策略单独覆盖:开关关闭时必须拒绝、白名单外必须拒绝、错误信息里绝不出现密码。

用 MCP Inspector 手动点一遍(需要本机有 Node.js):

npx @modelcontextprotocol/inspector .venv/bin/mcp-email-server

这里直接把 Inspector 指向安装好的可执行文件,而不是用 mcp dev src/mcp_email/server.py——后者会按文件路径加载模块,包内的相对导入会因此失效。

代码检查:

.venv/bin/ruff check src tests

代码结构

src/mcp_email/
  config.py       # 环境变量配置与安全策略(白名单、路径限制、密码脱敏)
  auth.py         # AuthProvider 抽象:PasswordAuth,以及 XOAuth2Auth 的骨架
  models.py       # 工具返回的 Pydantic 模型,也就是对模型暴露的契约
  imap_client.py  # 收信:连接、搜索、解析、标记、移动、附件、轮询新邮件
  smtp_client.py  # 发信:MIME 组装与投递
  server.py       # MCPServer:全部工具、资源与提示词
  __main__.py     # CLI 入口

每次 IMAP 操作都是"连接 → 干活 → 登出"。IMAP 服务器会主动断开空闲连接,而一个 MCP 服务器可能几小时都没人调用,长连接放在那儿多半已经死了。

扩展 OAuth2

auth.py 里的 AuthProvider 就是为此准备的:imap_clientsmtp_client 从不直接接触密码,只调用 authenticate_imap / authenticate_smtp

XOAuth2Auth 已经写好了两侧的 SASL XOAUTH2 报文格式,缺的只是令牌本身——给它一个能返回 access token 的 token_provider 就能工作。还没做的是外围的授权流程:拿到 refresh token、刷新、本地缓存。这部分完成后,build_auth() 里加一个分支即可,IMAP 与 SMTP 客户端一行都不用改。

已知限制

  • 等待新邮件用的是轮询而非 IMAP IDLE 推送。imaplibidle() 要 Python 3.13 才有,而轮询对所有服务商都可用;代价是最长有一个轮询间隔的延迟。

  • HTML 邮件转纯文本是基于标准库 HTMLParser 的朴素实现,能保留段落和列表的换行,但复杂排版(表格布局、内联样式)会被压平。

  • 尚未实现 OAuth2 授权流程,因此接不了已停用基本认证的 Microsoft 账号。

许可

MIT

Available Tools

11 tools
check_connectionCheck the mail connectionA
Read-only

Verify the IMAP and SMTP credentials and report which actions are permitted.

Run this first when a tool fails or the account setup is unknown. Credentials are never included in the result.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
imapYes
smtpYes
accountNoUsername the server is configured to use.
sending_enabledNo
deleting_enabledNo
recipient_allowlistNo

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark it read-only, and the description adds valuable behavior: credentials are never included in the result and the tool reports permitted actions. This helps set expectations beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with no filler. The core purpose is front-loaded, and the usage guidance and privacy note each earn their place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless diagnostic tool with an output schema, the description fully covers when to use it, what it verifies, and an important behavioral caveat. Nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the schema carries no burden. The description appropriately focuses on behavior rather than parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: verify IMAP/SMTP credentials and report permitted actions. This clearly differentiates it from the sibling email operations, none of which are diagnostic.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to run this tool first when a tool fails or account setup is unknown. This gives an agent a clear decision rule for when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

delete_emailDelete an emailA
Destructive

Move a message to Trash. Requires EMAIL_ALLOW_DELETE=true.

This is a move, not an expunge, so the user can still recover the message from their Trash folder.

ParametersJSON Schema
NameRequiredDescriptionDefault
uidYesIMAP UID of the message.
folderNoFolder the message is in.INBOX

Output Schema

ParametersJSON Schema
NameRequiredDescription
uidYes
actionYesWhat was done, e.g. 'moved' or 'marked read'.
detailNo
folderYes

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructiveHint=true, but the description adds that the operation is a move to Trash rather than an expunge, so the message remains recoverable. It also discloses the EMAIL_ALLOW_DELETE=true prerequisite. These details go beyond the annotation and clarify the actual destructive scope and conditions, providing substantial added context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (two short paragraphs) and front-loads the core action and prerequisite in the first sentence. The second paragraph adds a single clarifying nuance about recoverability. No unnecessary words or repetition. It is well-structured and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with only 2 parameters (1 required) and an output schema present, the description covers the essential behavioral aspects: the action, the recoverability, and the prerequisite. Nothing critical is missing, and the existence of an output schema means return values are already defined. The description is complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes both parameters (uid and folder) with 100% coverage. The description does not add further explanation of parameters or their usage beyond what the schema provides. It only mentions the folder implicitly through the move-to-Trash action, but that's not new information. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Move a message to Trash') with a clear resource (a message) and destination (Trash). It differentiates from the sibling move_email by specifying the Trash destination and the recoverable nature, making its purpose unambiguous. The title also aligns perfectly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives like move_email. It implies this is for deletion (to Trash) but doesn't contrast with move_email or other siblings. The only guideline is the prerequisite EMAIL_ALLOW_DELETE=true, which is a requirement rather than a selection criterion. Guidance is minimal but present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

download_attachmentDownload an attachmentA

Save an attachment into the server's attachment directory and return its path.

Writes are confined to EMAIL_ATTACHMENT_DIR, and the sender's filename is sanitised before use.

ParametersJSON Schema
NameRequiredDescriptionDefault
uidYesIMAP UID of the message.
folderNoFolder the message is in.INBOX
filenameNoWhich attachment to save. Required when the message has several.

Output Schema

ParametersJSON Schema
NameRequiredDescription
pathYesAbsolute path of the saved file.
sizeNo
filenameYes
content_typeNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate this is a write operation (readOnlyHint=false) and not destructive (destructiveHint=false). The description adds materially useful context: writes are confined to EMAIL_ATTACHMENT_DIR and filenames are sanitised, which clarifies side-effect scope and security behavior. This goes beyond the annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences deliver the action, result, and key behavioral constraints with no redundancy. The most important information is front-loaded, and every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with full schema coverage, an output schema, and annotations covering read/write/destructive hints, the description is sufficiently complete. It adds security and scope constraints that matter for safe invocation. Minor omissions like overwrite behavior or error handling are not critical given the available structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameters are fully documented in the schema. The description does not add parameter-level meaning, but it also does not need to because the schema already explains uid, folder, and filename. The baseline of 3 applies because the description offers no supplementary parameter insight.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Save an attachment'), the destination ('server's attachment directory'), and the result ('return its path'). It clearly distinguishes itself from the sibling tools, none of which handle attachment downloading.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose implicitly defines when to use this tool: when a downloaded attachment is needed. However, there is no explicit guidance about when not to use it or which alternatives to prefer. The description does not mention exclusions or conditions beyond the simple action, so guidance is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_foldersList mail foldersA
Read-only

List the folders in the mailbox, with their IMAP special-use flags.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds that the output includes IMAP special-use flags, which is useful return-value context. However, it does not disclose potential behaviors such as sorting, pagination, failure modes, or whether folder hierarchy details are included.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that immediately states what the tool does and the key output detail. There is no filler, and the most important information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only, zero-parameter list operation with an output schema present, the description is sufficient. The agent knows what will be returned (folders with IMAP special-use flags) and that no arguments are needed. Nothing essential is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and schema description coverage is 100%, so the schema fully defines the input contract. With no parameters to explain, the description does not need to add parameter-level detail. This warrants the baseline score of 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'List the folders in the mailbox'. It also adds a distinguishing detail, 'with their IMAP special-use flags', which is not present in any sibling tool description. This makes the tool's purpose clear and unique among the listed siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit guidance about when to use this tool versus alternatives, nor any mention of prerequisites such as needing an existing connection. The tool name and description make the basic intent obvious, but the description does not provide usage context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mark_emailFlag an emailA
Idempotent

Mark a message read or unread, and flag or unflag it.

ParametersJSON Schema
NameRequiredDescriptionDefault
uidYesIMAP UID of the message.
seenNoTrue marks it read, False marks it unread.
folderNoFolder the message is in.INBOX
flaggedNoTrue stars/flags it, False clears the flag.

Output Schema

ParametersJSON Schema
NameRequiredDescription
uidYes
actionYesWhat was done, e.g. 'moved' or 'marked read'.
detailNo
folderYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already convey readOnlyHint=false, destructiveHint=false, idempotentHint=true, and openWorldHint=true. The description adds no behavioral context beyond those annotations; it restates the seen/flagged actions without disclosing additional traits such as authorization needs or side effects, so it meets the baseline but does not exceed it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence communicates the complete purpose with no filler or redundancy. Every word contributes to understanding the tool's scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the annotations, full parameter schemas, and an output schema, the concise description is sufficient for an agent to select and invoke the tool correctly. The only slight tension is the title, but the description resolves it, so nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter (uid, seen, folder, flagged) already has a clear schema description. The tool description adds no additional parameter semantics beyond what the schema provides, matching the baseline for full schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('mark') and resource ('a message') and enumerates the exact operations: read/unread and flag/unflag. Although the title 'Flag an email' is narrower, the description clarifies the full scope and distinguishes this from sibling tools like read_email, move_email, and delete_email.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The context is clear: use this tool when a message's seen or flagged state needs to be changed. However, the description does not explicitly state alternatives or exclusion conditions, such as 'use read_email if you only need to view the message,' so usage guidance is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

move_emailMove an emailA
Destructive

Move a message to another folder. Requires EMAIL_ALLOW_DELETE=true.

ParametersJSON Schema
NameRequiredDescriptionDefault
uidYesIMAP UID of the message.
folderNoFolder the message is currently in.INBOX
destinationYesFolder to move the message into.

Output Schema

ParametersJSON Schema
NameRequiredDescription
uidYes
actionYesWhat was done, e.g. 'moved' or 'marked read'.
detailNo
folderYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag this as destructive, so the description's added value is the permission requirement EMAIL_ALLOW_DELETE=true, which is useful operational context. This does not contradict the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences with no filler. The core action is front-loaded and the permission requirement is stated immediately after.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, has an output schema, and benefits from annotations that indicate destructive behavior. The description adds the key precondition. A minor gap is that it does not describe failure behavior, but this is not critical given the annotations and schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents uid, folder, and destination. The description does not add parameter-specific meaning beyond the action, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Move') and resource ('message to another folder'), making the operation unambiguous. It stands apart from siblings like delete_email and mark_email because the action and target are clearly named.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for when to use the tool: moving a message between folders. It also provides a concrete precondition, EMAIL_ALLOW_DELETE=true, which helps an agent determine whether the call is permitted. It does not explicitly exclude alternatives, but the context is sufficient given the sibling set.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_emailRead an emailA
Read-only

Open one message and return its body, headers, and attachment list.

Bodies are returned as plain text; HTML-only messages are converted, and long bodies are truncated with a marker rather than silently cut.

ParametersJSON Schema
NameRequiredDescriptionDefault
uidYesIMAP UID, as returned by search_emails.
folderNoFolder the message is in.INBOX
mark_as_readNoSet the Seen flag as a side effect of reading.
max_body_charsNoOverride the configured body length limit.

Output Schema

ParametersJSON Schema
NameRequiredDescription
ccNo
toNo
uidYes
bodyNoPlain-text body. HTML-only mail is converted to text.
dateNo
seenNo
sizeNo
folderYes
senderNo
flaggedNo
subjectNo
reply_toNo
truncatedNoTrue when the body was cut short at the configured limit.
message_idNoRFC 5322 Message-ID, used for threading replies.
referencesNo
attachmentsNo
in_reply_toNo
sender_nameNo
body_is_converted_htmlNoTrue when the message had no plain-text part and the body was derived from HTML.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint and openWorldHint annotations, the description discloses useful return-behavior details: HTML-only messages are converted to plain text, and long bodies are truncated with a marker rather than silently cut. This helps the agent set expectations about the content it will receive. It does not discuss error behavior or rate limits, but with read-only annotation coverage this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences front-load the core behavior and then add the only critical output caveat about body conversion and truncation. There is no filler, repetition, or unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema, 100% parameter coverage, and read-only annotations, the description covers the important behavioral caveats. A minor gap is the lack of an explicit pointer to download_attachment for attachment content, but the phrase 'attachment list' already distinguishes the tool from that sibling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameters are already well documented. The description adds no parameter-specific meaning beyond confirming that body, headers, and attachment list are returned; therefore the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: 'Open one message and return its body, headers, and attachment list.' This clearly identifies the operation and distinguishes it from sibling tools like search_emails (finding messages) and download_attachment (fetching attachment bytes).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the intended flow: after search_emails returns a UID, open that message. The uid parameter description reinforces this by saying the UID comes from search_emails. However, the description itself does not explicitly list when not to use this tool or direct the agent to download_attachment for actual attachment content, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

save_draftSave a draftA

Write a message to the Drafts folder without sending it.

This is the safe way to prepare mail: the user opens their own mail client, reviews it, and sends it themselves. It works even when EMAIL_ALLOW_SEND is false, because nothing leaves the account.

ParametersJSON Schema
NameRequiredDescriptionDefault
ccNoCc recipients.
toNoIntended recipients.
bccNoBcc recipients.
bodyYesPlain-text body.
htmlNoOptional HTML alternative.
subjectYesSubject line.
attachmentsNoFilenames inside the server's attachment directory.
reply_to_uidNoUID of a message this draft replies to.
reply_to_folderNoFolder holding the message being replied to.INBOX

Output Schema

ParametersJSON Schema
NameRequiredDescription
folderYesFolder the draft was appended to.
subjectNo
message_idYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate this is a mutating operation (readOnlyHint=false) but not destructive. The description adds substantive context beyond annotations: it writes to the Drafts folder, nothing leaves the account, and it is safe when sending is disabled. This gives the agent important behavioral expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences with each one earning its place: the core action, the safety rationale, and the crucial condition about EMAIL_ALLOW_SEND. It is front-loaded with the primary purpose and contains no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists and annotations are present, the description covers the essential context for correct invocation: what the tool does, why it is safe, and when it works. A bit more detail about draft placement or reply_to behavior would be helpful but is not required for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents every parameter. The description does not add parameter-specific detail, but the baseline of 3 applies because the schema carries the full burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Write a message to the Drafts folder without sending it.' It clearly differentiates from send_email by emphasizing that the user will send it themselves, so an agent can distinguish this tool from its siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use this tool: as the safe way to prepare mail when the user wants to review it first, and it explicitly notes it works when EMAIL_ALLOW_SEND is false. It does not name send_email outright but the contrast is strong enough to guide selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_emailsSearch emailA
Read-only

Find messages, newest first, returning short summaries rather than full bodies.

Every filter is combined with AND, and omitting all of them returns the most recent messages in the folder. Reading a message costs a separate read_email call, using the uid from these results.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results.
sinceNoOnly messages sent on or after this date.
beforeNoOnly messages sent strictly before this date.
folderNoFolder to search.INBOX
to_containsNoMatch the To header against this substring.
unread_onlyNoOnly unread messages.
flagged_onlyNoOnly flagged/starred messages.
from_containsNoMatch the From header against this substring.
text_containsNoMatch anywhere in the headers or body.
subject_containsNoMatch the subject against this substring.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint, and the description adds meaningful behavior: newest-first ordering, summary-only results, AND-combined filters, and empty-query behavior. It also clarifies the relationship to read_email via uid. This goes well beyond the structured annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences front-load the core purpose, then compactly convey filter behavior and the necessary next step. Every sentence earns its place, and there is no redundancy with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter search tool, the description plus rich schema and output schema cover the essentials: order, result shape, filter semantics, default behavior, and follow-up action. It is not fully exhaustive—e.g., it does not mention pagination beyond limit—but the available structured data fills most gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds value by explaining how filters combine (AND) and what happens when no filters are provided, which is not stated in individual parameter descriptions. This is a meaningful supplement to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description names a specific verb ('Find messages') and resource, and differentiates from sibling tools by explicitly stating the result is short summaries, not full bodies. It also names the companion read_email call, so the agent understands where search ends and retrieval begins.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: filters are ANDed, omitting all filters returns recent messages, and full message bodies require a separate read_email call. It does not explicitly enumerate when not to use this tool versus siblings like wait_for_new_emails, but the context is strong enough for an agent to choose correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send_emailSend an emailA

Send an email. This is irreversible: confirm the content with the user first.

Sending only works when EMAIL_ALLOW_SEND=true, and every recipient must pass the configured allowlist. Pass reply_to_uid to answer an existing message: the reply is threaded correctly and the recipient and subject are filled in from the original.

ParametersJSON Schema
NameRequiredDescriptionDefault
ccNoCc recipients.
toNoRecipients. Plain addresses or 'Name <a@b.com>' both work.
bccNoBcc recipients.
bodyYesPlain-text body.
htmlNoOptional HTML alternative. Always send body as well.
subjectYesSubject line.
attachmentsNoFilenames inside the server's attachment directory.
reply_to_uidNoUID of a message to reply to; threads the reply and fills in To.
reply_to_folderNoFolder holding the message being replied to.INBOX

Output Schema

ParametersJSON Schema
NameRequiredDescription
senderYes
subjectNo
acceptedYesRecipients the server accepted.
rejectedNoRecipients the server refused.
message_idYesMessage-ID assigned to the outgoing mail.
saved_to_folderNoFolder a copy was appended to, when the account keeps sent mail server-side.
attachment_countNo

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description reveals that sending is irreversible, requires user confirmation, is gated by an environment flag, and enforces recipient allowlisting. It also explains reply threading/filling behavior. This is rich contextual disclosure that helps the agent anticipate real-world consequences.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tightly written sentences. The most important safety warning is front-loaded, followed by enabling conditions and a specific usage pattern. There is no filler or repetition of schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter tool, the description covers the key operational constraints: side-effect irreversibility, user confirmation, environment gating, allowlist enforcement, and reply behavior. The schema covers parameters, and an output schema exists, so nothing critical is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds meaningful semantics for reply_to_uid, explaining that it threads the reply and auto-fills recipient and subject. This goes beyond the schema's simple field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Send an email', a specific verb and resource. It further differentiates itself by highlighting irreversibility and the reply behavior, which separates it from sibling tools like save_draft and read_email.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: confirm content first, sending only works when EMAIL_ALLOW_SEND=true, allowlist requirements, and how to reply via reply_to_uid. It does not explicitly contrast with save_draft, so it misses the full 'when to use vs alternatives' guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wait_for_new_emailsWait for new emailA
Read-only

Block until mail arrives in the folder, then return the new messages.

Use this to wait for something expected, such as a verification code. It returns as soon as anything arrives, or empty-handed when the timeout elapses; nothing already in the folder is reported.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum messages to return.
folderNoFolder to watch.INBOX
timeout_secondsNoHow long to wait before giving up.
poll_interval_secondsNoSeconds between checks.

Output Schema

ParametersJSON Schema
NameRequiredDescription
messagesNoMessages that arrived during the wait, oldest first.
timed_outYesTrue when the wait elapsed with nothing new arriving.
waited_secondsYes

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses blocking behavior, early return upon arrival, empty results on timeout, and exclusion of pre-existing messages. These details go beyond the readOnlyHint and openWorldHint annotations and give the agent accurate expectations for a potentially long-running call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight paragraphs with no filler; the main verb and resource come first, followed by a use case and edge-case behavior. Every sentence contributes useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a blocking read tool, the description, annotations, full parameter schema, and output schema together fully specify when and how to invoke it. The agent knows the purpose, wait semantics, timeout behavior, and that existing messages are excluded.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with all four parameters documented with defaults and bounds, so the description does not need to repeat parameter details. It adds contextual framing around blocking and new messages, but no parameter-specific semantics beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description opens with a clear verb ('Block') and resource ('mail arrives in the folder... return the new messages'). It distinguishes itself from reading existing mail by emphasizing only new arrivals and gives a concrete example use case (verification code).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States when to use it: 'wait for something expected, such as a verification code.' It also clarifies a boundary with 'nothing already in the folder is reported,' which tells the agent not to use this for reading existing mail. It does not explicitly name sibling alternatives, but the context is clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 11 tool updatesv0.1.0
    • First observedcheck_connection
    • First observeddelete_email
    • First observeddownload_attachment
    • First observedlist_folders
    • First observedmark_email
    • First observedmove_email
    • First observedread_email
    • First observedsave_draft
    • First observedsearch_emails
    • First observedsend_email
    • First observedwait_for_new_emails

TDQS

A4.3/5.0
Disambiguation5/5

Each tool maps cleanly to a distinct action in the email workflow: read, search, wait, send, draft, mark, move, delete, download, list folders, and check connection. Even similar operations like move_email and delete_email are clearly separated by delete targeting Trash.

Naming Consistency5/5

All tools use a consistent snake_case verb_noun pattern: read_email, list_folders, send_email, save_draft, etc. Multi-word verbs like wait_for_new_emails follow the same clear convention without mixing styles.

Tool Count5/5

The 11 tools are well-scoped for an email server covering sending, receiving, searching, drafts, attachments, folders, and account health. Each tool has a clear purpose and none feel redundant.

Completeness4/5

Core email workflows are well covered: read, search, send, draft, move, delete, mark, and attachment download. Minor gaps exist, such as no explicit attachment support when sending and no folder creation or management, but these are not critical dead ends.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables email management through IMAP and SMTP protocols, supporting reading, sending, replying to emails with proper threading, and downloading attachments. Supports multiple email accounts with flexible configuration options.
    1
    BSD 3-Clause
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables email management for a single mailbox via IMAP and SMTP protocols. Supports reading, searching, and sending emails with threading support through stdio or HTTP transports.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to interact with email accounts via IMAP and SMTP, supporting mailbox listing, email search, retrieval, sending, and management.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/concurrent2024/mcp-email-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server