fastmail-cli
v2.1.0
Published
OpenClaw plugin for Fastmail email, contacts, and calendar
Maintainers
Readme
fastmail-cli
OpenClaw plugin for Fastmail email, contacts, and calendar. Provides 36 agent tools that shell out to the fastmail CLI for token-efficient output (5-7x savings vs raw JSON). Zero runtime dependencies.
Installation
openclaw plugins install fastmail-cliPrerequisites
Remote MCP Server: Deploy the fastmail-mcp-remote Worker to Cloudflare.
Install and authenticate the CLI:
# Install globally (or use npx tsx path/to/cli/main.ts) npm install -g fastmail-cli # Authenticate (opens browser for Cloudflare Access login) fastmail auth --url https://your-worker.example.com --team myteamCredentials are stored at
~/.config/fastmail-cli/config.json(Bearer token, 30-day TTL).Verify:
fastmail auth statusshould show your user and token expiry.
Configuration
All fields are optional:
| Key | Default | Description |
|-----|---------|-------------|
| cliCommand | "fastmail" | Path or alias for the fastmail CLI binary |
The CLI handles all authentication. No credentials are needed in the plugin config.
Tools
Email Read (11 tools, always available)
fastmail_inbox- Recent inbox emailsfastmail_get_email- Read a single emailfastmail_search_emails- Search with text and filters (sender, date, unread, etc.)fastmail_get_thread- Conversation threadfastmail_list_mailboxes- List mailboxesfastmail_get_mailbox_stats- Mailbox statisticsfastmail_get_account_summary- Account overviewfastmail_list_identities- Sending identitiesfastmail_get_attachments- Email attachmentsfastmail_download_attachment- Download attachmentfastmail_get_inbox_updates- Incremental sync
Email Write (3 tools, optional)
fastmail_send_email- Send emailfastmail_create_draft- Create draftfastmail_reply_to_email- Reply to email
Email Organize (6 tools, optional)
fastmail_mark_read- Mark as readfastmail_mark_unread- Mark as unreadfastmail_flag- Flag (star)fastmail_unflag- Unflag (unstar)fastmail_delete- Delete (trash)fastmail_move- Move to mailbox
Email Bulk (6 tools, optional)
fastmail_bulk_read- Bulk mark readfastmail_bulk_unread- Bulk mark unreadfastmail_bulk_flag- Bulk flagfastmail_bulk_unflag- Bulk unflagfastmail_bulk_delete- Bulk deletefastmail_bulk_move- Bulk move
Contacts (3 tools, always available)
fastmail_list_contacts- List contactsfastmail_get_contact- Contact detailsfastmail_search_contacts- Search contacts
Calendar (4 tools, 3 always + 1 optional)
fastmail_list_calendars- List calendarsfastmail_list_events- List eventsfastmail_get_event- Event detailsfastmail_create_event- Create event (optional)
Memos (3 tools, 1 always + 2 optional)
fastmail_get_memo- Get memo on emailfastmail_create_memo- Add memo (optional)fastmail_delete_memo- Delete memo (optional)
Architecture
Agent -> OpenClaw Plugin -> execFile(fastmail, args) -> CLI -> MCP SDK -> Remote Worker -> Fastmail JMAPThe plugin is a thin adapter layer:
- Registers OpenClaw tools with JSON Schema parameters
- On tool call, spawns
fastmail <command> [args]viaexecFile(no shell, no injection risk) - Returns the CLI's compact text output directly as the tool response
- CLI handles MCP connection, auth, and formatting
Zero runtime dependencies. The CLI must be installed and authenticated separately.
Upgrading from v1.x
v2.0 replaces the in-process MCP SDK with CLI shelling. The workerUrl and bearerToken config fields are removed.
Install and authenticate the CLI (if not already):
fastmail auth --url https://your-worker.example.com --team myteamRemove old config: Delete
workerUrlandbearerTokenfrom your OpenClaw workspace plugin settings.Verify:
fastmail auth statusshould show your user and token expiry.
That's it — all 36 tools work identically, just backed by the CLI now.
Development
# Clone the repo
git clone https://github.com/omarshahine/fastmail-mcp-remote.git
cd fastmail-mcp-remote/openclaw-plugin
# Type check (no build step needed)
npx tsc --noEmit
# Local test (symlink into OpenClaw extensions)
ln -s $(pwd) ~/.openclaw/extensions/fastmail-cliLicense
MIT
