list_all_accountsLABSCO SUMMARY
The attachment path is the detail that makes it usable on real mail.
Most mail servers either return attachment metadata only or base64 the whole thing into the reply, which blows the context window on a single photo. Here the bytes go to disk and you get a path back, so the file can be handed to a reader or an image tool without ever passing through the conversation.
What it is
A mail server written in Rust that covers the write side as well as the read side, and speaks four protocols rather than one - so a Microsoft mailbox and a generic IMAP account can sit behind the same tools.
What you get
- Search messages, list mailboxes and accounts, read a message with its attachment metadata, or fetch the raw source
- Download a single attachment to disk by part id or filename, so a large file never enters the reply
- Send, reply and forward over SMTP, with an option to save a copy to the Sent folder per account
- Exchange Web Services and Microsoft Graph paths for search and send, for mailboxes where IMAP is not the right door
- Mailbox management - create, rename and delete - and moving or copying single messages
- Bulk operations: delete, move and flag updates, and search-and-act variants that combine the two
- Cursor pagination and a setup guide tool for getting an account configured
Requirements
Built from source: clone the repository and run cargo build --release, and the client launches ./target/release/mail-mcp. Accounts are configured per account with real OAuth2 where the provider needs it, and several accounts can be live at once. Attachment downloads land in the directory you pass, or MAIL_ATTACHMENT_DOWNLOAD_DIR, or the system temp directory; filenames are sanitised and prefixed to avoid collisions and path traversal. Raw-source reads are capped at 1 MB, and inline attachment bytes are off by default.
Setup effort
Build from source — git clone https://github.com/tecnologicachile/mail-mcp.git
USE CASES
Finding a message you only half remember
Search the mailbox, page the results with the cursor, and read the one that matches in full.
Getting a document out of an email
Read the message for the attachment's part id, then download that one part to disk and open it with a local reader.
Answering a thread properly
Reply to the message so the headers stay intact, or forward it on, with a copy saved to Sent where the provider does not do that itself.
Clearing a backlog into folders
Create the mailbox you need, then bulk-move or bulk-flag everything a search returns rather than one message at a time.
Working a Microsoft mailbox
Use the Graph or Exchange path for search and send instead of forcing everything through IMAP.
31 tools
Listed in project docs. Your client may show a different list.
imap_list_accountsimap_verify_accountimap_list_mailboxesimap_mailbox_statusimap_search_messagesimap_get_messageimap_get_message_rawimap_get_attachmentimap_update_message_flagsimap_copy_messageimap_move_messageimap_delete_messageimap_create_mailboximap_delete_mailboximap_rename_mailboximap_append_messageimap_bulk_moveimap_bulk_deleteimap_bulk_update_flagssmtp_send_messagesmtp_reply_messagesmtp_forward_messagesmtp_verify_accountgraph_send_messageews_search_messagesews_get_messageews_send_messageimap_search_and_moveimap_search_and_deleteget_setup_guideBEFORE YOU INSTALL
What to know first
Tools you get
31 tools named in the project's documentation.
Requires
Rust toolchain (cargo) to build it
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/tecnologicachile/mail-mcp.git
cd mail-mcp
cargo build --releaseMCP Clients
Claude Code, Cursor
{
"mcpServers": {
"mail": {
"command": "./target/release/mail-mcp",
"env": {
"MAIL_IMAP_DEFAULT_HOST": "imap.gmail.com",
"MAIL_IMAP_DEFAULT_USER": "<YOUR_MAIL_IMAP_DEFAULT_USER>",
"MAIL_IMAP_DEFAULT_PASS": "<YOUR_MAIL_IMAP_DEFAULT_PASS>",
"MAIL_SMTP_DEFAULT_HOST": "smtp.gmail.com",
"MAIL_SMTP_DEFAULT_PORT": "587",
"MAIL_SMTP_DEFAULT_USER": "<YOUR_MAIL_SMTP_DEFAULT_USER>",
"MAIL_SMTP_DEFAULT_PASS": "<YOUR_MAIL_SMTP_DEFAULT_PASS>",
"MAIL_SMTP_DEFAULT_SECURE": "starttls",
"MAIL_IMAP_WRITE_ENABLED": "true",
"MAIL_SMTP_WRITE_ENABLED": "true"
}
}
}
}./target/release/mail-mcp has to be the full path of that file in your clone (the mail-mcp folder, then /target/release/mail-mcp). Your client can start the server from any folder, so the relative path only works when it happens to start inside the clone. The MAIL_* values are your address, server and app password; the example is set up for Gmail with an app password.