rhalldearn/rdh-jmap-mcp
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).
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
-
Install the Rust toolchain (1.75+ recommended).
-
Build the binary:
cargo build --release -
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
| Variable | Required | Purpose |
|---|---|---|
JMAP_SESSION_URL | Yes | Session discovery endpoint (often /.well-known/jmap) |
JMAP_BEARER_TOKEN | Yes | OAuth/Bearer token for API access |
JMAP_ACCOUNT_ID | No | Explicit 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
tokiofor async stdio and HTTPreqwestfor JMAP callsschemarsfor 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.