Skip to main content
Glama
Soundhannes

IMAP MCP Server

by Soundhannes

copy_email

Copy selected emails from one mailbox to another in IMAP accounts. Specify source emails by UID and destination mailbox to organize messages.

Instructions

Copy emails to another mailbox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidsYesEmail UIDs
destinationYesDestination mailbox
mailboxNoSource mailbox (default: current)

Implementation Reference

  • The `copy_email` method in `imap_client.py` handles the logic for copying emails between IMAP mailboxes.
    def copy_email(
        self, uids: list[int], destination: str, mailbox: Optional[str] = None
    ) -> bool:
        """Copy emails to another mailbox."""
        self._ensure_connected()
        if mailbox:
            self.select_mailbox(mailbox)
        self.client.copy(uids, destination)
        return True
  • The `copy_email` tool is registered and handled within the main server loop in `src/imap_mcp/server.py`.
    elif name == "copy_email":
        return imap_client.copy_email(
            uids=args["uids"],
            destination=args["destination"],
            mailbox=args.get("mailbox"),
        )

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