home / mcp / fastmail mcp server
Provides an MCP interface to read, search, and send emails via FastMail's JMAP API.
Configuration
View docs{
"mcpServers": {
"jmhron-fastmailmcp": {
"command": "python",
"args": [
"fastmail_mcp_server.py"
],
"env": {
"MCP_DEBUG": "1"
}
}
}
}This MCP server lets you integrate with FastMail using the JMAP API to read, search, organize, and send emails. It provides practical, scriptable access to your FastMail account from MCP clients, enabling you to list mailboxes, fetch emails with previews, perform advanced searches, and send messages programmatically.
You use this server by connecting an MCP client to it. After you configure your FastMail credentials, you can list all mailboxes, read emails from a chosen folder, perform targeted searches with multiple filters, retrieve full email bodies, and send messages with optional CC and BCC recipients. Each action maps to a specific MCP command that you issue through your client, and responses come back in the MCP protocol format.
Prerequisites: you need Python 3.8 or later and a FastMail account with API access. You also need an API token from FastMail (Settings ā Privacy & Security ā Integrations).
Step-by-step commands to get started:
git clone <your-repo-url>
cd fastmail_mcp_server
pip install -r requirements.txt
# Obtain your FastMail API token as described in the prerequisites
# Then configure the server with your token as needed by the setup tooling
python fastmail_mcp_server.pyConfigure your FastMail credentials before starting the server. Provide the API token you generated from FastMail so the MCP server can authenticate requests.
You can start the server with the runtime command shown above. It will listen for MCP commands via standard input/output.
Debug and troubleshooting: you can enable debug logging by setting the MCP_DEBUG environment variable before running the server, which helps diagnose connectivity or authentication issues.
Keep your API token secure. Do not commit tokens to version control. The token has access to your FastMail account and should be kept private. All communications with FastMail use HTTPS.
Common problems include authentication errors due to an invalid or expired API token, connection failures caused by network issues, or missing emails if you are querying the wrong mailbox or filters. Enable debug logging to get more insight into the issue by setting MCP_DEBUG to a non-empty value before starting the server.
Contributions are encouraged. Follow standard contribution practices: fork, create a feature branch, implement changes, add tests if applicable, and open a pull request.
Set up your FastMail API credentials by providing the apiToken through the configuration tool.
List all mailboxes with their names, roles, and email counts.
Find a specific mailbox by name or role with optional partial matching.
Fetch emails from a specific mailbox with options to limit results and include the body.
Perform advanced searches across emails with filters like keyword, sender, subject, mailbox, attachments, and date range.
Retrieve the full body content of a specific email in text, html, or both formats.
Send an email through FastMail with optional CC and BCC fields and HTML support.