Skip to main content
Glama
OxMail MCP

OxMail MCP

by tungmv

OxMail MCP

An MCP server that lets an AI agent read and send mail through an OxMail instance over its JMAP endpoint.

No browser automation, no IMAP/SMTP passwords in the repo: the server speaks JMAP (POST /jmap) with a Bearer token.

Tools

Tool

Arguments

What it does

oxmail_status

—

Signed-in identity and mailbox list

oxmail_list

folder (default INBOX), limit (1–50, default 15)

Recent messages with subject, sender, date, preview

oxmail_read

id

One message with its plain-text body

oxmail_send

to, subject, body, cc?, bcc?, attachments?, confirm?

Send mail. Dry-run unless confirm: true

oxmail_send never delivers by accident: without confirm: true it validates the payload and returns a preview.

Related MCP server: agent-jmap-mcp

Install

git clone https://github.com/tungmv/oxmail-mcp.git
cd oxmail-mcp
node server.mjs          # smoke test: prints "ready" on stderr

No dependencies; Node 20+.

Configure

Add to your MCP client (for pi, ~/.pi/agent/mcp.json; for Claude Code, claude mcp add):

{
  "mcpServers": {
    "oxmail": {
      "type": "stdio",
      "command": "node",
      "args": ["/abs/path/to/oxmail-mcp/server.mjs"],
      "env": {
        "OXMAL_BASE": "https://mail.example.com",
        "OXMAL_TOKEN": "eyJ..."
      }
    }
  }
}

Token resolution

The server looks for a Bearer token in this order:

  1. OXMAL_TOKEN

  2. ~/.config/oxmail/token (a file containing just the token, mode 600)

  3. A token captured from a logged-in OxMail tab via a local WebDriver BiDi daemon on 127.0.0.1:9444 (OXMAL_BIDI_PORT to change)

Option 3 exists because OxMail's web UI keeps its OIDC token in sessionStorage while using a fresher access token held in a module variable — so the storage copy is often expired. To capture a live one, wrap fetch in the tab and open any folder:

window.__cap = [];
const of = window.fetch;
window.fetch = function (...a) {
  try {
    const h = (a[1] && a[1].headers) || {};
    const au = h.Authorization || (h.get && h.get("Authorization")) || "";
    if (au) window.__cap.push(String(au));
  } catch (e) {}
  return of.apply(this, a);
};

Environment

Variable

Default

Meaning

OXMAL_BASE

http://localhost:8080

OxMail base URL

OXMAL_TOKEN

—

Bearer token

OXMAL_BIDI_PORT

9444

BiDi daemon port for token capture

Verified

  • oxmail_status → identity and mailboxes

  • oxmail_list INBOX/Sent → real messages with previews

  • oxmail_read → subject, from/to, body; Unicode round-trips

  • oxmail_send → returns emailId + submissionId, message appears in Sent

  • oxmail_send with attachments → file present server-side with the right name, size and disposition: attachment

Attachments

attachments takes absolute file paths. Each file is uploaded with POST /jmap/upload/{accountId} and referenced from the create payload as attachments: [{ blobId, name, type, size }].

Note the shape: this OxMail build ignores bodyStructure and silently drops parts sent that way. The working payload (matching the web UI) is:

{
  textBody: [{ partId: "1", type: "text/plain" }],
  bodyValues: { 1: { value: body } },
  attachments: [{ blobId, name, type, size }],
}

Security

  • The token is read from the environment or a 600-mode file and is never logged.

  • oxmail_send defaults to a dry run; delivering requires an explicit confirm: true.

  • Point OXMAL_BASE at a host you control.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Private, EU-hosted email for AI agents over JMAP: read, search, reply, draft, organize, send.

      https://mcp.lettio.eu/mcp
    • Give AI agents their own email inboxes: list, read and send mail via scoped, revocable OAuth grants.

      https://mcp.mailows.com/mcp
    • Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.

      https://www.primitive.dev/mcp
    • Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to manage Fastmail email accounts via JMAP, including reading, sending, organizing emails, and handling mailboxes, drafts, and masked emails.
      43
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to manage email over JMAP, including inspecting mailboxes, searching and retrieving messages, navigating threads, downloading attachments, triaging inboxes, and sending emails atomically via HTTP.
      23 PyPI
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives AI assistants OAuth-based access to mailboxes on any JMAP server, requiring only an email address and a sign-in on the mail server's own page. Enables searching, reading, threading, organizing, drafting, sending, and managing vacation replies and Sieve filters across one or more accounts.
      2
      Apache 2.0