Skip to main content
Glama

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
NameRequiredDescriptionDefault
emailYes

Implementation Reference

  • 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.")
  • 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}'"
  • 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
  • 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
  • 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]

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ai-zerolab/mcp-email-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server