local-fastmail-mcp
A local-only, secure server for accessing your Fastmail email
Local Fastmail MCP Server
A locally-hosted Model Context Protocol server that connects your Fastmail account to any MCP-compatible AI assistant (such as Claude Desktop, Cursor, or similar tools).
This integration leverages Fastmail's native JMAP API and strictly typed TypeScript/Zod schemas to allow your AI assistant to read, manage, and interact with your inbox without relying on third-party webhook integrations or exposing credentials outward.
Capabilities
Once connected, your AI assistant can use the following tools:
list_mailboxes
Discover all labels, folders, and mailboxes in your account. Returns each mailbox's ID, name, role, unread/total counts, and permissions.
list_emails
Query emails by folder, keyword search, or read/unread status. Supports pagination for large result sets.
| Parameter | Type | Description |
|---|---|---|
mailboxId | string? | Filter by a specific mailbox ID (use list_mailboxes to discover IDs) |
query | string? | Full-text search across email content |
unreadOnly | boolean? | Only return unread emails |
limit | number? | Max results per page (default: 20, max: 250) |
position | number? | Zero-based offset for pagination |
The response includes emails, total, position, and hasMore. To page through results, increment position by limit on each call until hasMore is false.
read_email
Fetch the full content of a specific email by its ID.
| Parameter | Type | Description |
|---|---|---|
emailId | string | The exact ID of the email to read |
textOnly | boolean? | When true, only fetches text/plain content, skipping HTML. Ideal for newsletters and HTML-heavy emails to reduce response size. |
send_email
Draft and send a new email from your Fastmail account.
| Parameter | Type | Description |
|---|---|---|
to | string | Destination email address |
subject | string | Subject line |
body | string | Plain text body content |
mark_email_read
Mark a specific email as read or unread.
| Parameter | Type | Description |
|---|---|---|
emailId | string | The exact ID of the email |
read | boolean? | true to mark as read (default), false for unread |
move_email
Transfer an email to a different mailbox/folder.
| Parameter | Type | Description |
|---|---|---|
emailId | string | The exact ID of the email to move |
mailboxId | string | The destination mailbox ID |
delete_email
Move an email to the Trash mailbox.
| Parameter | Type | Description |
|---|---|---|
emailId | string | The exact ID of the email to delete |
Security Approach
This server uses stdio transport exclusively — it never exposes an external HTTP port. Credentials are stored locally in your .env file or passed via the MCP client's environment configuration. All communication is directly between your local machine and the official api.fastmail.com/jmap endpoints.
Installation & Setup
1. Requirements
Ensure you have installed Node.js (version 22+ recommended) and npm on your local machine.
2. Configure your Fastmail API Token
- Log into your Fastmail Account.
- Go to
Settings->Privacy & Security->Connected apps & API tokens. - Click New API Token.
- Name the token (e.g. "AI MCP Server")
- Provide the token the following scopes:
Email(required for reading and listing)Email submission(required for sending emails)
- Copy the generated API token securely.
3. Local Project Setup
Clone the repository and install the required dependencies:
npm install
Copy the example environment variables file:
cp .env.example .env
Open .env in your text editor and paste in your credentials:
[email protected]
FASTMAIL_API_TOKEN=fmu1-your-secret-token-here
4. Build the Project
Compile the TypeScript framework down into native JavaScript execution logic:
npm run build
Connecting to an MCP Client
This server works with any MCP-compatible client. Below is an example using Claude Desktop.
Claude Desktop
-
Open Claude Desktop and choose Settings -> Developer -> Edit Config Open claude_desktop_config.json
-
Add this to the mcpServers section, fixing the path to the compiled index.js file and adding your own credentials:
{
"mcpServers": {
"local-fastmail": {
"command": "node",
"args": ["/absolute/path/to/your/local-fastmail-mcp/dist/index.js"],
"env": {
"FASTMAIL_EMAIL": "[email protected]",
"FASTMAIL_API_TOKEN": "fmu1-your-secret-token-here"
}
}
}
}
- Restart Claude Desktop. The new tools will appear instantly and you can start typing "Summarize my 20 most recent unread emails."
For other MCP clients, consult their documentation on how to register a local stdio server pointing at dist/index.js with the required environment variables.
Development & Testing
This project is built using TypeScript, @modelcontextprotocol/sdk, and Zod parsing.
If you are developing new Tools or making adjustments to the Fastmail capabilities:
- Compile: Always ensure you run
npm run buildafter making modifications. - Testing: Run the native Vitest coverage harness by executing:
npm test
Pull requests are welcome! Please open an issue first to discuss what you'd like to change. I plan to be picky, though, so also feel free to fork and make your own version.
Related Servers
Help Scout
An MCP server that enables AI assistants to interact with Help Scout data, such as customers and conversations.
LinkedIn
A server for interacting with LinkedIn, including authentication and posting capabilities.
Slack
The most powerful MCP server for Slack Workspaces. This integration supports both Stdio and SSE transports, proxy settings and does not require any permissions or bots being created or approved by Workspace admins 😏.
Slack User
Interact with Slack workspaces as a user via the Slack API.
Pushover MCP
Send push notifications using the Pushover.net service.
Whissle MCP Server
Access Whissle API for speech-to-text, diarization, translation, and text summarization.
MCP Mail
Perform actions with your GMail account using the GMail API.
WeChat Public Account Article Saver
Saves and publishes articles to WeChat Public Accounts.
Multichat MCP Server
A server for handling parallel unichat requests, configurable via a settings file.
FastAlert MCP Server
Official Model Context Protocol (MCP) server for FastAlert. This server allows AI agents (like Claude, ChatGPT, and Cursor) to list of your channels and send notifications directly through the FastAlert API.