feat(resend-mcp): add Resend email API integration#158
feat(resend-mcp): add Resend email API integration#158viktormarinho wants to merge 1 commit intomainfrom
Conversation
Implements a new MCP for sending transactional and marketing emails via Resend API.
Features:
- Send email tool with comprehensive parameters
- Support for HTML and plain text content
- Multiple recipients (to/cc/bcc)
- Custom headers and reply-to addresses
- Configurable default sender
- Secure API key-based authentication
- Comprehensive error handling with proper error codes
Architecture:
- Follows TikTok Ads MCP pattern (simple API key auth via StateSchema)
- No wrangler/vite dependencies (uses bun build like mcp-studio)
- Clean {data, error} response format
- Email format validation
- Single comprehensive send_email tool
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🚀 Preview Deployments Ready!Your changes have been deployed to preview environments: 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on February 22
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
|
||
| const name = errorCodeMap[status] || "application_error"; | ||
| return { name, message }; | ||
| } |
There was a problem hiding this comment.
Error mapping discards API-provided error name
Medium Severity
The mapError function extracts message from the API response but ignores any name field returned by the Resend API. Instead, it always overrides the error name with a generic value based solely on HTTP status code. According to the spec, the same HTTP status can have multiple distinct error codes (e.g., 403 can be invalid_api_key, invalid_from_address, or validation_error; 422 can be missing_required_field, invalid_access, invalid_parameter, or invalid_region). This implementation loses that granular error information, making it harder for users to diagnose and fix issues.
Summary
This PR introduces a new Resend MCP for sending transactional and marketing emails via the Resend API.
Features
Architecture
This MCP follows the TikTok Ads MCP pattern:
{data, error}response formatImplementation Details
File Structure
Tool:
send_emailRequired Parameters:
to: Recipient email(s)subject: Email subjecthtmlORtext: Email content (at least one required)Optional Parameters:
from: Sender email (falls back to configured default)cc: Carbon copy recipient(s)bcc: Blind carbon copy recipient(s)reply_to: Reply-to address(es)headers: Custom email headersResponse Format:
{ "data": { "id": "email_id" }, "error": null }Configuration
Users configure the MCP during installation with:
Testing
bun run build(334 modules bundled)Example Usage
Simple Email
{ "to": "user@example.com", "subject": "Welcome!", "text": "Thanks for signing up!" }Rich HTML Email
{ "from": "Team <team@company.com>", "to": "user@example.com", "cc": "manager@company.com", "subject": "Monthly Report", "html": "<h1>Report</h1><p>Your report is ready.</p>" }Related
resend-mcp-spec.md🤖 Generated with Claude Code
Note
Introduces a new MCP workspace to integrate with Resend’s email API.
resend-mcpworkspace with MCP server,send_emailtool, and Resend API client (server/lib/client.ts) using bearer auth and JSON payloadssubjectand at least one ofhtml/text) and returns{ data, error }responses with mapped error codesStateSchema/env helpersapp.json), generated types (shared/deco.gen.ts), build scripts, and README; updates rootpackage.jsonworkspaces and lockfileWritten by Cursor Bugbot for commit bcc1867. This will update automatically on new commits. Configure here.
Summary by cubic
Adds a new Resend MCP to send transactional and marketing emails via the Resend API. Provides a single send_email tool with flexible inputs, defaults, and clear error handling.
New Features
Migration
Written for commit bcc1867. Summary will update on new commits.