AgentMail MCP 集成
一个简单的**模型上下文协议 (MCP)**服务器,与AgentMail集成,可动态管理电子邮件收件箱、列出邮件以及发送或回复邮件——所有这些都通过 Claude 等 AI 助手完成。此参考实现演示了如何在 MCP 服务器中使用 AgentMail 的 API 来动态编排电子邮件收件箱。
关于 AgentMail
AgentMail 是一家 API 优先的电子邮件服务提供商,允许 AI 代理动态创建收件箱,用于发送、接收和处理电子邮件。我们在电子邮件层之上构建了智能层,并针对代理工作流程进行了优化,使数据易于 LLM 消化。点击此处申请 API 密钥!
重要提示
由于 MCP 协议仍在不断发展,因此这是一个正在开发中的软件包。一旦添加新功能,我们将立即更新。加入我们的 Discord,加入社区! Discord
特征
- 动态创建新的收件箱
- 列出并检索收件箱以查看哪些是活动的
- 从任何 AgentMail 收件箱发送电子邮件
- 回复现有主题内的消息
- 列出所选收件箱中的线程和消息
- 检索邮件附件
先决条件
- Python 3.10+
- AgentMail API 密钥
- (可选) Claude Desktop或任何其他支持 MCP 命令的前端
安装
该项目有一个 PyPi 包。安装后,您可以在 Claude Desktop 配置中引用它(或直接运行它)以启用电子邮件管理工具。
PIP(本地或 PyPI)
如果您维护自己的 Python 环境,只需从虚拟环境(来自 PyPI 或本地源)安装包:
然后运行:
这将使服务器在您的本地机器上运行。
选项 1:使用 Claude Desktop
如果您想从 Claude Desktop 与服务器进行交互,请按照以下步骤操作。
- 激活您的虚拟环境。
- 运行以下命令查找 Agentmail MCP 服务器软件包的位置。如果您在虚拟环境中安装了 agentmail-mcp 软件包,它应该位于某个 .venv/bin/ 目录中。对于 Claude Desktop,务必在虚拟环境中安装它。
- 复制返回的路径。
- 将路径粘贴到
claude_desktop_config.json
文件中的command
字段中。 - 重新启动 Claude Desktop。
claude_desktop_config.json
文件如下所示:
如果您没有claude_desktop_config.json
文件,请在以下目录中创建一个:
在 macOS 上,配置文件通常位于:~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上,它通常位于:%APPDATA%/Claude/claude_desktop_config.json
保存后,重新启动Claude Desktop以加载新的MCP服务器。
用法
在您的服务器运行 Claude Desktop(或其他 MCP 客户端)时,您可以使用与 AgentMail MCP 工具对应的自然语言命令来提示 Claude。例如:• “创建一个名为 demo 的新收件箱。”• “列出我的所有收件箱。”• “从收件箱test@agentmail.to发送一封电子邮件到test@example.com ,主题为“Hello”,正文内容为过去一周旧金山的天气情况。”• “回复收件箱 abc123 中的最新消息。”
在内部,Claude 调用公开的 MCP 工具(create_inbox、list_inboxes、send_message 等),进而调用 AgentMail API。
执照
执照
MIT 许可证 - 本项目遵循 MIT 许可证。使用风险自负。
⸻
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
为 AI 代理提供即时收件箱。代理/法学硕士 (LLM) 可以在独立的收件箱中发送、接收和执行操作。与 Gmail 不同,专为 AI 打造。访问 agentmail.to 了解我们
Related MCP Servers
- -securityFlicense-qualityEnables users to manage Gmail accounts using AI agent-assisted operations via an MCP protocol, supporting email search, reading, deletion, and sending with a voice-powered interface.Last updated -610
- AsecurityFlicenseAqualityProvides an interface to manage email marketing, contact lists, dynamic templates, and email analytics via SendGrid's API.Last updated -819
- AsecurityFlicenseAqualityAn MCP-based email tool that enables AI models to access email services through standardized interfaces, allowing AI assistants to perform various email operations like sending emails, reading inboxes, and handling attachments.Last updated -1735
- -securityFlicense-qualityEnables AI assistants to interact with Gmail accounts via IMAP, allowing them to list, search, read, and send emails, manage labels and folders, and access attachments through the Model Context Protocol.Last updated -