home / mcp / fastmail mcp server
A Model Context Protocol (MCP) server that provides tools for interacting with JMAP (JSON Meta Application Protocol) email servers. Built with Deno and using the jmap-jam client library.
Configuration
View docs{
"mcpServers": {
"wyattjoh-jmap-mcp": {
"command": "deno",
"args": [
"run",
"--allow-net=api.fastmail.com",
"--allow-env=JMAP_SESSION_URL,JMAP_BEARER_TOKEN,JMAP_ACCOUNT_ID",
"jsr:@wyattjoh/[email protected]"
],
"env": {
"JMAP_ACCOUNT_ID": "YOUR_ACCOUNT_ID",
"JMAP_SESSION_URL": "https://api.fastmail.com/jmap/session",
"JMAP_BEARER_TOKEN": "API_TOKEN"
}
}
}
}You can run a MCP server that provides JMAP-based email tools. Built with Deno and leveraging the jmap-jam client, this MCP server exposes practical actions for searching, retrieving, organizing, sending, and threading emails, all while validating input and handling errors robustly.
Connect with a MCP client to perform common email actions such as searching for messages, retrieving emails and threads, marking read or flagged status, moving or deleting messages, and composing or replying to emails. You will interact with the server through standard MCP client calls; the server handles JMAP protocol compatibility, input validation, pagination, and error handling. Use the provided environment variables to authorize requests and point the client at your JMAP server.
Prerequisites include a Deno runtime and a JMAP-compliant email server with valid credentials.
Install and run the MCP server as shown in the setup example.
{
"mcpServers": {
"fastmail": {
"type": "stdio",
"command": "deno",
"args": [
"run",
"--allow-net=api.fastmail.com",
"--allow-env=JMAP_SESSION_URL,JMAP_BEARER_TOKEN,JMAP_ACCOUNT_ID",
"jsr:@wyattjoh/[email protected]"
],
"env": {
"JMAP_SESSION_URL": "https://api.fastmail.com/jmap/session",
"JMAP_BEARER_TOKEN": "API_TOKEN"
}
}
}
}Environment variables control access and target the specific JMAP server. Ensure the session URL is reachable and the bearer token has permission to access the desired account. The MCP server validates inputs with strong typing and provides comprehensive error handling. You can run the server in development mode with live reloading by using the provided Deno command and watching the source files.
All input is validated using strict schemas, and sensitive configuration lives in environment variables rather than being logged or exposed in responses.
If you cannot connect, verify that the JMAP session URL and bearer token are correct, the account ID (if required) is valid, and the JMAP server is reachable from the MCP host network.
This MCP server is designed to work with any JMAP-compliant email server. Ensure your chosen backend supports RFC 8620/8621 and that credentials permit the requested operations.
Search emails with text queries, sender/recipient filters, date ranges, and keywords
Retrieve specific emails by ID with full details
Retrieve email threads (conversation chains)
Mark emails as read/unread, flagged/unflagged
Move emails between mailboxes
Delete emails permanently
List all mailboxes/folders with hierarchy support
Compose and send new emails with plain text or HTML
Reply to existing emails with reply-all support