Skip to main content
Glama
Mailu 邮箱 MCP

Mailu 邮箱 MCP

Mailu Mail MCP

自用项目 · 本仓库主要供维护者自用。

English quick start

让 Agent 替你查看自有 Mailu 站点的邮箱和别名,或整理一个已授权邮箱里的来信。管理域名、读信和发信分别使用 Mailu API、IMAP 和 SMTP,可以只配置自己需要的那项。

按要做的事连接账号

想看什么

准备什么

怎样确认接通

管理员能看到哪些域名和邮箱

MAILU_API_URL、MAILU_API_TOKEN_FILE

mailu_status 返回 domains,mailu_list_mailboxes 列出邮箱资料。

自己收件箱里最近的来信

MAILU_IMAP_HOST、MAILU_IMAP_USER、MAILU_IMAP_PASSWORD_FILE

对已授权的邮箱调用 mailu_list_messages,可读到主题、发件人等邮件头。

例如「只列最近五封来信的发件人和主题」走 IMAP。只想看收件箱时,配置邮箱自己的登录即可。要发送或回复,再设置 MAILU_SMTP_HOST;同一邮箱可沿用 IMAP 用户名和密码文件,也可单独指定 SMTP 凭据。

Related MCP server: Email MCP Server

安装和认证

Python 3.11+。运行 python -m venv .venv 后,在该环境中运行 python -m pip install -r requirements.txt。需要管理域名、邮箱或别名时,设置 MAILU_API_URL 为原生 API 地址(含 /api/v1),MAILU_API_TOKEN_FILE 为管理员的令牌文件。只读取邮件时,配置 MAILU_IMAP_HOST、MAILU_IMAP_USER、MAILU_IMAP_PASSWORD_FILE;默认使用 TLS 的 993 端口。支持邮箱与别名查询、创建、消息头和正文读取。创建邮箱时,在仅管理员可读的 MAILU_NEW_PASSWORD_DIR 内预置以小写邮箱地址的 SHA-256 加 .txt 命名的初始密码文件。别名目标限已存在的本地邮箱。Mailu REST API

使用 python client_config.py cursor、python client_config.py dsh 或 python client_config.py codex 输出对应客户端的配置。将其合并到已有 MCP 或 DSH 插件列表。配置生成器接受重复的 --env NAME=VALUE 以传递路径和站点设置。

账号管理窗口

账号版从本插件详情页点「管理」→「已连接的账户」→「连接另一个账户」。已连接账号右侧菜单提供重命名、重新连接和断开连接。

使用独立 stdio 客户端时可运行 python account_manager.py 设置本机账号。站点与凭据保存在部署端;图形窗口需要 Python 的 Tk 组件。

管理 API 注册邮箱、设置密码、管理别名。改密使用 MAILU_NEW_PASSWORD_DIR 下以小写邮箱地址 SHA-256 命名的 .txt 私有文件。IMAP 读信,SMTP 支持发送、抄送和带 In-Reply-To 的回复。发送使用所选邮箱的独立 SMTP 凭据(可与此账号的 IMAP 登录一致)。SMTP 接受表示提交到邮件服务器,收件端投递另行确认。

多账号和终端更新

MCP 入口为 router.py,需要 Python 3.11+。主机在本地保存账号配置,默认位置为 ~/.config/ldai-mcp/mailu/accounts.json,也可用 LDAI_ACCOUNTS_FILE 指定。复制 两账号示例,将地址与路径换成自己的值。每个账号可以对应不同的 Mailu 站点、管理令牌或 IMAP 邮箱。只读个人收件箱时仅需该账号的 IMAP 配置。

ldai_accounts 仅列出别名和连接状态。配置两个账号后,工具以 work__ 和 personal__ 前缀区分,所选工具始终进入该账号的独立子进程。已有单账号配置继续使用原工具名。运行 python profile_exec.py work -- <程序> <参数…> 可在同一账号环境完成登录或初始化。完成配置后重新连接 MCP。需要自有适配器时,管理员可为某个账号填写可信 stdio 程序的 command、args 和 env;连接器仅发布当前产品前缀下的业务工具。

安装本仓库后,其他终端可运行 git pull --ff-only;Python 服务在其虚拟环境执行 python -m pip install -r requirements.txt,随后重新加载客户端。需要固定版本时可检出发布标签。

维护者在 main 提交改进、运行测试,并同步更新 connector.json、两个插件清单的版本,再执行 python build_plugin.py --push。此命令将 main 与版本标签一起推送到本仓库,再从已提交文件生成 ZIP。更新既有账号插件时传 --account-name <既有包名>,把生成的 ZIP 发布到同一插件。包内 release-source.json 记录精确提交,可与各终端核对。Git 推送与账号插件发布是两个独立步骤。

许可为 AGPL-3.0-only。许可全文

English quick start

To read a user's inbox, configure the account's IMAP host, username and password file. To administer Mailu, configure the API URL ending in /api/v1 and a token file instead. Install the Python requirements in a Python 3.11+ virtual environment, run python client_config.py cursor, and reload the generated client entry with the appropriate settings. Use mailu_list_messages for recent message headers or mailu_status for the API token's visible domains.

实现参考

按 Mailu 原生资源实现邮箱和别名操作,并对照社区连接器的认证与资源映射。GitHub 统计核对日期为 2026-11-11。

原生插件页多账号接入候选版:部署、覆盖范围与验收

使用 Codex 插件页连接、重连和管理多个工作站账号,见工作站接入。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Read the verification code (OTP) and test emails your app sends to a catch-all test hostname. Four read-only tools: list_domains, get_latest_otp, list_messages, get_message. Needs a MailBots API key from the 14-day free trial (no card, no DNS) or a paid plan. Setup: https://mailbots.top/docs/mcp

      https://api.mailbots.top/v1/mcp
    • Provision domains, mailboxes, and run email sequencer campaigns via remote MCP.

      https://mails.now/mcp/mailapi
    • Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.

    • Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      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
      A
      maintenance
      Enables AI assistants to read, search, send, schedule, manage, and analyze mail across multiple IMAP/SMTP accounts, with provider-aware labels, real-time IDLE watching, verification-code capture, and OAuth2 support. Connects over stdio or Streamable HTTP, exposing 52 tools, 7 prompts, and 6 resources with a guided setup wizard.
      31 npm
      ISC
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to read, search, send, schedule, manage, and analyze mail across multiple IMAP/SMTP accounts, including drafts, provider-aware labels, real-time IDLE triage, verification-code capture, and calendar extraction. Runs over stdio for local clients or Streamable HTTP for networked access, with a guided setup wizard and OAuth2 support.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to read, search, send, schedule, and organize mail across multiple IMAP/SMTP accounts, including drafts, provider-aware labels, analytics, calendar extraction, and real-time inbox watching with verification-code capture. Runs over stdio or Streamable HTTP and supports auto-detected providers, OAuth2, and multi-account operation.
      31 npm
      ISC