resend-integration-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Links

链接

Quick Start

快速开始

1. Prerequisites

1. 前提条件

  • Node.js 20 or higher (required - the MCP server specifies
    engines: { "node": ">=20" }
    )
  • Resend account (free tier available at https://resend.com)
  • GitHub Copilot Pro or Cursor with Agent mode enabled
  • VS Code Insider (required for full MCP support)
  • npm or pnpm package manager
  • Node.js 20或更高版本(必填 - MCP服务器指定
    engines: { "node": ">=20" }
  • Resend账户(免费层级可在https://resend.com注册)
  • GitHub Copilot Pro或开启Agent模式的Cursor
  • VS Code Insider(完整MCP支持所需)
  • npm或pnpm包管理器

2. Clone and Build Resend MCP Server

2. 克隆并构建Resend MCP服务器

bash
undefined
bash
undefined

Clone the Resend MCP server repository

克隆Resend MCP服务器仓库

Install dependencies (npm or pnpm both supported)

安装依赖(npm和pnpm均支持)

npm install
npm install

or if you prefer pnpm:

或者如果你偏好pnpm:

pnpm install

pnpm install

Build the project (TypeScript compilation + executable permissions)

构建项目(TypeScript编译 + 可执行权限设置)

npm run build

The build process:
1. Compiles TypeScript to JavaScript
2. Sets executable permissions on the built script (Unix/macOS)
3. Creates the MCP server executable at `build/index.js`
npm run build

构建流程:
1. 将TypeScript编译为JavaScript
2. 为构建后的脚本设置可执行权限(Unix/macOS系统)
3. 在`build/index.js`生成MCP服务器可执行文件

3. Create Resend API Key

3. 创建Resend API密钥

  1. Visit https://resend.com/api-keys
  2. Create a new API key
  3. Copy the key to your clipboard (you'll need it for configuration)
  1. 访问https://resend.com/api-keys
  2. 创建新的API密钥
  3. 将密钥复制到剪贴板(配置时需要使用)

4. (Optional) Verify Your Domain

4. (可选)验证你的域名

To send emails from a custom domain:
  1. Go to https://resend.com/domains
  2. Add and verify your domain
  3. Update MCP configuration with
    --sender
    flag (see Configuration section)
若要从自定义域名发送邮件:
  1. 前往https://resend.com/domains
  2. 添加并验证你的域名
  3. 使用
    --sender
    标志更新MCP配置(请查看配置章节)

5. Configure MCP for Your Client

5. 为客户端配置MCP

Choose your setup based on your GitHub Copilot tier:
For GitHub Copilot Coding Agent (Repository-level setup):
This is the recommended approach for team collaboration. Repository admins configure MCP servers at the repository level.
  1. Navigate to your repository on GitHub.com
  2. Go to Settings → Copilot → Coding agent
  3. Add the following JSON configuration:
json
{
  "mcpServers": {
    "resend": {
      "type": "local",
      "command": "node",
      "args": ["/absolute/path/to/mcp-send-email/build/index.js"],
      "env": {
        "RESEND_API_KEY": "COPILOT_MCP_RESEND_API_KEY"
      },
      "tools": ["*"]
    }
  }
}
  1. Set up the Copilot environment:
    • Go to Settings → Environments
    • Create new environment called
      copilot
    • Add secret:
      COPILOT_MCP_RESEND_API_KEY
      with your API key value
  2. Click Save and Copilot will validate the configuration
For VS Code Local Development (Developer setup):
If you're developing locally or prefer VS Code configuration:
  1. Create
    .vscode/mcp.json
    in your project root:
json
{
  "servers": {
    "resend": {
      "type": "command",
      "command": "node",
      "args": ["/absolute/path/to/mcp-send-email/build/index.js"],
      "env": {
        "RESEND_API_KEY": "re_xxxxxxxxxxxxxx"
      }
    }
  }
}
  1. Get the absolute path to
    build/index.js
    :
    • Right-click
      build/index.js
      in VS Code → Copy Path
For Cursor Agent Mode:
Open Cursor Settings (Cmd+Shift+P → "Cursor Settings") and add to MCP config:
json
{
  "mcpServers": {
    "resend": {
      "type": "command",
      "command": "node /absolute/path/to/mcp-send-email/build/index.js --key=re_xxxxxxxxxxxxxx"
    }
  }
}
For Claude Desktop:
  1. Open Claude Desktop settings
  2. Go to Developer tab → Edit Config
  3. Add configuration:
json
{
  "mcpServers": {
    "resend": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-send-email/build/index.js"],
      "env": {
        "RESEND_API_KEY": "re_xxxxxxxxxxxxxx",
        "SENDER_EMAIL_ADDRESS": "onboarding@resend.dev",
        "REPLY_TO_EMAIL_ADDRESS": "reply@example.com"
      }
    }
  }
}
根据你的GitHub Copilot层级选择对应的设置方式:
针对GitHub Copilot Coding Agent(仓库级设置):
这是团队协作的推荐方式。仓库管理员在仓库层级配置MCP服务器。
  1. 导航到GitHub上的你的仓库
  2. 进入Settings → Copilot → Coding agent
  3. 添加以下JSON配置:
json
{
  "mcpServers": {
    "resend": {
      "type": "local",
      "command": "node",
      "args": ["/absolute/path/to/mcp-send-email/build/index.js"],
      "env": {
        "RESEND_API_KEY": "COPILOT_MCP_RESEND_API_KEY"
      },
      "tools": ["*"]
    }
  }
}
  1. 设置Copilot环境:
    • 进入Settings → Environments
    • 创建名为
      copilot
      的新环境
    • 添加密钥:
      COPILOT_MCP_RESEND_API_KEY
      ,值为你的API密钥
  2. 点击保存,Copilot将验证配置
针对VS Code本地开发(开发者设置):
如果你进行本地开发或偏好VS Code配置:
  1. 在项目根目录创建
    .vscode/mcp.json
json
{
  "servers": {
    "resend": {
      "type": "command",
      "command": "node",
      "args": ["/absolute/path/to/mcp-send-email/build/index.js"],
      "env": {
        "RESEND_API_KEY": "re_xxxxxxxxxxxxxx"
      }
    }
  }
}
  1. 获取
    build/index.js
    的绝对路径:
    • 在VS Code中右键点击
      build/index.js
      → 复制路径
针对Cursor Agent模式:
打开Cursor设置(Cmd+Shift+P → "Cursor Settings")并添加到MCP配置:
json
{
  "mcpServers": {
    "resend": {
      "type": "command",
      "command": "node /absolute/path/to/mcp-send-email/build/index.js --key=re_xxxxxxxxxxxxxx"
    }
  }
}
针对Claude Desktop:
  1. 打开Claude Desktop设置
  2. 进入Developer标签页 → Edit Config
  3. 添加配置:
json
{
  "mcpServers": {
    "resend": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-send-email/build/index.js"],
      "env": {
        "RESEND_API_KEY": "re_xxxxxxxxxxxxxx",
        "SENDER_EMAIL_ADDRESS": "onboarding@resend.dev",
        "REPLY_TO_EMAIL_ADDRESS": "reply@example.com"
      }
    }
  }
}

6. Test the Connection Using email.md Pattern

6. 使用email.md模板测试连接

The official Resend repository includes a test pattern using an
email.md
file:
  1. Create
    email.md
    in your project:
    markdown
    to: your-email@example.com
    subject: Test from Resend MCP
    content: This is a test email.
    
    Hello! This is a test email sent via Resend MCP.
    
    # You can also test CC and BCC:
    # cc: colleague@example.com
    # bcc: manager@example.com
  2. In Cursor (with Agent mode):
    • Open the
      email.md
      file
    • Select all text (
      Cmd+A
      /
      Ctrl+A
      )
    • Press
      Cmd+L
      /
      Ctrl+L
      (or use the context menu)
    • Tell Cursor: "send this as an email" or "send this email using resend MCP"
    • Make sure you're in Agent mode (toggle in chat dropdown)
  3. In Claude Desktop:
    • Paste the email.md content in the chat
    • Ask Claude to send it: "Send this email using the resend tool"
  4. In GitHub Copilot:
    • Open email.md file
    • Reference it in the chat: "@email.md send this email using resend"
If configured correctly, the email will be sent immediately and you'll receive confirmation.
Resend官方仓库包含使用
email.md
文件的测试模板:
  1. 在项目中创建
    email.md
    markdown
    to: your-email@example.com
    subject: Test from Resend MCP
    content: This is a test email.
    
    Hello! This is a test email sent via Resend MCP.
    
    # You can also test CC and BCC:
    # cc: colleague@example.com
    # bcc: manager@example.com
  2. 在Cursor(开启Agent模式)中:
    • 打开
      email.md
      文件
    • 全选文本(Cmd+A / Ctrl+A)
    • 按下Cmd+L / Ctrl+L(或使用右键菜单)
    • 告诉Cursor:"send this as an email"或"send this email using resend MCP"
    • 确保你处于Agent模式(在聊天下拉菜单中切换)
  3. 在Claude Desktop中:
    • 将email.md内容粘贴到聊天框
    • 让Claude发送:"Send this email using the resend tool"
  4. 在GitHub Copilot中:
    • 打开email.md文件
    • 在聊天中引用它:"@email.md send this email using resend"
如果配置正确,邮件将立即发送,你会收到确认信息。

Key Concepts

核心概念

MCP Configuration Types

MCP配置类型

There are two main ways to configure Resend MCP with GitHub Copilot:
1. GitHub Copilot Coding Agent (Repository-level)
  • Configuration in GitHub repository settings (Repository admin required)
  • Used when assigning Copilot tasks to work on GitHub issues
  • Requires explicit
    tools
    array specifying which tools Copilot can use
  • API keys stored as GitHub Actions secrets (prefixed with
    COPILOT_MCP_
    )
  • Autonomous execution without approval (security considerations apply)
2. VS Code Local Development
  • Configuration in
    .vscode/mcp.json
    (local developer setup)
  • Used for local development with VS Code Insider
  • API keys stored directly in config or environment variables
  • Better for individual developers or testing
配置Resend MCP与GitHub Copilot集成主要有两种方式:
1. GitHub Copilot Coding Agent(仓库级)
  • 在GitHub仓库设置中配置(需要仓库管理员权限)
  • 用于分配Copilot任务处理GitHub议题时
  • 需要明确的
    tools
    数组指定Copilot可以使用的工具
  • API密钥存储为GitHub Actions密钥(前缀为
    COPILOT_MCP_
  • 无需批准即可自主执行(需考虑安全因素)
2. VS Code本地开发
  • .vscode/mcp.json
    中配置(本地开发者设置)
  • 用于VS Code Insider的本地开发
  • API密钥直接存储在配置文件或环境变量中
  • 更适合个人开发者或测试场景

Resend MCP Server

Resend MCP服务器

The Resend MCP Server is a local Node.js application that exposes Resend's email functionality as tools for LLMs. It implements the Model Context Protocol, allowing AI agents to:
  • Send emails via natural language commands (plain text or HTML)
  • Schedule emails for future delivery
  • Add recipients (To, CC, BCC)
  • Configure sender information (From, Reply-To)
  • Broadcast emails to audience segments
  • Manage audiences - List Resend audiences for targeted sending
  • Support HTML and plain text email bodies
Recent additions (as of early 2026):
  • Broadcast and audience management tools for marketing campaigns
  • Better error handling and validation via Zod schemas
Resend MCP服务器是一个本地Node.js应用,它将Resend的邮件功能以工具形式暴露给大语言模型(LLM)。它实现了Model Context Protocol,允许AI Agent:
  • 通过自然语言命令发送邮件(纯文本或HTML格式)
  • 安排邮件在未来发送
  • 添加收件人(To、CC、BCC)
  • 配置发件人信息(From、Reply-To)
  • 向受众群体批量发送邮件
  • 管理受众列表 - 列出Resend受众群体以进行定向发送
  • 支持HTML和纯文本邮件正文
2026年初新增功能:
  • 用于营销活动的批量发送和受众管理工具
  • 通过Zod模式实现更好的错误处理和验证

MCP Configuration Methods

MCP配置方法

There are three ways to run the Resend MCP server:
  1. Command-type (VS Code/Cursor): Direct Node.js execution with inline arguments
  2. Stdio-type (Claude Desktop): Server handles I/O through environment variables
  3. HTTP-type (Remote/Cloud): Server exposed via HTTP endpoint
运行Resend MCP服务器有三种方式:
  1. 命令型(VS Code/Cursor):使用内联参数直接执行Node.js
  2. 标准输入输出型(Claude Desktop):服务器通过环境变量处理输入输出
  3. HTTP型(远程/云端):通过HTTP端点暴露服务器

GitHub Copilot Coding Agent Specifics

GitHub Copilot Coding Agent细节

For GitHub Copilot Coding Agent (repository-based setup):
  • Required
    tools
    array
    : Must specify which tools from the Resend MCP server Copilot can use
    • Use
      "tools": ["send_email", "schedule_email", ...]
      to allowlist specific tools
    • Use
      "tools": ["*"]
      to enable all tools
    • Use case-specific tool names from the MCP server documentation
  • No approval required: Once configured, Copilot will use these tools autonomously without asking
  • Security consideration: Copilot will have automated access to the Resend API via the configured tools, so only enable the tools you need
  • Environment variable handling: API keys must be stored as GitHub Actions secrets with
    COPILOT_MCP_
    prefix
    • Reference them in config as
      "COPILOT_MCP_RESEND_API_KEY"
      (without the value)
    • GitHub automatically passes the secret value to the MCP server
针对GitHub Copilot Coding Agent(基于仓库的设置):
  • 必填的
    tools
    数组
    :必须指定Copilot可以使用的Resend MCP服务器工具
    • 使用
      "tools": ["send_email", "schedule_email", ...]
      来允许特定工具
    • 使用
      "tools": ["*"]
      来启用所有工具
    • 使用MCP服务器文档中的特定用例工具名称
  • 无需批准:配置完成后,Copilot将自主使用这些工具,无需询问
  • 安全注意事项:Copilot将通过配置的工具自动访问Resend API,因此仅启用你需要的工具
  • 环境变量处理:API密钥必须存储为前缀为
    COPILOT_MCP_
    的GitHub Actions密钥
    • 在配置中通过名称引用它们:
      "COPILOT_MCP_RESEND_API_KEY"
      (不包含值)
    • GitHub会自动将密钥值传递给MCP服务器

Authentication

认证

Resend MCP server requires:
  • RESEND_API_KEY (required): Your Resend API key from https://resend.com/api-keys
  • SENDER_EMAIL_ADDRESS (optional): Verified domain email. If not set, AI will prompt for it
  • REPLY_TO_EMAIL_ADDRESS (optional): Email address for reply-to header
Resend MCP服务器需要:
  • RESEND_API_KEY(必填):来自https://resend.com/api-keys的Resend API密钥
  • SENDER_EMAIL_ADDRESS(可选):已验证的域名邮箱。如果未设置,AI会提示你输入
  • REPLY_TO_EMAIL_ADDRESS(可选):回复邮件头的邮箱地址

Verified Domains

已验证域名

By default, Resend allows sending to your own account email using the test domain
onboarding@resend.dev
. To send to other addresses:
  1. For testing: Use the default
    onboarding@resend.dev
    sender (no verification needed)
  2. For custom domains: Verify your domain at https://resend.com/domains
  3. Create a sender email from your verified domain
  4. Configure it in MCP environment variables (
    SENDER_EMAIL_ADDRESS
    )
Note: If you don't provide a
SENDER_EMAIL_ADDRESS
, the MCP server will prompt you each time you send an email.
默认情况下,Resend允许使用测试域名
onboarding@resend.dev
向你自己的账户邮箱发送邮件。若要向其他地址发送:
  1. 测试场景:使用默认的
    onboarding@resend.dev
    发件人(无需验证)
  2. 自定义域名:在https://resend.com/domains验证你的域名
  3. 从已验证的域名创建发件人邮箱
  4. 在MCP环境变量中配置它(
    SENDER_EMAIL_ADDRESS
注意:如果你未提供
SENDER_EMAIL_ADDRESS
,MCP服务器会在每次发送邮件时提示你输入。

Code Examples

代码示例

Example 1: Simple Email via Copilot Chat

示例1:通过Copilot Chat发送简单邮件

In VS Code Insider with GitHub Copilot Agent mode:
@workspace I need to send a notification email to john@example.com about the project completion. Use the resend MCP tool to send "Project ABC is now live" as the email body.
在开启GitHub Copilot Agent模式的VS Code Insider中:
@workspace 我需要向john@example.com发送一封关于项目完成的通知邮件。使用resend MCP工具发送邮件正文为"Project ABC is now live"的邮件。

Example 2: HTML Email with Custom Configuration

示例2:带有自定义配置的HTML邮件

Send an HTML email to team@example.com with subject "Monthly Report" and body formatted as an HTML table showing Q1 metrics. Use Resend MCP to send it.
向team@example.com发送一封HTML邮件,主题为"Monthly Report",正文为显示Q1指标的HTML表格。使用Resend MCP发送。

Example 3: Email with CC/BCC

示例3:带有CC/BCC的邮件

Send an email from onboarding@mycompany.com to customer@example.com CC'ing manager@company.com about account activation. Use Resend MCP.
从onboarding@mycompany.com向customer@example.com发送邮件,抄送manager@company.com,内容关于账户激活。使用Resend MCP。

Example 4: Scheduled Email

示例4:定时邮件

Schedule an email to be sent tomorrow at 9 AM using Resend MCP, reminding the team about the standup meeting.
使用Resend MCP安排一封邮件在明天上午9点发送,提醒团队关于站会的事宜。

Example 5: Integration with Data Processing

示例5:与数据处理集成

Read the CSV file users.csv, extract the top 10 active users with their emails, and send each a personalized thank you email using Resend MCP. Include their usage statistics in the email.
读取CSV文件users.csv,提取前10个活跃用户及其邮箱,并使用Resend MCP向每个人发送个性化的感谢邮件。在邮件中包含他们的使用统计数据。

Advanced Features

高级功能

Broadcast Emails

批量发送邮件

Send emails to audience segments in your Resend account:
Send a broadcast email to my 'premium_users' audience with subject 'New Feature Release' using Resend MCP
向Resend账户中的受众群体发送邮件:
使用Resend MCP向我的'premium_users'受众群体发送主题为'New Feature Release'的批量邮件

Audience Management

受众群体管理

Query and work with audiences:
List all my audiences in Resend using the MCP tool
查询并管理受众群体:
使用MCP工具列出我在Resend中的所有受众群体

Best Practices

最佳实践

GitHub Copilot Coding Agent Security

GitHub Copilot Coding Agent安全

Important: When configuring Resend MCP for GitHub Copilot Coding Agent:
  1. Tool allowlisting - Only enable the specific tools Copilot needs:
    json
    "tools": ["send_email", "schedule_email"]
    Instead of enabling all tools with
    "*"
  2. Secret management - Never commit API keys to version control
    • Store API keys as GitHub Actions secrets (Settings → Environments)
    • Secret names must start with
      COPILOT_MCP_
    • Reference secrets by name in the configuration
  3. Scope your API key - Consider using a restricted Resend API key if available
  4. Review Copilot's actions - Check pull requests created by Copilot to verify emails would be sent appropriately
  5. Environment isolation - Use the
    copilot
    environment to manage which repositories/workflows have access to your email sending capability
重要提示:为GitHub Copilot Coding Agent配置Resend MCP时:
  1. 工具白名单 - 仅启用Copilot需要的特定工具:
    json
    "tools": ["send_email", "schedule_email"]
    而不是使用
    "*"
    启用所有工具
  2. 密钥管理 - 永远不要将API密钥提交到版本控制
    • 将API密钥存储为GitHub Actions密钥(Settings → Environments)
    • 密钥名称必须以
      COPILOT_MCP_
      开头
    • 在配置中通过名称引用密钥
  3. 限制API密钥范围 - 如果可用,考虑使用受限的Resend API密钥
  4. 审核Copilot的操作 - 检查Copilot创建的拉取请求,验证邮件发送是否合适
  5. 环境隔离 - 使用
    copilot
    环境管理哪些仓库/工作流可以访问你的邮件发送能力

Configuration Management

配置管理

  1. Use
    .env.local
    for development
    :
    bash
    # .env.local (not committed)
    RESEND_API_KEY=re_test_xxx
    SENDER_EMAIL_ADDRESS=dev@example.com
  2. Separate configs per environment:
    • Development: Test API key, limited recipients
    • Production: Full API key, all recipients allowed
  3. Document required env vars in
    README.md
    :
    markdown
    ## Environment Variables
    - RESEND_API_KEY: Resend API key (required)
    - SENDER_EMAIL_ADDRESS: Verified sender email (optional)
    - REPLY_TO_EMAIL_ADDRESS: Reply-to email (optional)
  1. 开发环境使用
    .env.local
    bash
    # .env.local(不提交到版本控制)
    RESEND_API_KEY=re_test_xxx
    SENDER_EMAIL_ADDRESS=dev@example.com
  2. 按环境分离配置
    • 开发环境:测试API密钥,有限的收件人
    • 生产环境:完整API密钥,允许所有收件人
  3. README.md
    中记录所需的环境变量
    markdown
    ## 环境变量
    - RESEND_API_KEY: Resend API密钥(必填)
    - SENDER_EMAIL_ADDRESS: 已验证的发件人邮箱(可选)
    - REPLY_TO_EMAIL_ADDRESS: 回复邮箱(可选)

Email Content

邮件内容

  1. Always include unsubscribe links for marketing emails
  2. Test emails with multiple email clients (Gmail, Outlook, Apple Mail)
  3. Keep templates responsive for mobile devices
  4. Use clear subject lines that describe the email purpose
  5. Include plain text alternative to HTML for accessibility
  1. 营销邮件始终包含退订链接
  2. 在多个邮件客户端(Gmail、Outlook、Apple Mail)中测试邮件
  3. 保持模板对移动设备响应式
  4. 使用清晰的主题行描述邮件目的
  5. 为HTML邮件提供纯文本替代版本以提升可访问性

AI Agent Usage

AI Agent使用

  1. Provide context about who should receive emails
  2. Specify sender information in the initial setup
  3. Review email content generated by AI before sending
  4. Use agent mode for complex workflows requiring multiple steps
  5. Test with your own email first before sending to others
  1. 提供关于收件人的上下文信息
  2. 在初始设置中指定发件人信息
  3. 发送前审核AI生成的邮件内容
  4. 对于需要多步骤的复杂工作流,使用Agent模式
  5. 在发送给他人之前,先发送给自己测试

Troubleshooting

故障排除

Issue: "Node version too old" or "Node 20+ required"

问题:"Node版本过旧"或"需要Node 20+"

Solution: Check and update Node.js version
bash
node --version  # Should be v20.0.0 or higher
  • Install Node.js 20+ from https://nodejs.org (LTS version recommended)
  • macOS:
    brew install node@20
    (if using Homebrew)
  • Windows: Download from https://nodejs.org or use
    nvm-windows
  • Linux:
    nvm install 20
    or use package manager
  • Verify:
    node --version
    should show
    v20.x.x
    or later
  • Restart your terminal/IDE after installation
解决方案:检查并更新Node.js版本
bash
node --version  # 应为v20.0.0或更高

Issue: "Command not found: node"

问题:"Command not found: node"

Solution: Node.js is not installed or not in PATH
  • Install Node.js from https://nodejs.org (version 20+ required)
  • Verify installation:
    node --version
  • Restart your terminal/IDE after installation
解决方案:Node.js未安装或未在PATH中

Issue: "RESEND_API_KEY is required"

问题:"RESEND_API_KEY is required"

Solution: API key not provided or invalid
  • Generate new key at https://resend.com/api-keys
  • Ensure key starts with
    re_
  • Check MCP configuration for correct environment variable name
  • Verify there are no extra spaces in the key
解决方案:未提供API密钥或密钥无效

Issue: "Email not delivered / 401 Unauthorized"

问题:"邮件未送达 / 401 Unauthorized"

Solution: Authentication or domain verification issue
  • Verify API key is correct and active
  • Check domain is verified at https://resend.com/domains
  • Ensure sender email matches verified domain
  • Check Resend dashboard for rate limiting or delivery errors
解决方案:认证或域名验证问题
  • 验证API密钥是否正确且有效
  • 检查域名是否在https://resend.com/domains验证
  • 确保发件人邮箱与已验证域名匹配
  • 检查Resend仪表板是否有速率限制或送达错误

Issue: "Build command fails during npm run build"

问题:"npm run build时构建命令失败"

Solution: Dependency or TypeScript compilation error
bash
undefined
解决方案:依赖项或TypeScript编译错误
bash
undefined

Clear and reinstall dependencies

清除并重新安装依赖

rm -rf node_modules package-lock.json npm install npm run build

Common build errors:
- **TypeScript compilation error**: Check that all dependencies are installed
- **Permission denied on Unix/macOS**: The build script includes `chmod +x` - try running from a different directory
- **Module not found**: Delete `node_modules` and reinstall fresh
rm -rf node_modules package-lock.json npm install npm run build

常见构建错误:
- **TypeScript编译错误**:检查所有依赖项是否已安装
- **Unix/macOS上权限被拒绝**:构建脚本包含`chmod +x` - 尝试从其他目录运行
- **模块未找到**:删除`node_modules`并重新安装

Issue: "MCP server not appearing in IDE tools list"

问题:"MCP服务器未出现在IDE工具列表中"

Solution: Configuration or server startup issue
GitHub Copilot:
  1. Verify
    .vscode/mcp.json
    is in project root (not nested)
  2. Check absolute path to
    build/index.js
    is correct
  3. Reload VS Code window (Cmd+R on macOS, Ctrl+R on Windows)
  4. Verify Agent mode is enabled (toggle in chat)
Cursor:
  1. Open Cursor Settings (Cmd+Shift+P → "Cursor Settings")
  2. Navigate to MCP tab
  3. Verify configuration syntax is valid JSON
  4. Check absolute path exists and is readable
  5. Restart Cursor application
Claude Desktop:
  1. Close Claude completely
  2. Verify
    claude_desktop_config.json
    syntax
  3. Check that
    build/index.js
    file exists
  4. Reopen Claude Desktop
  5. Check Developer tab for resend tool
解决方案:配置或服务器启动问题
GitHub Copilot:
  1. 验证
    .vscode/mcp.json
    是否在项目根目录(未嵌套)
  2. 检查
    build/index.js
    的绝对路径是否正确
  3. 重新加载VS Code窗口(macOS为Cmd+R,Windows为Ctrl+R)
  4. 验证Agent模式已启用(在聊天中切换)
Cursor:
  1. 打开Cursor设置(Cmd+Shift+P → "Cursor Settings")
  2. 导航到MCP标签页
  3. 验证配置语法是否为有效的JSON
  4. 检查绝对路径是否存在且可读
  5. 重启Cursor应用
Claude Desktop:
  1. 完全关闭Claude
  2. 验证
    claude_desktop_config.json
    语法
  3. 检查
    build/index.js
    文件是否存在
  4. 重新打开Claude Desktop
  5. 在Developer标签页中检查resend工具

Issue: "Sending emails works but AI doesn't offer to use Resend MCP"

问题:"发送邮件成功,但AI不提示使用Resend MCP"

Solution: Agent model or mode issue
  • Switch to Claude Sonnet 4 or GPT-4.1 (better tool understanding)
  • Enable Agent mode explicitly
  • Use explicit mention: "use the resend MCP tool to send..."
  • Check MCP server is running (look for console output)
解决方案:Agent模型或模式问题
  • 切换到Claude Sonnet 4或GPT-4.1(对工具的理解更好)
  • 明确启用Agent模式
  • 明确提及:"use the resend MCP tool to send..."
  • 检查MCP服务器是否正在运行(查看控制台输出)

Issue: "Getting 'invalid sender' error"

问题:"收到'invalid sender'错误"

Solution: Sender email not verified
  1. Go to https://resend.com/domains
  2. Verify your custom domain if using one
  3. Use default onboarding@resend.dev for testing
  4. Update SENDER_EMAIL_ADDRESS in MCP config
  5. Restart MCP server
解决方案:发件人邮箱未验证
  1. 前往https://resend.com/domains
  2. 如果使用自定义域名,验证你的域名
  3. 测试时使用默认的onboarding@resend.dev
  4. 更新MCP配置中的SENDER_EMAIL_ADDRESS
  5. 重启MCP服务器

Advanced Configuration

高级配置

Custom MCP Server with HTTP Transport

带HTTP传输的自定义MCP服务器

For shared team environments or cloud-based setups:
json
{
  "servers": {
    "resend": {
      "type": "http",
      "url": "https://your-mcp-server.example.com/mcp"
    }
  }
}
Your HTTP server should forward requests to Resend API.
针对共享团队环境或云端设置:
json
{
  "servers": {
    "resend": {
      "type": "http",
      "url": "https://your-mcp-server.example.com/mcp"
    }
  }
}
你的HTTP服务器应将请求转发到Resend API。

Environment-Specific Configurations

环境特定配置

Use different
.mcp.json
files per environment:
bash
undefined
为不同环境使用不同的
.mcp.json
文件:
bash
undefined

Development

开发环境

cp .mcp.dev.json .vscode/mcp.json
cp .mcp.dev.json .vscode/mcp.json

Production

生产环境

cp .mcp.prod.json .vscode/mcp.json
undefined
cp .mcp.prod.json .vscode/mcp.json
undefined

Integration with Claude Desktop + GitHub Copilot

与Claude Desktop + GitHub Copilot集成

You can configure both simultaneously:
Claude Desktop config:
json
{
  "mcpServers": {
    "resend": {
      "command": "node",
      "args": ["/path/to/mcp-send-email/build/index.js"],
      "env": {
        "RESEND_API_KEY": "re_xxxxx"
      }
    }
  }
}
VS Code
.vscode/mcp.json
:
json
{
  "servers": {
    "resend": {
      "type": "command",
      "command": "node /path/to/mcp-send-email/build/index.js",
      "env": {
        "RESEND_API_KEY": "re_xxxxx"
      }
    }
  }
}
Both will use the same local MCP server instance.
你可以同时配置两者:
Claude Desktop配置:
json
{
  "mcpServers": {
    "resend": {
      "command": "node",
      "args": ["/path/to/mcp-send-email/build/index.js"],
      "env": {
        "RESEND_API_KEY": "re_xxxxx"
      }
    }
  }
}
VS Code
.vscode/mcp.json
json
{
  "servers": {
    "resend": {
      "type": "command",
      "command": "node /path/to/mcp-send-email/build/index.js",
      "env": {
        "RESEND_API_KEY": "re_xxxxx"
      }
    }
  }
}
两者将使用同一个本地MCP服务器实例。

Workflow Examples

工作流示例

Transactional Email Workflow

事务性邮件工作流

  1. Setup Phase: Deploy MCP server with production API key
  2. Automation Phase: Configure in Claude Desktop or Copilot
  3. Integration Phase: Use in application logic via AI agent
    When order is confirmed, send confirmation email with order details using Resend MCP
  4. Monitoring Phase: Check Resend dashboard for delivery status
  1. 设置阶段:部署带有生产API密钥的MCP服务器
  2. 自动化阶段:在Claude Desktop或Copilot中配置
  3. 集成阶段:通过AI Agent在应用逻辑中使用
    当订单确认后,使用Resend MCP发送包含订单详情的确认邮件
  4. 监控阶段:在Resend仪表板中检查送达状态

Marketing Campaign Workflow

营销活动工作流

  1. Prepare email template and recipient list
  2. Use AI agent to generate personalized content
  3. Review generated emails before sending
  4. Send via Resend MCP in batches
  5. Monitor open rates and engagement
  1. 准备邮件模板和收件人列表
  2. 使用AI Agent生成个性化内容
  3. 发送前审核生成的邮件
  4. 通过Resend MCP分批发送
  5. 监控打开率和参与度

Notification Workflow

通知工作流

  1. Configure Resend MCP for your notification service
  2. Create email templates for different notification types
  3. Use AI agent to format notifications as emails
  4. Send via Resend MCP to subscribers
  5. Track delivery and handle bounces
  1. 为你的通知服务配置Resend MCP
  2. 为不同类型的通知创建邮件模板
  3. 使用AI Agent将通知格式化为邮件
  4. 通过Resend MCP发送给订阅者
  5. 跟踪送达情况并处理退信

Resources

资源