rdh-jmap-mcp

rhalldearn/rdh-jmap-mcp

3.2

If you are the rightful owner of rdh-jmap-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The JMAP MCP Server is a Rust-based server that facilitates email management through JMAP-compatible providers using the Model Context Protocol (MCP).

Tools
9
Resources
0
Prompts
0

JMAP MCP Server

Rust-based MCP server that exposes JMAP email actions over stdio/JSON-RPC. Drop it into any MCP-aware tool to search, manage, and send mail through a JMAP-compatible provider.

Highlights

  • Mail search, retrieval, threading, move, delete, and keyword updates
  • Mailbox discovery with hierarchy awareness
  • Email composition and submission (including reply-all)
  • Capability-driven tool registration with JSON Schema metadata
  • Single static binary; no runtime dependencies beyond a JMAP server

Quick Start

  1. Install the Rust toolchain (1.75+ recommended).

  2. Build the binary:

    cargo build --release
    
  3. Point your MCP client at the resulting executable, e.g.:

    {
      "mcpServers": {
        "fastmail": {
          "type": "stdio",
          "command": "/home/richard/Projects/rdh-jmap-mcp/target/release/rdh-jmap-mcp",
          "env": {
            "JMAP_SESSION_URL": "https://api.fastmail.com/jmap/session",
            "JMAP_BEARER_TOKEN": "API_TOKEN"
          }
        }
      }
    }
    

Configuration

VariableRequiredPurpose
JMAP_SESSION_URLYesSession discovery endpoint (often /.well-known/jmap)
JMAP_BEARER_TOKENYesOAuth/Bearer token for API access
JMAP_ACCOUNT_IDNoExplicit account selection (auto-detected when omitted)

The server inspects the advertised capabilities. Write operations disappear for read-only accounts, and submission tools require urn:ietf:params:jmap:submission.

Available Tools

search_emails, get_emails, get_threads, get_mailboxes, mark_emails, move_emails, delete_emails, send_email, and reply_to_email. Each tool is described through JSON Schema surfaced to the MCP client, including parameter types, bounds, and optional fields.

Architecture

  • tokio for async stdio and HTTP
  • reqwest for JMAP calls
  • schemars for JSON Schema generation
  • Rigorous error propagation that mirrors JMAP failure details

Development

cargo run    # start in debug mode
cargo test   # run the Rust test suite

Security Notes

  • Validates tool input before issuing requests
  • Consumes credentials exclusively from environment variables
  • Avoids logging tokens or sensitive payloads
  • Adheres to JMAP security guidance

Compatibility

Tested with Stalwart; designed to work with Cyrus IMAP, Fastmail, Apache James, and any other JMAP-compliant implementation.

Contributing

Fork the repo, branch, implement, test, and open a PR. MIT licensed.

References