tiny MCP to let Claude send mail over JMAP
Find a file
2026-07-12 18:40:38 +02:00
fastmail-send-mcp.mjs initial commit 2026-07-12 18:40:38 +02:00
flake.lock initial commit 2026-07-12 18:40:38 +02:00
flake.nix initial commit 2026-07-12 18:40:38 +02:00
README.md initial commit 2026-07-12 18:40:38 +02:00

fastmail-send-mcp

A tiny stdio MCP server that exposes one tool, send_email, which sends mail immediately through the Fastmail JMAP API. It exists to complement the official Fastmail MCP, which (deliberately) only drafts.

Zero dependencies — plain Node (18+, needs global fetch), newline-delimited JSON-RPC over stdin/stdout.

Auth

The server reads FASTMAIL_API_TOKEN from its environment; it never handles secrets itself, on the assumption that an MCP proxy injects the token. Create the token at Fastmail → Settings → Privacy & Security → API tokens, with the Email and Email Submission scopes.

Optional: FASTMAIL_SESSION_URL overrides the JMAP session endpoint (defaults to https://api.fastmail.com/jmap/session).

Running

FASTMAIL_API_TOKEN=fmu1-... node fastmail-send-mcp.mjs

Example proxy/client config:

{
  "mcpServers": {
    "fastmail-send": {
      "command": "node",
      "args": ["/home/deprekated/Projects/home/fastmail-send-extension/fastmail-send-mcp.mjs"],
      "env": { "FASTMAIL_API_TOKEN": "<injected by proxy>" }
    }
  }
}

The tool

send_email arguments:

field required notes
to yes array of a@b.com or Name <a@b.com>
subject yes
body one of plain-text body
html one of HTML body; may be combined with body for multipart/alternative
cc, bcc no same format as to
from no must match one of the account's identities; defaults to the primary identity
inReplyTo no Message-ID being replied to, for threading

On success the sent message is filed into the Sent mailbox with $draft cleared. Failures (bad identity, rejected submission, API errors) come back as tool errors with the JMAP error type and description.