resend-integration-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLinks
链接
- Resend Official: https://resend.com
- Resend API Docs: https://resend.com/docs/api-reference
- Resend MCP Server: https://resend.com/docs/knowledge-base/mcp-server
- Resend MCP GitHub: https://github.com/resend/mcp-send-email
- MCP Protocol Spec: https://modelcontextprotocol.io
- GitHub MCP Registry: https://github.com/mcp
- VS Code Insider Setup: https://code.visualstudio.com/insiders
- Resend官方网站: https://resend.com
- Resend API文档: https://resend.com/docs/api-reference
- Resend MCP服务器: https://resend.com/docs/knowledge-base/mcp-server
- Resend MCP GitHub仓库: https://github.com/resend/mcp-send-email
- MCP协议规范: https://modelcontextprotocol.io
- GitHub MCP注册表: https://github.com/mcp
- VS Code Insider设置: https://code.visualstudio.com/insiders
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
undefinedbash
undefinedClone the Resend MCP server repository
克隆Resend MCP服务器仓库
git clone https://github.com/resend/mcp-send-email.git
cd mcp-send-email
git clone https://github.com/resend/mcp-send-email.git
cd mcp-send-email
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密钥
- Visit https://resend.com/api-keys
- Create a new API key
- Copy the key to your clipboard (you'll need it for configuration)
- 访问https://resend.com/api-keys
- 创建新的API密钥
- 将密钥复制到剪贴板(配置时需要使用)
4. (Optional) Verify Your Domain
4. (可选)验证你的域名
To send emails from a custom domain:
- Go to https://resend.com/domains
- Add and verify your domain
- Update MCP configuration with flag (see Configuration section)
--sender
若要从自定义域名发送邮件:
- 前往https://resend.com/domains
- 添加并验证你的域名
- 使用标志更新MCP配置(请查看配置章节)
--sender
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.
- Navigate to your repository on GitHub.com
- Go to Settings → Copilot → Coding agent
- 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": ["*"]
}
}
}-
Set up the Copilot environment:
- Go to Settings → Environments
- Create new environment called
copilot - Add secret: with your API key value
COPILOT_MCP_RESEND_API_KEY
-
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:
- Create in your project root:
.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"
}
}
}
}- Get the absolute path to :
build/index.js- Right-click in VS Code → Copy Path
build/index.js
- Right-click
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:
- Open Claude Desktop settings
- Go to Developer tab → Edit Config
- 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服务器。
- 导航到GitHub上的你的仓库
- 进入Settings → Copilot → Coding agent
- 添加以下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": ["*"]
}
}
}-
设置Copilot环境:
- 进入Settings → Environments
- 创建名为的新环境
copilot - 添加密钥:,值为你的API密钥
COPILOT_MCP_RESEND_API_KEY
-
点击保存,Copilot将验证配置
针对VS Code本地开发(开发者设置):
如果你进行本地开发或偏好VS Code配置:
- 在项目根目录创建:
.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"
}
}
}
}- 获取的绝对路径:
build/index.js- 在VS Code中右键点击→ 复制路径
build/index.js
- 在VS Code中右键点击
针对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:
- 打开Claude Desktop设置
- 进入Developer标签页 → Edit Config
- 添加配置:
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 file:
email.md-
Createin your project:
email.mdmarkdownto: 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 -
In Cursor (with Agent mode):
- Open the file
email.md - Select all text (/
Cmd+A)Ctrl+A - Press /
Cmd+L(or use the context menu)Ctrl+L - 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)
- Open the
-
In Claude Desktop:
- Paste the email.md content in the chat
- Ask Claude to send it: "Send this email using the resend tool"
-
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-
在项目中创建:
email.mdmarkdownto: 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 -
在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模式(在聊天下拉菜单中切换)
- 打开
-
在Claude Desktop中:
- 将email.md内容粘贴到聊天框
- 让Claude发送:"Send this email using the resend tool"
-
在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 array specifying which tools Copilot can use
tools - 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 (local developer setup)
.vscode/mcp.json - 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议题时
- 需要明确的数组指定Copilot可以使用的工具
tools - 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:
- Command-type (VS Code/Cursor): Direct Node.js execution with inline arguments
- Stdio-type (Claude Desktop): Server handles I/O through environment variables
- HTTP-type (Remote/Cloud): Server exposed via HTTP endpoint
运行Resend MCP服务器有三种方式:
- 命令型(VS Code/Cursor):使用内联参数直接执行Node.js
- 标准输入输出型(Claude Desktop):服务器通过环境变量处理输入输出
- HTTP型(远程/云端):通过HTTP端点暴露服务器
GitHub Copilot Coding Agent Specifics
GitHub Copilot Coding Agent细节
For GitHub Copilot Coding Agent (repository-based setup):
-
Requiredarray: Must specify which tools from the Resend MCP server Copilot can use
tools- Use to allowlist specific tools
"tools": ["send_email", "schedule_email", ...] - Use to enable all tools
"tools": ["*"] - Use case-specific tool names from the MCP server documentation
- Use
-
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 withprefix
COPILOT_MCP_- Reference them in config as (without the value)
"COPILOT_MCP_RESEND_API_KEY" - GitHub automatically passes the secret value to the MCP server
- Reference them in config as
针对GitHub Copilot Coding Agent(基于仓库的设置):
-
必填的数组:必须指定Copilot可以使用的Resend MCP服务器工具
tools- 使用来允许特定工具
"tools": ["send_email", "schedule_email", ...] - 使用来启用所有工具
"tools": ["*"] - 使用MCP服务器文档中的特定用例工具名称
- 使用
-
无需批准:配置完成后,Copilot将自主使用这些工具,无需询问
-
安全注意事项:Copilot将通过配置的工具自动访问Resend API,因此仅启用你需要的工具
-
环境变量处理:API密钥必须存储为前缀为的GitHub Actions密钥
COPILOT_MCP_- 在配置中通过名称引用它们:(不包含值)
"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 . To send to other addresses:
onboarding@resend.dev- For testing: Use the default sender (no verification needed)
onboarding@resend.dev - For custom domains: Verify your domain at https://resend.com/domains
- Create a sender email from your verified domain
- Configure it in MCP environment variables ()
SENDER_EMAIL_ADDRESS
Note: If you don't provide a , the MCP server will prompt you each time you send an email.
SENDER_EMAIL_ADDRESS默认情况下,Resend允许使用测试域名向你自己的账户邮箱发送邮件。若要向其他地址发送:
onboarding@resend.dev- 测试场景:使用默认的发件人(无需验证)
onboarding@resend.dev - 自定义域名:在https://resend.com/domains验证你的域名
- 从已验证的域名创建发件人邮箱
- 在MCP环境变量中配置它()
SENDER_EMAIL_ADDRESS
注意:如果你未提供,MCP服务器会在每次发送邮件时提示你输入。
SENDER_EMAIL_ADDRESSCode 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:
-
Tool allowlisting - Only enable the specific tools Copilot needs:json
"tools": ["send_email", "schedule_email"]Instead of enabling all tools with"*" -
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
-
Scope your API key - Consider using a restricted Resend API key if available
-
Review Copilot's actions - Check pull requests created by Copilot to verify emails would be sent appropriately
-
Environment isolation - Use theenvironment to manage which repositories/workflows have access to your email sending capability
copilot
重要提示:为GitHub Copilot Coding Agent配置Resend MCP时:
-
工具白名单 - 仅启用Copilot需要的特定工具:json
"tools": ["send_email", "schedule_email"]而不是使用启用所有工具"*" -
密钥管理 - 永远不要将API密钥提交到版本控制
- 将API密钥存储为GitHub Actions密钥(Settings → Environments)
- 密钥名称必须以开头
COPILOT_MCP_ - 在配置中通过名称引用密钥
-
限制API密钥范围 - 如果可用,考虑使用受限的Resend API密钥
-
审核Copilot的操作 - 检查Copilot创建的拉取请求,验证邮件发送是否合适
-
环境隔离 - 使用环境管理哪些仓库/工作流可以访问你的邮件发送能力
copilot
Configuration Management
配置管理
-
Usefor development:
.env.localbash# .env.local (not committed) RESEND_API_KEY=re_test_xxx SENDER_EMAIL_ADDRESS=dev@example.com -
Separate configs per environment:
- Development: Test API key, limited recipients
- Production: Full API key, all recipients allowed
-
Document required env vars in:
README.mdmarkdown## Environment Variables - RESEND_API_KEY: Resend API key (required) - SENDER_EMAIL_ADDRESS: Verified sender email (optional) - REPLY_TO_EMAIL_ADDRESS: Reply-to email (optional)
-
开发环境使用:
.env.localbash# .env.local(不提交到版本控制) RESEND_API_KEY=re_test_xxx SENDER_EMAIL_ADDRESS=dev@example.com -
按环境分离配置:
- 开发环境:测试API密钥,有限的收件人
- 生产环境:完整API密钥,允许所有收件人
-
在中记录所需的环境变量:
README.mdmarkdown## 环境变量 - RESEND_API_KEY: Resend API密钥(必填) - SENDER_EMAIL_ADDRESS: 已验证的发件人邮箱(可选) - REPLY_TO_EMAIL_ADDRESS: 回复邮箱(可选)
Email Content
邮件内容
- Always include unsubscribe links for marketing emails
- Test emails with multiple email clients (Gmail, Outlook, Apple Mail)
- Keep templates responsive for mobile devices
- Use clear subject lines that describe the email purpose
- Include plain text alternative to HTML for accessibility
- 营销邮件始终包含退订链接
- 在多个邮件客户端(Gmail、Outlook、Apple Mail)中测试邮件
- 保持模板对移动设备响应式
- 使用清晰的主题行描述邮件目的
- 为HTML邮件提供纯文本替代版本以提升可访问性
AI Agent Usage
AI Agent使用
- Provide context about who should receive emails
- Specify sender information in the initial setup
- Review email content generated by AI before sending
- Use agent mode for complex workflows requiring multiple steps
- Test with your own email first before sending to others
- 提供关于收件人的上下文信息
- 在初始设置中指定发件人信息
- 发送前审核AI生成的邮件内容
- 对于需要多步骤的复杂工作流,使用Agent模式
- 在发送给他人之前,先发送给自己测试
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: (if using Homebrew)
brew install node@20 - Windows: Download from https://nodejs.org or use
nvm-windows - Linux: or use package manager
nvm install 20 - Verify: should show
node --versionor laterv20.x.x - Restart your terminal/IDE after installation
解决方案:检查并更新Node.js版本
bash
node --version # 应为v20.0.0或更高- 从https://nodejs.org安装Node.js 20+(推荐LTS版本)
- macOS:(如果使用Homebrew)
brew install node@20 - Windows:从https://nodejs.org下载或使用`nvm-windows`
- Linux:或使用包管理器
nvm install 20 - 验证:应显示
node --version或更高v20.x.x - 安装完成后重启终端/IDE
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中
- 从https://nodejs.org安装Node.js(需要20+版本)
- 验证安装:
node --version - 安装完成后重启终端/IDE
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密钥或密钥无效
- 在https://resend.com/api-keys生成新密钥
- 确保密钥以开头
re_ - 检查MCP配置中的环境变量名称是否正确
- 验证密钥中没有多余的空格
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
undefinedClear 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 freshrm -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:
- Verify is in project root (not nested)
.vscode/mcp.json - Check absolute path to is correct
build/index.js - Reload VS Code window (Cmd+R on macOS, Ctrl+R on Windows)
- Verify Agent mode is enabled (toggle in chat)
Cursor:
- Open Cursor Settings (Cmd+Shift+P → "Cursor Settings")
- Navigate to MCP tab
- Verify configuration syntax is valid JSON
- Check absolute path exists and is readable
- Restart Cursor application
Claude Desktop:
- Close Claude completely
- Verify syntax
claude_desktop_config.json - Check that file exists
build/index.js - Reopen Claude Desktop
- Check Developer tab for resend tool
解决方案:配置或服务器启动问题
GitHub Copilot:
- 验证是否在项目根目录(未嵌套)
.vscode/mcp.json - 检查的绝对路径是否正确
build/index.js - 重新加载VS Code窗口(macOS为Cmd+R,Windows为Ctrl+R)
- 验证Agent模式已启用(在聊天中切换)
Cursor:
- 打开Cursor设置(Cmd+Shift+P → "Cursor Settings")
- 导航到MCP标签页
- 验证配置语法是否为有效的JSON
- 检查绝对路径是否存在且可读
- 重启Cursor应用
Claude Desktop:
- 完全关闭Claude
- 验证语法
claude_desktop_config.json - 检查文件是否存在
build/index.js - 重新打开Claude Desktop
- 在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
- Go to https://resend.com/domains
- Verify your custom domain if using one
- Use default onboarding@resend.dev for testing
- Update SENDER_EMAIL_ADDRESS in MCP config
- Restart MCP server
解决方案:发件人邮箱未验证
- 前往https://resend.com/domains
- 如果使用自定义域名,验证你的域名
- 测试时使用默认的onboarding@resend.dev
- 更新MCP配置中的SENDER_EMAIL_ADDRESS
- 重启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 files per environment:
.mcp.jsonbash
undefined为不同环境使用不同的文件:
.mcp.jsonbash
undefinedDevelopment
开发环境
cp .mcp.dev.json .vscode/mcp.json
cp .mcp.dev.json .vscode/mcp.json
Production
生产环境
cp .mcp.prod.json .vscode/mcp.json
undefinedcp .mcp.prod.json .vscode/mcp.json
undefinedIntegration 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.jsonjson
{
"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.jsonjson
{
"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
事务性邮件工作流
- Setup Phase: Deploy MCP server with production API key
- Automation Phase: Configure in Claude Desktop or Copilot
- Integration Phase: Use in application logic via AI agent
When order is confirmed, send confirmation email with order details using Resend MCP - Monitoring Phase: Check Resend dashboard for delivery status
- 设置阶段:部署带有生产API密钥的MCP服务器
- 自动化阶段:在Claude Desktop或Copilot中配置
- 集成阶段:通过AI Agent在应用逻辑中使用
当订单确认后,使用Resend MCP发送包含订单详情的确认邮件 - 监控阶段:在Resend仪表板中检查送达状态
Marketing Campaign Workflow
营销活动工作流
- Prepare email template and recipient list
- Use AI agent to generate personalized content
- Review generated emails before sending
- Send via Resend MCP in batches
- Monitor open rates and engagement
- 准备邮件模板和收件人列表
- 使用AI Agent生成个性化内容
- 发送前审核生成的邮件
- 通过Resend MCP分批发送
- 监控打开率和参与度
Notification Workflow
通知工作流
- Configure Resend MCP for your notification service
- Create email templates for different notification types
- Use AI agent to format notifications as emails
- Send via Resend MCP to subscribers
- Track delivery and handle bounces
- 为你的通知服务配置Resend MCP
- 为不同类型的通知创建邮件模板
- 使用AI Agent将通知格式化为邮件
- 通过Resend MCP发送给订阅者
- 跟踪送达情况并处理退信