pyfastmail-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FASTMAIL_EMAIL | Yes | Your Fastmail email address. | |
| FASTMAIL_API_TOKEN | Yes | Fastmail API Token used for JMAP/mail access (e.g., fmu1-...). | |
| FASTMAIL_APP_PASSWORD | Yes | Fastmail App Password used for CardDAV, CalDAV, and WebDAV access. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| health_checkA | Verify connectivity to Fastmail and return account info. |
| mail_list_mailboxesB | List all mailboxes with id, name, role, email counts, and parentId. |
| mail_create_mailboxB | Create a new mailbox with the given name and optional parent mailbox ID. |
| mail_rename_mailboxC | Rename a mailbox by its ID. |
| mail_delete_mailboxA | Delete a mailbox by its ID. System mailboxes (inbox, trash, sent, etc.) cannot be deleted. |
| mail_search_emailsB | Search emails with optional filters. Returns id, subject, from, date. Args: text: Full-text search query. from_: Filter by sender address. to: Filter by recipient address. subject: Filter by subject text. has_attachment: Filter by attachment presence. limit: Max results (default 20). newest_first: Sort newest first (default True). |
| mail_get_recent_emailsB | Get emails received in the last N days. Args: days: How many days back to look (default 7). limit: Max results (default 20). |
| mail_get_emailA | Get a single email by ID with full body content and attachment metadata. Args: email_id: The JMAP email ID. prefer_html: Return HTML body if available; defaults to plain text. |
| mail_get_email_threadA | Return all emails in the same thread as the given email, in chronological order. Args: email_id: ID of any email in the thread. |
| mail_move_emailC | Move one or more emails to a mailbox identified by name. Args: email_ids: List of JMAP email IDs to move. mailbox_name: Name of the destination mailbox (case-insensitive). |
| mail_archive_emailC | Move one or more emails to the Archive mailbox. Args: email_ids: List of JMAP email IDs to archive. |
| mail_mark_email_readA | Set or unset the $seen flag on one or more emails. Args: email_ids: List of JMAP email IDs to update. read: True to mark as read, False to mark as unread (default True). |
| mail_delete_emailA | Delete one or more emails by moving to Trash, or permanently destroy them. Args: email_ids: List of JMAP email IDs to delete. permanent: If True, permanently destroy emails. Default moves to Trash. |
| mail_list_identitiesA | List all sender identities available on this Fastmail account. Returns each identity's id, name, and email address. |
| mail_send_emailA | Send an email via Fastmail. Args: to: List of recipient email addresses. subject: Email subject line. text_body: Plain-text body content. cc: Optional list of CC addresses. bcc: Optional list of BCC addresses. html_body: Optional HTML body content. Passed verbatim to the JMAP API with no sanitisation. When this tool is driven by an AI agent that processes external content, ensure the html_body value originates from a trusted source to prevent prompt- injection attacks from causing malicious emails to be sent. identity_id: Sender identity ID; auto-selects first identity if omitted. |
| mail_reply_to_emailA | Reply to an email, preserving threading headers and quoting the original. Args: email_id: ID of the email to reply to. text_body: Your reply text (original message is quoted below). reply_all: If True, CC all original recipients. identity_id: Sender identity ID; auto-selects first if omitted. |
| mail_forward_emailA | Forward an email to one or more recipients, preserving the original content. Args: email_id: ID of the email to forward. to: List of recipient email addresses. text_body: Optional introductory text prepended before the quoted original. identity_id: Sender identity ID; auto-selects first if omitted. |
| mail_manage_email_labelsA | Add or remove keywords/labels on one or more emails. Supports standard flags ($seen, $flagged, $draft, $answered) and custom keywords. At least one of add or remove must be provided. Args: email_ids: List of JMAP email IDs to update. add: Keywords to add (e.g. ["$flagged", "myLabel"]). remove: Keywords to remove (e.g. ["$seen"]). |
| mail_list_masked_emailsB | List masked email addresses, optionally filtered by domain or state. Args: domain: Filter by forDomain (partial match). state: Filter by state: 'enabled', 'disabled', 'deleted', 'pending'. |
| mail_create_masked_emailB | Create a new masked email address. Args: for_domain: The domain this address is for, e.g. 'https://example.com'. description: Short user-supplied description of what this address is for. email_prefix: Optional prefix for the generated address (a-z, 0-9, _ only). |
| mail_update_masked_email_stateB | Enable or disable a masked email address. Args: masked_email_id: The ID of the masked email to update. state: New state: 'enabled' or 'disabled'. |
| mail_download_attachmentC | Download an attachment blob by blobId. Args: blob_id: The blobId of the attachment (from email attachments list). name: The filename to use for the download. content_type: MIME type of the attachment (default: application/octet-stream). |
| mail_upload_attachmentB | Upload a blob for use in email composition. Args: data: Base64-encoded file content. content_type: MIME type of the file. name: Filename (informational only; not stored with the blob). |
| contacts_list_address_booksA | List all CardDAV address books for the authenticated Fastmail account. |
| contacts_get_contactB | Get full details of a single contact by its CardDAV href. Args: href: The href/URL path of the vCard resource (as returned by contacts_list). |
| contacts_listC | List contacts in a CardDAV address book. Args: address_book_href: URL path of the address book (e.g. /dav/addressbooks/user/you@example.com/Default/). Defaults to the first address book found. |
| contacts_create_contactB | Create a new contact in a CardDAV address book. Args: name: Full display name of the contact. email: Email address (optional). phone: Phone number (optional). org: Organization/company name (optional). notes: Free-text notes (optional). address_book_href: URL path of the address book. Defaults to the first one found. |
| contacts_update_contactB | Update an existing contact in a CardDAV address book. Only the fields you provide will be changed; omitted fields are left as-is. Args: href: The href/URL path of the vCard resource (as returned by contacts_list). name: New display name (optional). email: New email address (optional). phone: New phone number (optional). org: New organisation name (optional). notes: New notes (optional). |
| contacts_delete_contactB | Delete a contact from a CardDAV address book. Args: href: The href/URL path of the vCard resource (as returned by contacts_list). |
| calendar_list_calendarsA | List all CalDAV calendars for the authenticated Fastmail account. |
| calendar_list_eventsA | List events in a CalDAV calendar within a date range. Args: calendar_href: The href of the calendar (from calendar_list_calendars). start_date: ISO date string (YYYY-MM-DD). Defaults to today. end_date: ISO date string (YYYY-MM-DD). Defaults to 7 days from start. |
| calendar_get_eventA | Get full details of a single CalDAV event by its href. Args: href: The href/URL path of the .ics resource (as returned by calendar_list_events). |
| calendar_create_eventB | Create a new event in a CalDAV calendar. Args: calendar_href: The href of the calendar (from calendar_list_calendars). title: Event title/summary. start: Start datetime as ISO string (YYYY-MM-DDTHH:MM:SS or YYYY-MM-DD for all-day). end: End datetime as ISO string. location: Optional location string. description: Optional description. all_day: If True, treat start/end as dates (not datetimes). |
| calendar_update_eventB | Update fields on an existing CalDAV event. Args: href: The href of the .ics resource (from calendar_list_events). title: New summary/title (omit to keep existing). start: New start datetime ISO string (omit to keep existing). end: New end datetime ISO string (omit to keep existing). location: New location (omit to keep existing). description: New description (omit to keep existing). |
| calendar_delete_eventB | Delete a CalDAV event by its href. Args: href: The href of the .ics resource (from calendar_list_events). |
| files_listB | List files and folders at a WebDAV path on Fastmail Files. Args: path: Path to list (default: root "/"). depth: "0" for the item itself only, "1" for immediate children (default). |
| files_getA | Download a file from Fastmail Files (WebDAV), returned as base64. Args: path: Path to the file (e.g. "/Documents/report.pdf"). |
| files_uploadA | Upload a file to Fastmail Files (WebDAV). Args: path: Destination path (e.g. "/Documents/report.pdf"). content: Base64-encoded file content. content_type: MIME type of the file (default: application/octet-stream). |
| files_create_folderC | Create a folder on Fastmail Files (WebDAV). Args: path: Path of the new folder (e.g. "/Documents/NewFolder"). |
| files_deleteC | Delete a file or folder on Fastmail Files (WebDAV). Args: path: Path to delete (e.g. "/Documents/old.txt"). |
| files_moveC | Move or rename a file or folder on Fastmail Files (WebDAV). Args: source: Source path (e.g. "/Documents/old.txt"). destination: Destination path (e.g. "/Archive/old.txt"). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pjosols/pyfastmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server