Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

auto_connect

Automatically establish IMAP email connections using stored configuration credentials to access email accounts for reading, searching, and organizing messages.

Instructions

Connect using config.json credentials (no parameters needed)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core logic for auto_connect which loads configuration, connects, authenticates, and initializes the watcher.
    def auto_connect(self, config_path: str = "config.json") -> bool:
        """Connect using config.json credentials."""
        self.load_config(config_path)
        self.config["_config_path"] = config_path  # Store for watcher
        imap_config = self.config.get("imap", {})
        creds = self.config.get("credentials", {})
    
        self.connect(
            host=imap_config.get("host"),
            port=imap_config.get("port", 993),
            secure=imap_config.get("secure", True),
        )
        self.authenticate(creds.get("username"), creds.get("password"))
        self._load_auto_archive_config()
    
        # Auto-start watcher if cache is enabled
        if self.config.get("cache", {}).get("enabled", True):
            self.watcher = get_watcher(config_path)
            self.watcher.start()
            self.watching = True
    
        return True
  • Registration/Dispatch of the auto_connect MCP tool in the server request handler.
    elif name == "auto_connect":
        return imap_client.auto_connect()

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/Soundhannes/IMAP-MCP'

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