Skip to content

Conversation

@bradflaugher
Copy link
Collaborator

Summary

This PR adds a new MCP server that gives Victoria the ability to check an email inbox. Emails are received by AWS SES and stored in an S3 bucket, which Victoria can poll on demand.

What's Included

New File: ses_s3_email_mcp.py

A complete MCP server with 5 tools:

Tool Description
check_inbox List new emails since last check
get_email Get parsed email details (subject, from, to, body preview, attachments)
download_attachment Download a specific attachment from an email
download_all_csv_attachments Batch download all CSV files from inbox
get_inbox_stats Get inbox statistics (total emails, size, etc.)

Updated Files

  • example.env: Added AWS/S3 configuration variables
  • configs/crush/crush.template.json: Added email MCP server configuration

Prerequisites

The AWS infrastructure has already been set up:

  • ✅ S3 bucket (victoria-email-inbox) created
  • ✅ AWS SES configured for victoria.elcanotek.com
  • ✅ SES receipt rule saving emails to S3
  • ✅ IAM user with S3 read access

Environment Variables Required

AWS_ACCESS_KEY_ID="your-access-key"
AWS_SECRET_ACCESS_KEY="your-secret-key"
AWS_REGION="us-east-2"
EMAIL_S3_BUCKET="victoria-email-inbox"
EMAIL_S3_PREFIX="emails/"

Testing

After merging, test by:

  1. Sending an email with CSV attachment to [email protected]
  2. Ask Victoria to check her inbox
  3. Victoria should be able to list the email and download the CSV

This adds a new MCP server that allows Victoria to:
- Poll an S3 bucket for emails deposited by AWS SES
- Get email details (subject, from, to, attachments)
- Download attachments (especially CSV files) for data analysis

Files added/modified:
- ses_s3_email_mcp.py: New MCP server with 5 tools
  - check_inbox: List new emails since last check
  - get_email: Get parsed email details
  - download_attachment: Download a specific attachment
  - download_all_csv_attachments: Batch download CSVs
  - get_inbox_stats: Get inbox statistics
- example.env: Added AWS/S3 configuration variables
- configs/crush/crush.template.json: Added email MCP config

Setup requires:
- AWS SES configured to receive emails for a domain
- S3 bucket with SES receipt rule to store emails
- IAM user with S3 read access
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…nal.py

- Added boto3 to requirements.txt
- Added EMAIL_ENV_KEYS constant for required env vars
- Added _is_email_enabled() function to check if email MCP should be enabled
- Added email MCP configuration setup in write_crush_config() to set
  EMAIL_MCP_SCRIPT and EMAIL_MCP_DIR automatically (same pattern as SendGrid)
@bradflaugher bradflaugher merged commit db0c029 into main Dec 16, 2025
2 checks passed
@bradflaugher bradflaugher deleted the feature/ses-s3-email-mcp branch December 16, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants