Get the FREE Ultimate OpenClaw Setup Guide →

jmap

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio wyattjoh-jmap-mcp deno run --allow-net --allow-env --watch src/mod.ts \
  --env JMAP_ACCOUNT_ID="OPTIONAL_ACCOUNT_ID" \
  --env JMAP_SESSION_URL="https://example.com/jmap/session" \
  --env JMAP_BEARER_TOKEN="YOUR_BEARER_TOKEN"

How to use

This MCP server provides a complete JMAP client interface for interacting with a JMAP-compliant email server. Built with Deno and leveraging the jmap-jam client library, it exposes tools to search, retrieve, and manage emails and mailboxes, as well as compose and reply to messages. You can perform actions like searching emails with text or filters, getting specific emails or threads, marking read/unread or flagged states, moving or deleting messages, and sending or replying to emails. The server emphasizes RFC 8620/8621 compliance, input validation, pagination, and robust error handling.

To use it, deploy the MCP server (see installation steps) and configure a MCP agent to connect to it. The agent will expose a set of tools mapping to JMAP operations (e.g., search_emails, get_emails, get_mailboxes, get_threads, mark_emails, move_emails, delete_emails, send_email, reply_to_email). Each tool accepts a structured set of parameters (as described in the README) and returns JMAP results, including IDs, mailbox information, thread data, and message payloads. Ensure you provide a valid JMAP_SESSION_URL and a Bearer token so the server can authenticate to your JMAP provider.

The server also supports environment-based configuration, enabling secure handling of credentials and account-scoped access. When starting the server, supply the required environment variables and adjust any limits for pagination or property selection if needed.

How to install

Prerequisites:

  • Install Deno v1.40 or later
  • Access to a JMAP-compatible email server (e.g., Cyrus IMAP, Stalwart Mail Server, FastMail)
  • Valid JMAP authentication credentials

Installation steps:

  1. Install Deno (if not already installed)
  2. Clone or download the MCP server repository containing this JMAP MCP server (wyattjoh-jmap-mcp)
  3. Navigate to the project directory
  4. Start the server with appropriate environment variables
    • Example using the provided mcp_config configuration:
# Basic run with environment values for a JMAP session
JMAP_SESSION_URL="https://api.example.com/jmap/session" \
JMAP_BEARER_TOKEN="YOUR_BEARER_TOKEN" \
JMAP_ACCOUNT_ID="OPTIONAL_ACCOUNT_ID" \
deno run --allow-net --allow-env --watch src/mod.ts
  1. Integrate with your MCP agent by adding the corresponding mcpServers entry in your agent configuration (see the example in the README's Setup section).

Additional notes

Tips and considerations:

  • Ensure the Deno process has network access to the JMAP server and to the JMAP session URL.
  • Use --watch during development for automatic reloads; switch to a production-friendly flag or a process manager in production.
  • Safeguard credentials by using environment variables rather than hard-coding secrets.
  • If you encounter token expiration issues, consider implementing token refresh logic at the JMAP layer or ensure your bearer token rotation is reflected in the env vars.
  • Review pagination defaults (50 results per page, etc.) and adjust via the MCP tool parameters when querying large mailboxes.
  • Validate edge cases with large mailboxes, nested folders, and threads to ensure robust pagination and error handling.

Related MCP Servers

Sponsor this space

Reach thousands of developers