The SMTP Email MCP Server provides email sending capabilities for Claude and other MCP-compatible AI assistants. It offers multiple SMTP configurations, email templates, bulk sending, and HTML support through a standard Model Context Protocol interface.
To install the SMTP Email MCP Server:
# Clone the repository
git clone https://github.com/samihalawa/mcp-server-smtp.git
cd mcp-server-smtp
# Install dependencies
npm install
# Build the server
npm run build
npm start
Add the server to your MCP configuration file:
{
"servers": {
"smtp-email-server": {
"command": "/path/to/node",
"args": ["/path/to/mcp-server-smtp/build/index.js"],
"enabled": true,
"port": 3007,
"environment": {
"NODE_PATH": "/path/to/node_modules",
"PATH": "/usr/local/bin:/usr/bin:/bin"
}
}
}
}
Send an email to one or more recipients.
send-email(
to: [{ email: "[email protected]", name: "John Doe" }],
subject: "Hello!",
body: "<p>This is a test email.</p>",
from: { email: "[email protected]", name: "Sender Name" },
cc: [{ email: "[email protected]" }],
bcc: [{ email: "[email protected]" }],
templateId: "welcome-email",
templateData: { name: "John", company: "ACME Corp" },
smtpConfigId: "gmail-config"
)
Send emails to multiple recipients in batches.
send-bulk-emails(
recipients: [
{ email: "[email protected]", name: "User 1" },
{ email: "[email protected]", name: "User 2" }
],
subject: "Important Announcement",
body: "<p>This is an important announcement.</p>",
from: { email: "[email protected]", name: "Sender Name" },
cc: [{ email: "[email protected]" }],
bcc: [{ email: "[email protected]" }],
templateId: "announcement-template",
templateData: { announcement: "New feature launch" },
batchSize: 10,
delayBetweenBatches: 1000,
smtpConfigId: "gmail-config"
)
Get all configured SMTP servers.
get-smtp-configs()
Add a new SMTP server configuration.
add-smtp-config(
name: "Gmail",
host: "smtp.gmail.com",
port: 587,
secure: false,
auth: {
user: "[email protected]",
pass: "your-app-password"
},
isDefault: true
)
Update an existing SMTP server configuration.
update-smtp-config(
id: "smtp-config-id",
name: "Updated Gmail",
host: "smtp.gmail.com",
port: 587,
secure: false,
auth: {
user: "[email protected]",
pass: "your-new-app-password"
},
isDefault: true
)
Delete an SMTP server configuration.
delete-smtp-config(
id: "smtp-config-id"
)
Get all email templates.
get-email-templates()
Add a new email template.
add-email-template(
name: "Welcome Email",
subject: "Welcome to {{company}}!",
body: "<h1>Hello {{name}},</h1><p>Welcome to {{company}}!</p>",
isDefault: false
)
Update an existing email template.
update-email-template(
id: "template-id",
name: "Updated Welcome Email",
subject: "Welcome to {{company}}!",
body: "<h1>Hello {{name}},</h1><p>Welcome to {{company}}!</p>",
isDefault: true
)
Delete an email template.
delete-email-template(
id: "template-id"
)
Get logs of sent emails.
get-email-logs()
First, configure an SMTP server:
add-smtp-config(
name: "Gmail",
host: "smtp.gmail.com",
port: 587,
secure: false,
auth: {
user: "[email protected]",
pass: "your-app-password"
},
isDefault: true
)
Create an email template with variables:
add-email-template(
name: "Welcome Email",
subject: "Welcome to {{company}}!",
body: "<h1>Hello {{name}},</h1><p>Welcome to {{company}}!</p>",
isDefault: false
)
Send an email using the template:
send-email(
to: [{ email: "[email protected]", name: "John Doe" }],
templateId: "welcome-email",
templateData: {
name: "John",
company: "ACME Corp"
}
)
Or send a direct email without a template:
send-email(
to: [{ email: "[email protected]", name: "John Doe" }],
subject: "Important Information",
body: "<p>This is some important information.</p>"
)
For bulk emails to multiple recipients:
send-bulk-emails(
recipients: [
{ email: "[email protected]", name: "User 1" },
{ email: "[email protected]", name: "User 2" },
{ email: "[email protected]", name: "User 3" }
],
subject: "Monthly Newsletter",
body: "<p>Here's what's new this month...</p>",
batchSize: 2,
delayBetweenBatches: 1000
)
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.