npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@teamnetwork-nz/smtp-mcp-server

v1.1.2

Published

MCP server for sending email via SMTP relay

Downloads

360

Readme

@teamnetwork-nz/smtp-mcp-server

An MCP server that lets AI agents send email via any SMTP relay. Recipient restrictions, sender identity, and SMTP credentials are all enforced server-side — an agent cannot override them.

Features

  • Send plain-text or HTML email
  • Attach files (base64-encoded)
  • CC and BCC support
  • Restrict recipients to allowed domains and/or explicit addresses
  • Configurable sender name and address
  • Works with any SMTP server (Gmail, SendGrid, Mailgun, self-hosted, unauthenticated relay, etc.)
  • health tool for live connection testing
  • Built-in usage resource agents can read to understand available options

Install

npm install -g @teamnetwork-nz/smtp-mcp-server

Or run directly with npx (no global install needed):

npx @teamnetwork-nz/smtp-mcp-server

Build from source

git clone <repo>
cd smtp-mcp-server
npm install && npm run build

Configuration

All configuration is via environment variables (loaded from .env if present).

| Variable | Required | Description | |---|---|---| | SMTP_HOST | yes | SMTP relay hostname | | SMTP_PORT | no | Port — default 587 | | SMTP_SECURE | no | "true" for port 465 implicit TLS; otherwise STARTTLS | | SMTP_IGNORE_TLS | no | "true" to disable TLS entirely — plain SMTP, e.g. port 25 internal relay | | SMTP_USER | no | SMTP auth username — omit for unauthenticated relays | | SMTP_PASS | no | SMTP auth password — omit for unauthenticated relays | | SMTP_FROM_ADDRESS | yes | Envelope From address | | SMTP_FROM_NAME | no | Display name — defaults to SMTP_FROM_ADDRESS | | ALLOWED_DOMAINS | no | Comma-separated domains, e.g. acme.com,partner.org | | ALLOWED_ADDRESSES | no | Comma-separated explicit addresses |

Restriction logic: a recipient is permitted if its domain matches ALLOWED_DOMAINS or it appears in ALLOWED_ADDRESSES. All addresses across to, cc, and bcc are checked — a single blocked address rejects the whole request. If neither variable is set, all addresses are permitted (not recommended for production).

Claude Code Integration

Add to your .claude/mcp_config.json (or claude_desktop_config.json):

{
  "mcpServers": {
    "smtp": {
      "command": "npx",
      "args": ["-y", "@teamnetwork-nz/smtp-mcp-server"],
      "env": {
        "SMTP_HOST": "smtp.example.com",
        "SMTP_PORT": "587",
        "SMTP_USER": "[email protected]",
        "SMTP_PASS": "your-password",
        "SMTP_FROM_ADDRESS": "[email protected]",
        "SMTP_FROM_NAME": "My Agent",
        "ALLOWED_DOMAINS": "example.com"
      }
    }
  }
}

For an unauthenticated internal relay, omit SMTP_USER and SMTP_PASS.


Tools

health

No parameters. Performs a live TCP+SMTP handshake against the configured server and returns the active configuration summary.

connection:   OK (42 ms)
smtp_host:    smtp.example.com:587
tls:          STARTTLS
auth:         authenticated as [email protected]
from:         "My Agent" <[email protected]>
restrictions: domains: example.com

Returns isError: true if the connection test fails, with the SMTP error message included.


send_email

| Parameter | Type | Required | Description | |---|---|---|---| | to | string | string[] | yes | Recipient(s) | | subject | string | yes | Subject line | | body | string | yes | Body content | | body_type | "text" | "html" | no | Default: "text" | | cc | string | string[] | no | CC recipient(s) | | bcc | string | string[] | no | BCC recipient(s) | | attachments | Attachment[] | no | Files to attach |

Attachment object:

| Field | Type | Description | |---|---|---| | filename | string | Name shown to recipient | | content | string | Base64-encoded file data | | content_type | string | MIME type, e.g. application/pdf |


Resource: smtp://server/usage

A plain-text usage guide populated with the server's live configuration (sender identity, SMTP endpoint, active restrictions, full tool reference). Agents can read this resource to understand what options are available without calling any tools.


Local Testing with Mailpit

Mailpit is a lightweight local SMTP catcher — no credentials required:

# macOS
brew install mailpit && mailpit

# Windows (scoop)
scoop install mailpit && mailpit

Set SMTP_HOST=localhost, SMTP_PORT=1025, omit SMTP_USER/SMTP_PASS. View caught emails at http://localhost:8025.