Skip to main content
Glama
mailmate-mcp

mailmate-mcp

by huckncatch

mailmate-mcp

An MCP server that gives Claude (and other MCP clients) direct access to MailMate, the macOS email client. Search, read, move, tag, and link emails without leaving your conversation.

Requirements

  • macOS (MailMate is Mac-only)

  • MailMate installed and configured with at least one IMAP account

  • Python 3.11+

  • uv

Related MCP server: mail-macos-mcp

Installation

git clone https://github.com/huckncatch/mailmate-mcp
cd mailmate-mcp
uv sync

MCP Registration

tag_message needs a Fastmail API token (JMAP type, Email scope) in FASTMAIL_API_TOKEN. Register a launcher script that sets it and then runs /path/to/mailmate-mcp/.venv/bin/mailmate-mcp, so no client config holds the token. The other tools work without it.

Claude Code (global, all projects)

claude mcp add --scope user mailmate /path/to/launcher.sh

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mailmate": {
      "command": "/path/to/launcher.sh",
      "args": []
    }
  }
}

Restart Claude Desktop after any change to server code or config.

Tools

Tool

Description

search_messages

Search by query string, tag, account, mailbox, or date range (since / before), newest first. Supports body search.

get_message

Fetch full details and body for a message by its message:// URL.

list_mailboxes

List all mailboxes across all configured accounts with message counts.

list_tags

List all tags defined in MailMate Preferences → Tags.

get_message_link

Get the message:// link for a message.

move_message

Move a message to a different mailbox (syncs via IMAP).

tag_message

Add or remove tags on a Fastmail message. Sets the IMAP keywords on the server over JMAP; MailMate shows them after its next sync.

Messages are identified by message:// URLs derived from the RFC 2822 Message-ID header, e.g. message://%3Cabc123@example.com%3E. Use search_messages to find them.

How It Works

The server reads MailMate's on-disk message store at:

~/Library/Application Support/MailMate/Messages.noindex/IMAP/
  <account>/
    <mailbox>.mailbox/
      Messages/
        <uid>.eml

mailstore.py — filesystem and parsing layer. Walks the store, parses .eml files, and maintains an in-memory index for fast search. No MCP or AppleScript dependencies.

server.py — MCP boundary. Defines all tools via fastmcp. It never automates MailMate's interface.

Development

# Run the server directly (stdio transport)
uv run mailmate-mcp

# Or via the module
uv run python -m mailmate_mcp.server

There is no automated test suite. Manual testing is done by registering the server with Claude Desktop or Claude Code and exercising the tools in a conversation.

Available Tools

8 tools
get_messageA

Get full details of a specific email by its message:// URL.

Returns headers, metadata, tags, and optionally the body.

Inputs: message_url (required), prefer_html, include_body. Returns: object

list_mailboxesA

List all mailboxes across all configured MailMate accounts.

Returns account name, mailbox path, and message count for each.

Inputs: no named parameters. Returns: result

list_tagsA

List all tags defined in MailMate.

Tags correspond to IMAP keywords and are configured in MailMate > Preferences > Tags.

Inputs: no named parameters. Returns: result

move_messageA

Move a message to a different mailbox.

MailMate performs the actual IMAP MOVE, so the message will be moved on the server as well. Provide the 'path' from list_mailboxes or just a mailbox name — if a name is given, the first matching mailbox across all accounts is used.

Inputs: message_url (required), target_mailbox_path (required). Returns: object

open_message_in_mailmateA

Open a specific message in MailMate by its message:// URL.

Activates MailMate and navigates to the message.

Inputs: message_url (required). Returns: object

search_messages_toolA

Search MailMate messages by query string and/or tag.

query and tag are both optional — omit query to list all messages with a given tag, or omit tag to search by text only. Use list_tags to see available tags.

Returns a list of matching messages with subject, from, to, date, mailbox, tags, and message_url for each.

Inputs: tag, query, account, mailbox, +2 more. Returns: result

tag_messageA

Add or remove tags on a message.

Tags are stored as IMAP Keywords headers and synced to the server. MailMate will pick up the change on next access.

Use list_tags to see what tags are defined in MailMate.

Inputs: message_url (required), add_tags, remove_tags. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 8 tools

    Disambiguation3/5

    Most tools target distinct actions, but open_message_in_mailmate and get_message_link both open a message in MailMate, making their purposes fuzzy. get_message, get_message_link, and open_message_in_mailmate also form a confusingly similar group of message-URL tools.

    Naming Consistency4/5

    The set mostly follows a verb_noun pattern: list_tags, list_mailboxes, get_message, move_message, tag_message. The main deviations are the awkward search_messages_tool suffix and the longer open_message_in_mailmate form, but the pattern remains predictable.

    Tool Count5/5

    Eight tools is a well-scoped size for a MailMate server covering search, retrieval, navigation, mailbox listing, tagging, and moving messages. Each tool feels justified even if a couple overlap.

    Completeness3/5

    Retrieval and organization workflows are covered: search, read, move, tag, and open. However, an email client surface lacks obvious send/reply/delete and mark-read operations, and the search tool cannot filter by mailbox, which are notable gaps.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      Enables Claude to interact with email accounts via IMAP and SMTP, providing tools for searching, reading, sending, and managing emails across multiple providers.
      40
      1,009 npm
      135
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude to control the macOS Mail app for reading, searching, drafting, sending, and managing emails directly from Claude Desktop.
      12
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude to read, search, send, and manage email across multiple IMAP/SMTP accounts through OAuth 2.1-secured MCP tools.
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables email management through IMAP/SMTP, including reading, sending, replying, starring, deleting, labeling emails, handling attachments, and filtering by Gmail smart categories. Works with MCP-compatible clients like Claude Desktop and Claude Code using App Password authentication.
      19
      50 npm
      MIT