Stalwart Mail MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MAIL_LANG | No | `auto` (default: the machine's language, English when unsupported) or a locale code | auto |
| MAIL_BRAND | No | Display name of the server, default `Stalwart Mail` | Stalwart Mail |
| STALWART_URL | Yes | Public address of the Stalwart mail server, e.g. https://mail.example.com (required) | |
| MAIL_TIMEZONE | No | IANA zone for dates in the output, default the machine's zone | |
| STALWART_USER | Yes | The mailbox you sign in as (required) | |
| MAIL_OCR_MODEL | No | Model used by the chosen OCR provider | |
| STALWART_TOKEN | No | An OAuth access token instead of the password — sent as Bearer | |
| MAIL_ALLOW_SEND | No | `false` removes `send_email` and `send_draft` | |
| MISTRAL_API_KEY | No | Shortcut: with only this set, scans go to Mistral OCR | |
| MAIL_OCR_API_KEY | No | API key for the chosen OCR provider | |
| MAIL_TOOL_PREFIX | No | Prefix of the tool names, default `mail` | |
| MAIL_ALLOW_DRAFTS | No | `false` removes `create_draft` and `delete_draft` | |
| MAIL_DOWNLOAD_DIR | No | Where attachments are saved, default `~/Downloads/Mail-Attachments` | |
| MAIL_OCR_BASE_URL | No | Base URL of a custom OpenAI-compatible OCR server (used with MAIL_OCR_PROVIDER=custom) | |
| MAIL_OCR_PROVIDER | No | Who reads scans: `auto` (default), `mistral`, `anthropic`, `openai`, `openrouter`, `gemini`, `ollama`, `lmstudio`, `custom` or `off` | auto |
| STALWART_PASSWORD | No | Mailbox or app password — sent as Basic auth | |
| MAIL_SAVE_ATTACHMENTS | No | `false` = opened attachments are only read, nothing is written to disk | |
| MAIL_ALLOW_ATTACHMENTS | No | `false` removes `get_attachment` | |
| MAIL_ALLOW_CONTACT_EDIT | No | `false` removes `add_contact` |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| mail_list_mailboxesA | Returns the available accounts (your mailbox plus shared ones), folders with message counts (unread) and the addresses you can send from. Call it first when you do not know which folders or accounts exist. Changes nothing. |
| mail_search_emailsA | Searches mail (full text, sender, recipient, subject, folder, date, unread, attachments) or lists a whole thread. Returns message ids (for mail_get_email), thread, sender, date and a preview. Newest first, paging through limit/offset. Without a filter it returns the latest messages from all folders (trash included) — for “what is new” use mailbox="inbox", unread=true. |
| mail_get_emailA | Returns a whole message by id (from mail_search_emails): headers, body text (HTML is converted to text) and the list of attachments. mail_get_attachment reads an attachment's content (PDF, image, text). To reply use mail_send_email with in_reply_to_id. Changes nothing (does not mark the message as read). |
| mail_get_attachmentA | Downloads an attachment of a received message, saves it to disk and returns its content: text for text files, the text of every page for PDFs, the picture for images. Scans (PDF pages without a text layer) and photos of documents are read through OCR, tables included; pages that came from OCR are marked “(OCR)” — treat numbers from them with some caution and ask for a preview when a figure matters. Other types (docx, xlsx, zip…) only return the path of the saved file. Pick the attachment by name or by its number from the list in mail_get_email; a message with a single attachment needs neither. The message itself is not changed. |
| mail_send_emailA | Sends an e-mail from the mailbox — a new one, or a reply (in_reply_to_id). A copy is stored in Sent. It sends IMMEDIATELY and cannot be undone. Send only when the user explicitly said the message should go out; otherwise create a draft (mail_create_draft). Verify the recipient before sending — never guess an unknown address, look it up with mail_search_contacts. |
| mail_create_draftA | Saves a message as a draft in the Drafts folder (does not send). The user can then review it in webmail or on the phone and send it themselves, or mail_send_draft sends it by id. Same parameters as mail_send_email (including replying via in_reply_to_id and attachments). |
| mail_send_draftA | Sends an existing draft by id (from mail_create_draft or from a search in the drafts folder). Sends immediately — only on the user's explicit instruction. |
| mail_delete_draftA | Permanently deletes a draft by id. Works only on messages flagged as drafts — it never deletes sent or received mail. |
| mail_search_contactsA | Finds an e-mail address or phone number: searches the address books (your own and shared ones) and also the mail history (who wrote to you and whom you wrote to, matching the query). Use it whenever you need a person's or company's address before sending anything. Without a query it lists the whole address book. |
| mail_add_contactA | Creates a contact in an address book. Default is the signed-in mailbox's own address book; pass the account of a shared mailbox to store it in the shared one (everyone with access sees it, on phones too through CardDAV). Check mail_search_contacts first so you do not create a duplicate. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 10 tools
Each tool maps to a distinct resource+action: listing mailboxes, searching, fetching a message, fetching an attachment, sending, draft lifecycle (create/send/delete), and contact search/add. Boundaries are clear, with draft-sending vs email-sending distinguished by tool name and description.
Every tool follows a strict mail_verb_noun pattern (mail_list_mailboxes, mail_search_emails, mail_get_email, mail_create_draft, etc.). No mixing of conventions or verb styles.
10 tools is well-scoped for a mail server spanning folders, messages, attachments, drafts, and contacts. Each tool clearly earns its place with no redundancy.
Core lifecycle is well covered: read/search/attachments, send, full draft lifecycle (create/send/delete), and contact search/add. Gaps remain around managing received mail (move, archive, mark read/unread) and contact update/delete, but agents can work around most of these.