Skip to main content

ses-email-notification

Stdio MCP server exposing a single send_email tool backed by AWS SES (SESv2 API).

Credentials come from boto3's default chain: the EC2 instance role in production, AWS_PROFILE for local testing. No credential configuration in code.

Tool: send_email

Parameter Type Required Notes
to list[str] yes one or more recipients
subject str yes
body_text str no* plain-text body
body_html str no* HTML body; both → multipart/alternative
cc list[str] no
attachment_paths list[str] no local file paths inside ATTACHMENT_BASE_DIR

*At least one of body_text / body_html is required.

Returns the SES MessageId on success. SES failures surface the SES error code and message verbatim (e.g. MessageRejected: Email address is not verified).

The sender address and optional reply-to addresses are fixed by configuration; the tool has no from or reply_to parameter.

Configuration (environment variables)

Variable Required Purpose
SES_FROM_ADDRESS yes verified SES identity to send from
SES_REPLY_TO_ADDRESSES no comma-separated reply-to addresses
AWS_REGION yes region of the SES identity
ATTACHMENT_BASE_DIR no directory attachments may be read from; attachments are rejected if unset
AWS_PROFILE local only profile for local testing; omit on EC2 (instance role is used)

MCP client configuration

From PyPI (no checkout needed — uvx downloads and runs the published package):

{
  "mcpServers": {
    "ses-email-notification": {
      "command": "uvx",
      "args": ["ses-email-notification"],
      "env": {
        "AWS_REGION": "us-east-1",
        "SES_FROM_ADDRESS": "noreply@example.com",
        "SES_REPLY_TO_ADDRESSES": "support@example.com",
        "ATTACHMENT_BASE_DIR": "/path/to/agent/output"
      }
    }
  }
}

From a local checkout (testing with an AWS profile):

{
  "mcpServers": {
    "ses-email-notification": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/ses-email-notification", "ses-email-notification"],
      "env": {
        "AWS_PROFILE": "your-profile",
        "AWS_REGION": "eu-central-1",
        "SES_FROM_ADDRESS": "noreply@example.com",
        "SES_REPLY_TO_ADDRESSES": "support@example.com,owner@example.com",
        "ATTACHMENT_BASE_DIR": "/path/to/agent/output"
      }
    }
  }
}

EC2 (instance role provides credentials — no AWS_PROFILE):

{
  "mcpServers": {
    "ses-email-notification": {
      "command": "uv",
      "args": ["run", "--directory", "/opt/ses-email-notification", "ses-email-notification"],
      "env": {
        "AWS_REGION": "eu-central-1",
        "SES_FROM_ADDRESS": "noreply@example.com",
        "SES_REPLY_TO_ADDRESSES": "support@example.com",
        "ATTACHMENT_BASE_DIR": "/var/agent/output"
      }
    }
  }
}

IAM policy for the EC2 instance role

ses:SendRawEmail is required for attachments. Scope the resource to your verified identity ARN:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["ses:SendEmail", "ses:SendRawEmail"],
      "Resource": "arn:aws:ses:REGION:ACCOUNT_ID:identity/example.com"
    }
  ]
}

Limits & caveats

  • Raw messages (sends with attachments) are capped at 10 MB after base64 encoding (~7 MB of actual files); the server rejects oversized sends before calling SES.
  • SES sandbox: if the account is in sandbox mode, sends to unverified recipients fail with MessageRejected. Request production access before relying on this server.

Development

uv run pytest            # unit tests (botocore Stubber, no AWS calls)

# manual smoke send against real SES:
AWS_PROFILE=your-profile AWS_REGION=eu-central-1 \
SES_FROM_ADDRESS=noreply@example.com \
SES_REPLY_TO_ADDRESSES=support@example.com \
uv run mcp dev src/ses_email_notification/server.py

Publishing to PyPI

Bump version in pyproject.toml first — PyPI rejects re-uploads of an existing version.

uv build                                      # builds sdist + wheel into dist/
uv publish --index testpypi --token <token>   # dry run against test.pypi.org
uv publish --token <token>                    # real PyPI

Tokens come from https://pypi.org/manage/account/token/ (and the test.pypi.org equivalent). UV_PUBLISH_TOKEN works instead of --token.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ses_email_notification-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ses_email_notification-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file ses_email_notification-0.1.1.tar.gz.

File metadata

  • Download URL: ses_email_notification-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ses_email_notification-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4496a7e50bb30c5583e241c8461eb0d83374121ad12e88bd4bb5bf261ed4b38c
MD5 072f23c79076e0c391f298dc2a768c1f
BLAKE2b-256 ae5d45d18c4f4479194e72012e951c853e19dc0ef850a1f1568980a6b5997865

See more details on using hashes here.

File details

Details for the file ses_email_notification-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ses_email_notification-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ses_email_notification-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1507fa2a21ceb8c21f971879e1b43ee327c3d8b1a4d29e30a33b0c190c3e2a4
MD5 a8a2bddf6ef4ea99fa1e2dfa149c4e5b
BLAKE2b-256 f078d92511630d48b015f30a80961c59d3d0b4f67e47b389a7e6e375c8c777f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page