Skip to main content

pyfastmail-mcp

An MCP server that gives AI assistants full access to your Fastmail account — email, contacts, calendars, and file storage.

⚠️ This server can send email, delete messages, and modify contacts/calendars on your behalf. AI assistants may act on content from untrusted sources (emails, web pages, files) which could contain prompt injection attacks. Review tool calls before approving them, especially actions that send email or delete data.

Features

Domain Protocol Tools
Mail JMAP Send, reply, forward, search, read, pin, archive, keywords, masked email, attachments, threads, import/export, identities
Contacts JMAP List address books, CRUD contacts, query
Calendar CalDAV List calendars, CRUD events (optional — requires app password)
Files WebDAV List, upload, download, move, delete, create folders (optional — requires app password)

Installation

pip install pyfastmail-mcp

Or run directly with uvx:

uvx pyfastmail-mcp

Configuration

1. Get Fastmail Credentials

You need an API token from Fastmail. An app password is optional (only needed for calendar and file storage).

If you only set the API token, the server starts with mail and contacts tools. Calendar and file tools are registered only when the app password is also provided.

2. Set Environment Variables

export FASTMAIL_API_TOKEN="fmu1-..."
export FASTMAIL_APP_PASSWORD="your-app-password"
export FASTMAIL_EMAIL="you@fastmail.com"

3. Add to Your MCP Client

For Claude Desktop, add to claude_desktop_config.json:

{
  "mcpServers": {
    "fastmail": {
      "command": "uvx",
      "args": ["pyfastmail-mcp"],
      "env": {
        "FASTMAIL_API_TOKEN": "fmu1-...",
        "FASTMAIL_APP_PASSWORD": "your-app-password",
        "FASTMAIL_EMAIL": "you@fastmail.com"
      }
    }
  }
}

For Kiro CLI, add to .kiro/settings/mcp.json:

{
  "mcpServers": {
    "fastmail": {
      "command": "uvx",
      "args": ["pyfastmail-mcp"],
      "env": {
        "FASTMAIL_API_TOKEN": "${FASTMAIL_API_TOKEN}",
        "FASTMAIL_EMAIL": "${FASTMAIL_EMAIL}",
        "FASTMAIL_APP_PASSWORD": "${FASTMAIL_APP_PASSWORD}"
      }
    }
  }
}

Tools

Mail (mail_*)

Tool Description
health_check Verify connection and auth
mail_list_mailboxes List all mailboxes (folders/labels)
mail_create_mailbox Create a mailbox
mail_rename_mailbox Rename a mailbox
mail_delete_mailbox Delete a mailbox
mail_get_email Get email by ID (with optional headers)
mail_get_recent_emails Get recent emails
mail_search_emails Search by query
mail_search_snippets Highlighted search result snippets
mail_get_email_thread Get full thread
mail_mark_email_read Mark read/unread
mail_pin_email Pin/unpin (flag/star)
mail_move_email Move to mailbox
mail_delete_email Move to trash or permanently delete
mail_archive_email Archive
mail_manage_email_labels Add/remove keywords
mail_export_email Download raw .eml file
mail_import_email Import .eml into mail store
mail_parse_email Parse a blob as email without importing
mail_list_identities List send-as identities
mail_set_identity Create/update/delete identities
mail_send_email Send new email
mail_reply_to_email Reply to email
mail_forward_email Forward email
mail_list_masked_emails List masked emails
mail_create_masked_email Create masked email
mail_update_masked_email Update masked email state, domain, description, or URL
mail_download_attachment Download attachment
mail_upload_attachment Upload blob for sending

Contacts (contacts_*)

Tool Description
contacts_list_address_books List address books
contacts_list List contacts (query+get combo)
contacts_get_contact Get contact(s) by ID
contacts_query_contacts Query contacts with filters and sorting
contacts_create_contact Create contact
contacts_update_contact Update contact fields
contacts_delete_contact Delete contact(s)

Calendar (calendar_*)

Tool Description
calendar_list_calendars List calendars
calendar_list_events List events
calendar_get_event Get event details
calendar_create_event Create event
calendar_update_event Update event
calendar_delete_event Delete event

Files (files_*)

Tool Description
files_list List files/folders
files_get Download file
files_upload Upload file
files_create_folder Create folder
files_move Move/rename file
files_delete Delete file/folder

Development

git clone https://github.com/pjosols/pyfastmail-mcp.git
cd pyfastmail-mcp
uv sync --group dev
uv run pytest

License

MIT

Metadata

Release files for pyfastmail-mcp 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfastmail-mcp 0.3.2
File Size Uploaded
pyfastmail_mcp-0.3.2.tar.gz 1.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfastmail-mcp 0.3.2
File Interpreter ABI Platform
pyfastmail_mcp-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / pyfastmail_mcp-0.3.2.tar.gz

Download URL pyfastmail_mcp-0.3.2.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
198ac567f8998d7592dc5db4eec40848e06f4f685aab7c5a6f83d88e53b9bb24
BLAKE2b-256 checksum
How to use checksums
964afb734b1f341502eff20d2bc9bbe53fa31b707dc2d4d0162657d384fff80f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 8, 2026.

Transparency log

Release files / pyfastmail_mcp-0.3.2-py3-none-any.whl

Download URL pyfastmail_mcp-0.3.2-py3-none-any.whl
Size 45.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82249869e7dbffc28c9e0787ada0e6756678479c3cb6b5d261e270ea822d02c1
BLAKE2b-256 checksum
How to use checksums
a90bfd8843a2a4d94684efc0007180cd9c9b38e05a89818e37c9b7c2cbb18793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page