Skip to content

Commit 1e1e235

Browse files
authored
Merge pull request #15 from resend/feat/improve-readme-instructions
feat: improve readme instructions
2 parents faaacb7 + 7e2d816 commit 1e1e235

File tree

3 files changed

+97
-24
lines changed

3 files changed

+97
-24
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- Improved instructions in README
12+
- Removed test email address from example email.md
13+
1014
### Added
1115
- CC and BCC support for email recipients
1216
- Full request/response logging for improved debugging
@@ -27,4 +31,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2731
- Basic email sending functionality
2832
- HTML email support
2933
- Email scheduling capability
30-
- Reply-to addressing
34+
- Reply-to addressing

README.md

Lines changed: 90 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
This is a simple MCP server that sends emails using Resend's API. Why? Now you can let Cursor or Claude Desktop compose emails for you and send it right away without having to copy and paste the email content.
66

7+
As an example, you could use this to run local scripts, chat with Claude, or process data and send the results to yourself or your team.
8+
79
Built with:
810

911
- [Resend](https://resend.com/)
@@ -18,49 +20,116 @@ Built with:
1820
- Configure reply-to addresses
1921
- Customizable sender email (requires verification)
2022

21-
**DEMO**
23+
## Demo
2224

2325
https://github.com/user-attachments/assets/8c05cbf0-1664-4b3b-afb1-663b46af3464
2426

25-
**Cursor**
27+
## Setup
28+
29+
Currently, you must build the project locally to use this MCP server. Then add the server in [Cursor](#cursor) or [Claude Desktop](#claude-desktop) to use it in any Cursor or Claude Desktop chat.
30+
31+
1. Clone this project locally.
2632

27-
1. First, you need to authorize Resend to send emails from your domain or email. Follow the steps [here](https://resend.com/docs/send-with-nodejs) to set that up and get a Resend API key.
28-
2. Clone this project locally. Edit index.ts and replace me@yoko.dev to your own email to send emails from
29-
3. Run `npm install`, `npm run build` under the project dir. You should now see a /build/index.js generated - this is the MCP server script!
33+
```
34+
git clone https://github.com/resend/mcp-send-email.git
35+
```
36+
37+
2. Build the project
38+
39+
```
40+
npm install
41+
npm run build
42+
```
43+
3. Setup Resend
3044

31-
Then go to Cursor Settings -> MCP -> Add new MCP server
45+
Create a free Resend account and [Create an API Key](https://resend.com/api-keys). To send to other addresses, you'll also need to [verify your own domain](https://resend.com/domains).
3246

33-
- Name = [choose your own name]
34-
- Type = command
35-
- Command: `node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js --key=YOUR_RESEND_API_KEY --sender=OPTIONAL_SENDER_EMAIL_ADDRESS --reply-to=OPTIONAL_REPLY_TO_EMAIL_ADDRESS_ONE --reply-to=OPTIONAL_REPLY_TO_EMAIL_ADDRESS_TWO`
47+
> [!NOTE]
48+
> For more info on how to send emails with Resend, see the [docs](https://resend.com/docs/send-with-nodejs).
3649
37-
You can get Resend API key here: https://resend.com/
50+
## Cursor
3851

39-
Now you can test out sending emails by going to email.md, replace the to: email address, select all in email md, and hit cmd+l. You can now tell cursor to "send this as an email" in the chat. Make sure Cursor chat is in Agent mode by selecting "Agent" on lower left side dropdown
52+
1. Open Cursor Settings.
4053

41-
<img width="441" alt="Screenshot 2025-02-25 at 9 13 05 AM" src="https://github.com/user-attachments/assets/b07e9cbf-42d8-4910-8e90-3761d8d3bc06" />
54+
Open the command palette (`cmd`+`shift`+`p` on macOS or `ctrl`+`shift`+`p` on Windows) and choose "Cursor Settings".
4255

43-
**Claude desktop**
56+
2. Add the MCP server
4457

45-
Same set up as above, and then add the following MCP config
58+
Select "MCP" from the left sidebar and click "Add new global MCP server".
4659

60+
Add the following config:
61+
```json
62+
{
63+
"mcpServers": {
64+
"resend": {
65+
"type": "command",
66+
"command": "node ABSOLUTE_PATH_TO_MCP_SEND_EMAIL_PROJECT/build/index.js --key=YOUR_RESEND_API_KEY"
67+
}
68+
}
69+
}
4770
```
71+
72+
You can get the absolute path to your build script by right-clicking on the `/build/index.js` file in Cursor and selecting `Copy Path`.
73+
74+
**Possible arguments**
75+
76+
- `--key`: Your Resend API key (required)
77+
- `--sender`: Your sender email address from a verified domain (optional)
78+
- `--reply-to`: Your reply-to email address (optional)
79+
80+
> [!NOTE]
81+
> If you don't provide a sender email address, the MCP server will ask you to provide one each time you call the tool.
82+
83+
3. Test the sending
84+
85+
Now you can test out sending emails by going to `email.md`.
86+
- Replace the to: email address with your own
87+
- Select all text in `email.md`, and press `cmd+l`
88+
- Tell cursor to "send this as an email" in the chat (make sure cursor is in Agent mode by selecting "Agent" on lower left side dropdown).
89+
90+
<img width="441" alt="Cursor chat with email.md file selected and Agent mode enabled" src="https://github.com/user-attachments/assets/b07e9cbf-42d8-4910-8e90-3761d8d3bc06" />
91+
92+
## Claude Desktop
93+
94+
1. Open Claude's Developer config file
95+
96+
Open Claude Desktop settings and navigate to the "Developer" tab. Click `Edit Config`.
97+
98+
2. Add the MCP server
99+
100+
Add the following config:
101+
102+
```json
48103
{
49104
"mcpServers": {
50105
"resend": {
51106
"command": "node",
52-
"args": ["ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js"],
107+
"args": [
108+
"ABSOLUTE_PATH_TO_MCP_SEND_EMAIL_PROJECT/build/index.js"
109+
],
53110
"env": {
54-
"RESEND_API_KEY": [YOUR_API_KEY],
55-
"SENDER_EMAIL_ADDRESS": [OPTIONAL_SENDER_EMAIL_ADDRESS],
56-
"REPLY_TO_EMAIL_ADDRESSES": [OPTIONAL_REPLY_TO_EMAIL_ADDRESSES_COMMA_DELIMITED]
111+
"RESEND_API_KEY": "YOUR_RESEND_API_KEY",
57112
}
58113
}
59114
}
60115
}
61116
```
62117

63-
**Develop**
118+
You can get the absolute path to your build script by right-clicking on the `/build/index.js` file in your IDE and selecting `Copy Path`.
119+
120+
**Possible environment variables**
121+
122+
- `RESEND_API_KEY`: Your Resend API key (required)
123+
- `SENDER_EMAIL_ADDRESS`: Your sender email address from a verified domain (optional)
124+
- `REPLY_TO_EMAIL_ADDRESS`: Your reply-to email address (optional)
125+
126+
> [!NOTE]
127+
> If you don't provide a sender email address, the MCP server will ask you to provide one each time you call the tool.
128+
129+
3. Test the sending
130+
131+
Close and reopen Claude Desktop. Verify that the `resend` tool is available in the Claude developer settings.
132+
133+
![Claude Desktop developer settings with Resend MCP server showing](https://github.com/user-attachments/assets/be9549e5-eaef-4946-b10a-e708c1864acf)
64134

65-
`npm install`
66-
`npm run build`
135+
Chat with Claude and tell it to send you an email using the `resend` tool.

email.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
to: ykhli1013@gmail.com
1+
to: YOUR_EMAIL_ADDRESS
22
subject: Test!
33
content: This is a test email.
44

@@ -8,4 +8,4 @@ Fun fact: cats have 32 muscles in their ears. (??!)
88

99
# Example of using CC and BCC:
1010
# cc: colleague1@example.com, colleague2@example.com
11-
# bcc: manager@example.com
11+
# bcc: manager@example.com

0 commit comments

Comments
 (0)