Skip to content

Commit f5429f3

Browse files
committed
Add boto3 to requirements and integrate email MCP into victoria_terminal.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)
1 parent 3ca984f commit f5429f3

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
altair
22
black
3+
boto3
34
duckdb
45
email-validator
56
flake8

victoria_terminal.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ def parse_env_file(path: Path) -> dict[str, str]:
585585
BROWSERBASE_ENV_KEY = "SMITHERY_BROWSERBASE_URL"
586586
GAMMA_ENV_KEY = "GAMMA_API_KEY"
587587
SENDGRID_ENV_KEY = "SENDGRID_API_KEY"
588+
EMAIL_ENV_KEYS = ("AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "EMAIL_S3_BUCKET")
588589
SNOWFLAKE_ENV_KEYS = ("SNOWFLAKE_ACCOUNT", "SNOWFLAKE_USER", "SNOWFLAKE_PASSWORD")
589590

590591

@@ -706,6 +707,10 @@ def _is_sendgrid_enabled(env_map: Mapping[str, str]) -> bool:
706707
return _has_valid_env_value(env_map, SENDGRID_ENV_KEY)
707708

708709

710+
def _is_email_enabled(env_map: Mapping[str, str]) -> bool:
711+
return all(_has_valid_env_value(env_map, key) for key in EMAIL_ENV_KEYS)
712+
713+
709714
def _is_snowflake_enabled(env_map: Mapping[str, str]) -> bool:
710715
return all(_has_valid_env_value(env_map, key) for key in SNOWFLAKE_ENV_KEYS)
711716

@@ -783,6 +788,21 @@ def generate_crush_config(
783788
resolved_env["SENDGRID_MCP_SCRIPT"] = str(sendgrid_script)
784789
resolved_env["SENDGRID_MCP_DIR"] = str(sendgrid_script.parent)
785790

791+
email_config = mcp_config.get("email")
792+
if isinstance(email_config, dict):
793+
if not _is_email_enabled(env_map):
794+
mcp_config.pop("email", None)
795+
else:
796+
email_script = resource_path(Path("ses_s3_email_mcp.py"))
797+
if not email_script.exists():
798+
raise FileNotFoundError(
799+
"Email MCP server script is missing from the Victoria installation "
800+
f"(expected at {email_script})."
801+
)
802+
803+
resolved_env["EMAIL_MCP_SCRIPT"] = str(email_script)
804+
resolved_env["EMAIL_MCP_DIR"] = str(email_script.parent)
805+
786806
snowflake_config = mcp_config.get("snowflake")
787807
if isinstance(snowflake_config, dict) and not _is_snowflake_enabled(env_map):
788808
mcp_config.pop("snowflake", None)

0 commit comments

Comments
 (0)