Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

list_mailboxes

Retrieve email mailbox summaries with statistics for a domain in Migadu email hosting. Use to view mailbox details and samples.

Instructions

List email mailboxes for domain. Returns summary with statistics and samples.

Args: domain: Domain name. Uses MIGADU_DOMAIN if not provided.

Returns: JSON object with mailbox summary and statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNo

Implementation Reference

  • The MCP tool handler function for 'list_mailboxes', decorated with @mcp.tool(). Handles domain resolution, logging, and delegates to the mailbox service.
    @mcp.tool(
        annotations={
            "readOnlyHint": True,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
    @with_context_protection(max_tokens=2000)
    async def list_mailboxes(ctx: Context, domain: str | None = None) -> Dict[str, Any]:
        """List email mailboxes for domain. Returns summary with statistics and samples.
    
        Args:
            domain: Domain name. Uses MIGADU_DOMAIN if not provided.
    
        Returns:
            JSON object with mailbox summary and statistics
        """
        if domain is None:
            from migadu_mcp.config import get_config
    
            config = get_config()
            domain = config.get_default_domain()
            if not domain:
                raise ValueError("No domain provided and MIGADU_DOMAIN not configured")
    
        await log_operation_start(ctx, "Listing mailboxes", domain)
        try:
            service = get_service_factory().mailbox_service()
            result = await service.list_mailboxes(domain)
            count = len(result.get("mailboxes", []))
            await log_operation_success(ctx, "Listed mailboxes", domain, count)
            return result
        except Exception as e:
            await log_operation_error(ctx, "List mailboxes", domain, str(e))
            raise
  • The initialization function where register_mailbox_tools(mcp) is called to register the list_mailboxes tool (line 21).
    def initialize_server():
        """Initialize the MCP server with all tools and resources"""
        # Register all tools
        register_mailbox_tools(mcp)
        register_identity_tools(mcp)
        register_alias_tools(mcp)
        register_rewrite_tools(mcp)
        register_resources(mcp)
  • The MailboxService method that implements the core logic by making the API request to list mailboxes for the given domain.
    async def list_mailboxes(self, domain: str) -> Dict[str, Any]:
        """Retrieve all email mailboxes configured for a domain with complete configuration details.
    
        Returns comprehensive information for each mailbox including permissions, spam settings,
        autoresponder configuration, and security options for domain-wide auditing and management.
        """
        return await self.client.request("GET", f"/domains/{domain}/mailboxes")

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/Michaelzag/migadu-mcp'

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