agentmail-mcp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AgentMail MCP Server

AgentMail MCP Server

Connect AgentMail to any MCP-compatible AI client. Three setup options available.
将AgentMail连接到任何兼容MCP的AI客户端。提供三种设置选项。

Prerequisites

前提条件

Get your API key from console.agentmail.to.

console.agentmail.to获取您的API密钥。

Option 1: Remote MCP (Simplest)

选项1:远程MCP(最简单)

No installation required. Connect directly to the hosted MCP server.
URL:
https://mcp.agentmail.to
Add to your MCP client configuration:
json
{
  "mcpServers": {
    "AgentMail": {
      "url": "https://mcp.agentmail.to",
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

无需安装。直接连接到托管的MCP服务器。
URL:
https://mcp.agentmail.to
将以下内容添加到您的MCP客户端配置中:
json
{
  "mcpServers": {
    "AgentMail": {
      "url": "https://mcp.agentmail.to",
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 2: Local npm Package

选项2:本地npm包

Run the MCP server locally via npx.
json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": ["-y", "agentmail-mcp"],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
通过npx在本地运行MCP服务器。
json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": ["-y", "agentmail-mcp"],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Tool Selection

工具选择

Load only specific tools with the
--tools
argument:
json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": [
        "-y",
        "agentmail-mcp",
        "--tools",
        "send_message,reply_to_message,list_inboxes"
      ],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

通过
--tools
参数仅加载特定工具:
json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": [
        "-y",
        "agentmail-mcp",
        "--tools",
        "send_message,reply_to_message,list_inboxes"
      ],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Option 3: Local Python Package

选项3:本地Python包

Install and run the Python MCP server.
bash
pip install agentmail-mcp
安装并运行Python MCP服务器。
bash
pip install agentmail-mcp

Claude Desktop

Claude Desktop

Config location:
  • macOS:
    ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:
    %APPDATA%/Claude/claude_desktop_config.json
json
{
  "mcpServers": {
    "AgentMail": {
      "command": "/path/to/your/.venv/bin/agentmail-mcp",
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
Find your path:
bash
undefined
配置文件位置:
  • macOS:
    ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:
    %APPDATA%/Claude/claude_desktop_config.json
json
{
  "mcpServers": {
    "AgentMail": {
      "command": "/path/to/your/.venv/bin/agentmail-mcp",
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
查找路径:
bash
undefined

Activate your virtual environment, then:

激活您的虚拟环境,然后执行:

which agentmail-mcp
undefined
which agentmail-mcp
undefined

Run Standalone

独立运行

bash
export AGENTMAIL_API_KEY=your-api-key
agentmail-mcp

bash
export AGENTMAIL_API_KEY=your-api-key
agentmail-mcp

Available Tools

可用工具

ToolDescription
create_inbox
Create a new email inbox
list_inboxes
List all inboxes
get_inbox
Get inbox details by ID
delete_inbox
Delete an inbox
send_message
Send an email from an inbox
reply_to_message
Reply to an existing message
list_threads
List email threads in an inbox
get_thread
Get thread details and messages
get_attachment
Download an attachment
update_message
Update message labels

工具名称描述
create_inbox
创建新的邮件收件箱
list_inboxes
列出所有收件箱
get_inbox
通过ID获取收件箱详情
delete_inbox
删除收件箱
send_message
从收件箱发送邮件
reply_to_message
回复现有邮件
list_threads
列出收件箱中的邮件线程
get_thread
获取线程详情及邮件内容
get_attachment
下载附件
update_message
更新邮件标签

Client Configuration

客户端配置

Cursor, VS Code, Windsurf

Cursor、VS Code、Windsurf

Add the same MCP server entry in your client config file:
Cursor:
.cursor/mcp.json

VS Code:
.vscode/mcp.json

Windsurf: MCP config file
json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": ["-y", "agentmail-mcp"],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

在您的客户端配置文件中添加相同的MCP服务器条目:
Cursor:
.cursor/mcp.json

VS Code:
.vscode/mcp.json

Windsurf: MCP配置文件
json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": ["-y", "agentmail-mcp"],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Compatible Clients

兼容客户端

The AgentMail MCP server works with any MCP-compatible client:
  • Claude Desktop
  • Cursor
  • VS Code
  • Windsurf
  • Cline
  • Goose
  • Raycast
  • ChatGPT
  • Amazon Q
  • Codex
  • Gemini CLI
  • LibreChat
  • Roo Code
  • And more...

AgentMail MCP服务器可与任何兼容MCP的客户端配合使用:
  • Claude Desktop
  • Cursor
  • VS Code
  • Windsurf
  • Cline
  • Goose
  • Raycast
  • ChatGPT
  • Amazon Q
  • Codex
  • Gemini CLI
  • LibreChat
  • Roo Code
  • 以及更多...

Example Usage

使用示例

Once configured, you can ask your AI assistant:
  • "Create a new inbox for support emails"
  • "Send an email to john@example.com with subject 'Hello'"
  • "Check my inbox for new messages"
  • "Reply to the latest email thanking them"
  • "List all my email threads"
  • "Download the attachment from the last message"

配置完成后,您可以向AI助手发出以下指令:
  • "创建一个用于支持邮件的新收件箱"
  • "发送一封主题为'Hello'的邮件给john@example.com"
  • "检查我的收件箱是否有新邮件"
  • "回复最新的邮件表示感谢"
  • "列出我所有的邮件线程"
  • "下载最后一封邮件中的附件"

Troubleshooting

故障排除

"Command not found"

"命令未找到"

Ensure npm/npx is in your PATH, or use the full path:
json
"command": "/usr/local/bin/npx"
确保npm/npx已在您的PATH中,或使用完整路径:
json
"command": "/usr/local/bin/npx"

"Invalid API key"

"无效的API密钥"

Verify your API key is correct and has the necessary permissions.
验证您的API密钥是否正确,且具备必要的权限。

Python package not found

Python包未找到

Use the full path to the agentmail-mcp executable in your virtual environment:
bash
undefined
使用虚拟环境中agentmail-mcp可执行文件的完整路径:
bash
undefined

Find the path

查找路径

source /path/to/venv/bin/activate which agentmail-mcp
undefined
source /path/to/venv/bin/activate which agentmail-mcp
undefined