mailmate-mcp
An MCP server that gives Claude direct access to the MailMate macOS email client for searching, reading, and organizing email.
Search messages by text query, tag, account, mailbox, or body content, with a configurable result limit (newest first)
Read a message in full by its
message://URL, including headers, metadata, tags, and body (plain text or HTML)List mailboxes across all accounts with message counts, and list tags defined in MailMate
Get a message link (
message://URL) and open a message directly in MailMateMove messages to another mailbox, syncing the change to the server via IMAP
Add or remove tags on Fastmail messages (requires a
FASTMAIL_API_TOKEN; synced as IMAP keywords)
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mailmate-mcp search for recent emails from Bob about the quarterly report"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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+
Related MCP server: mail-macos-mcp
Installation
git clone https://github.com/huckncatch/mailmate-mcp
cd mailmate-mcp
uv syncMCP 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.shClaude 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 by query string, tag, account, mailbox, or date range ( |
| Fetch full details and body for a message by its |
| List all mailboxes across all configured accounts with message counts. |
| List all tags defined in MailMate Preferences → Tags. |
| Get the |
| Move a message to a different mailbox (syncs via IMAP). |
| 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>.emlmailstore.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.serverThere 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 toolsget_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
get_message_linkA
Get the message:// link for a message and open it in MailMate.
The returned URL can be pasted into any app to jump directly to the message in MailMate (same as Edit > Copy as Link).
Inputs: message_url (required). 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
Scored across 8 tools
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.
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.
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.
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
Related MCP Connectors
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Email: search, read, fetch attachments; attach files when the MCP client supports inputs.
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables Claude to interact with email accounts via IMAP and SMTP, providing tools for searching, reading, sending, and managing emails across multiple providers.401,009 npm135MIT
- AlicenseAqualityCmaintenanceEnables Claude to control the macOS Mail app for reading, searching, drafting, sending, and managing emails directly from Claude Desktop.12MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude to read, search, send, and manage email across multiple IMAP/SMTP accounts through OAuth 2.1-secured MCP tools.MIT
- AlicenseBqualityDmaintenanceEnables 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.1950 npmMIT