add_email_account
Add and configure email accounts on the MCP Email Server by specifying account details, incoming/outgoing server settings, and authentication credentials for IMAP and SMTP communication.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes |
Implementation Reference
- mcp_email_server/app.py:35-35 (registration)Registers the 'add_email_account' tool with FastMCP using the @mcp.tool decorator.@mcp.tool(description="Add a new email account configuration to the settings.")
- mcp_email_server/app.py:36-40 (handler)The core handler function that adds the provided EmailSettings to the global settings instance and persists the configuration to the TOML file.async def add_email_account(email: EmailSettings) -> str: settings = get_settings() settings.add_email(email) settings.store() return f"Successfully added email account '{email.account_name}'"
- mcp_email_server/config.py:73-78 (schema)Pydantic model defining the input schema for the email account configuration, including credentials and server details.class EmailSettings(AccountAttributes): full_name: str email_address: str incoming: EmailServer outgoing: EmailServer
- mcp_email_server/config.py:25-32 (schema)Pydantic model for IMAP/SMTP server configuration used within EmailSettings.class EmailServer(BaseModel): user_name: str password: str host: str port: int use_ssl: bool = True # Usually port 465 start_ssl: bool = False # Usually port 587
- mcp_email_server/config.py:248-251 (helper)Helper method on the Settings class to append a new EmailSettings to the list of configured emails.def add_email(self, email: EmailSettings) -> None: """Use re-assigned for validation to work.""" self.emails = [email, *self.emails]