mail -bridge
Connect macOS Mail to AI through Model Context Protocol
claude mcp add --transport stdio fatbobman-mail-mcp-bridge python3 /path/to/mail-mcp-bridge/src/mail_mcp_server.py \ --env MAIL_ATTACHMENT_PATH="/tmp"
How to use
Mail MCP Bridge connects macOS Mail to an AI assistant via the Model Context Protocol (MCP). When you copy a Message-ID from Mail and feed it to your MCP-enabled AI, the bridge fetches the corresponding email (and its thread, attachments, and metadata) and exposes a structured representation that the AI can analyze. This enables use cases like summarizing emails, extracting requirements or action items, and inspecting attachments without exporting emails manually. The bridge documents the available MCP tools (such as reading emails, retrieving threads, and extracting attachments) so the AI can request specific data or perform actions such as reading a single email or an entire thread. To use it, configure your MCP client to point to the local mail MCP server (the “mail” server defined in the config), then copy a Message-ID from Mail and paste it into the AI chat to trigger analysis.
How to install
Prerequisites:
- macOS 12.0+ with Mail.app
- Python 3.9+ installed on the system
- MCP-compatible AI assistant (e.g., Claude Desktop or similar)
Install steps:
-
Clone the repository and install dependencies
git clone https://github.com/fatbobman/mail-mcp-bridge.git cd mail-mcp-bridge # Install MCP package (example; adjust if your environment differs) pip3 install mcp -
Run the MCP server (local development usage)
# Example command; update the path to the actual server script python3 src/mail_mcp_server.py -
Configure your MCP client (e.g., Claude Desktop) to use the local server
- In Claude, locate claude_desktop_config.json and add an entry for the MCP server named "mail" with:
{ "mcpServers": { "mail": { "command": "python3", "args": ["/path/to/mail-mcp-bridge/src/mail_mcp_server.py"] } } } - If you want to enable attachment handling, set the environment variable for the attachment path when configuring the server:
{ "mcpServers": { "mail": { "command": "python3", "args": ["/path/to/mail-mcp-bridge/src/mail_mcp_server.py"], "env": { "MAIL_ATTACHMENT_PATH": "/tmp" } } } }
- In Claude, locate claude_desktop_config.json and add an entry for the MCP server named "mail" with:
-
Restart Claude Desktop (quit completely and reopen) to pick up the new MCP server configuration.
Notes:
- Replace "/path/to/mail-mcp-bridge" with your actual installation path.
- Ensure any required system permissions (e.g., access to Mail data) are granted as needed.
Additional notes
Tips and caveats:
- The bridge reads Mail content through MCP; ensure the Message-ID you provide includes angle brackets (e.g., message-id@example.com).
- Attachments are stored temporarily if enabled; clean up may be necessary to avoid filling /tmp.
- If the MCP server cannot be found by your AI, verify the claude_desktop_config.json path and ensure the server script path is correct.
- You can customize the attachment directory using MAIL_ATTACHMENT_PATH; if not set, defaults are used.
- For best performance, run the bridge on a macOS machine with direct access to the Mail database and emlx files.
Related MCP Servers
mcp-linker
mcp store manager, add & syncs MCP server configurations across clients like Claude code, Cursor💡 build-in Codex agent use ChatGPT subscription, mcphub
mcp-mail
📧 MCP Mail Tool - AI-powered email management tool | 基于 MCP 的智能邮件管理工具
apple-mail
MCP server giving AI assistants full access to Apple Mail - read, search, compose, organize & analyze emails via natural language
macOS-Notification
macOS Notification MCP enables AI assistants to trigger native macOS sounds, visual notifications, and text-to-speech. Built for Claude and other AI models using the Model Context Protocol.
outlook
MCP server for Microsoft Office 365 Outlook – email, calendar & SharePoint integration for Claude, ChatGPT, and AI assistants via Microsoft Graph API
FocusRelayMCP
Talk to your OmniFocus tasks. An OmniFocus MCP server that lets AI assistants query your tasks, projects, and tags using natural language—no more clicking through endless lists.