freshcrate
Skin:/
Home > MCP Servers > jmap-mcp

jmap-mcp

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.

Why this rank:Strong adoptionRelease freshnessHealthy release cadence

Description

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.

README

JMAP MCP Server

JSR JSR Score JSR Scope

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 @htunnicliff/jmap-jam client library.

Features

Email Management Tools

  • Search Emails: Search emails with text queries, sender/recipient filters, date ranges, and keywords. All filters are AND'd together.
  • Get Emails: Retrieve specific emails by ID with configurable property selection
  • Get Threads: Retrieve email threads (conversation chains)
  • Mark Emails: Mark emails as read/unread, flagged/unflagged
  • Move Emails: Move emails between mailboxes
  • Delete Emails: Delete emails permanently

Mailbox Management

  • Get Mailboxes: List all mailboxes/folders with hierarchy support. Use this to find mailbox IDs needed by other tools.

Incremental Sync

  • Get Email Changes: Get IDs of emails created, updated, or destroyed since a previous state (state-based delta tracking)
  • Get Search Updates: Get additions/removals within a previous search query since its last queryState

Email Composition

  • Send Email: Compose and send new emails with support for plain text and HTML
  • Reply to Email: Reply to existing emails with automatic header handling and reply-all support

Key Capabilities

  • Full JMAP RFC 8620/8621 compliance via jmap-jam
  • Comprehensive input validation with Zod schemas
  • Pagination support for all list operations
  • State-based incremental sync for efficient polling
  • Rich error handling and connection management
  • Capability-based tool registration (read-only, submission)
  • TypeScript support with strong typing

Installation

Claude Code Plugin (Recommended)

Install via the plugin marketplace:

/plugin marketplace add wyattjoh/claude-code-marketplace
/plugin install jmap-mcp@wyattjoh-marketplace

Then configure the required environment variables in your MCP server settings.

Prerequisites

  • Deno v1.40 or later
  • A JMAP-compliant email server (e.g., Cyrus IMAP, Stalwart Mail Server, FastMail)
  • Valid JMAP authentication credentials

Setup

Add the following to your agent of choice:

{
  "mcpServers": {
    "jmap": {
      "type": "stdio",
      "command": "deno",
      "args": [
        "run",
        "--allow-net=api.fastmail.com",
        "--allow-env=JMAP_SESSION_URL,JMAP_BEARER_TOKEN,JMAP_ACCOUNT_ID",
        "jsr:@wyattjoh/jmap-mcp@0.6.1"
      ],
      "env": {
        "JMAP_SESSION_URL": "https://api.fastmail.com/jmap/session",
        "JMAP_BEARER_TOKEN": "YOUR_API_TOKEN"
      }
    }
  }
}

Replace api.fastmail.com in --allow-net with your JMAP server's hostname if not using FastMail.

Usage

Environment Variables

Variable Required Description
JMAP_SESSION_URL Yes JMAP server session URL (usually ends with /.well-known/jmap)
JMAP_BEARER_TOKEN Yes Bearer token for authentication
JMAP_ACCOUNT_ID No Account ID (auto-detected if not provided)

Available Tools

get_mailboxes

List mailboxes/folders with their IDs, names, and metadata. Call this first to get mailbox IDs needed by search_emails (inMailbox) and move_emails (mailboxId). Common names: Inbox, Drafts, Sent, Trash, Archive, Spam/Junk.

Parameters:

  • parentId (optional): Filter by parent mailbox ID
  • limit (optional): Max results (1-200, default: 100)
  • position (optional): Starting position for pagination

search_emails

Search emails with filters. All filters are AND'd together. Returns only email IDs — use get_emails to fetch content. Results include queryState for incremental sync via get_search_updates.

Parameters:

  • query (optional): Text search across all fields
  • body (optional): Search in message body only
  • from (optional): Filter by sender email address
  • to (optional): Filter by recipient email address
  • subject (optional): Filter by subject text
  • inMailbox (optional): Mailbox ID to search within (get from get_mailboxes)
  • hasKeyword (optional): Filter by keyword (e.g., $seen, $flagged)
  • notKeyword (optional): Exclude by keyword (e.g., $seen, $draft)
  • allInThreadHaveKeyword (optional): All emails in thread must have keyword
  • someInThreadHaveKeyword (optional): At least one email in thread must have keyword
  • before (optional): Only emails before date (ISO 8601 datetime)
  • after (optional): Only emails after date (ISO 8601 datetime)
  • limit (optional): Max results (1-100, default: 50)
  • position (optional): Starting position for pagination (default: 0)

get_emails

Retrieve specific emails by their IDs. Use properties to request only what you need — fetching all properties returns large payloads.

Parameters:

  • ids: Array of email IDs (1-50 IDs)
  • properties (optional): Specific properties to return. Recommended sets:
    • Summary: ["id", "subject", "from", "to", "receivedAt", "preview"]
    • Full read: ["id", "subject", "from", "to", "cc", "receivedAt", "bodyValues", "textBody", "htmlBody"]
    • Note: To get body content, include bodyValues AND textBody/htmlBody

get_threads

Get email threads by their IDs. Thread IDs come from get_emails responses (threadId property). Returns email IDs per thread — use get_emails on those IDs to fetch content.

Parameters:

  • ids: Array of thread IDs (1-20 IDs)

get_email_changes

Get IDs of emails created, updated, or destroyed since a previous state. Use the state string from a get_emails response.

Parameters:

  • sinceState: State string from a previous get_emails response
  • maxChanges (optional): Max changes to return (1-500)
  • fetchEmails (optional): Auto-fetch full email details for changed IDs (default: false)
  • properties (optional): Properties to fetch when fetchEmails is true

get_search_updates

Get changes within a previous search query since its queryState. Must use the same filter parameters as the original search_emails call.

Parameters:

  • sinceQueryState: queryState from a previous search_emails response
  • All filter parameters from search_emails (must match original query)
  • maxChanges (optional): Max changes to return (1-500)

mark_emails

Mark emails as read/unread or flagged/unflagged.

Parameters:

  • ids: Array of email IDs (1-100 IDs)
  • seen (optional): Mark as read (true) or unread (false)
  • flagged (optional): Mark as flagged (true) or unflagged (false)

move_emails

Move emails to a different mailbox. Use get_mailboxes to find the target mailbox ID.

Parameters:

  • ids: Array of email IDs (1-100 IDs)
  • mailboxId: Target mailbox ID (get from get_mailboxes)

delete_emails

Delete emails permanently (cannot be undone). Prefer moving to Trash via move_emails for recoverable deletion.

Parameters:

  • ids: Array of email IDs (1-100 IDs)

send_email

Send a new email. Requires either textBody or htmlBody (or both).

Parameters:

  • to: Array of recipients (name optional, email required)
  • cc (optional): Array of CC recipients
  • bcc (optional): Array of BCC recipients
  • subject: Email subject
  • textBody (optional): Plain text body
  • htmlBody (optional): HTML body
  • identityId (optional): JMAP identity ID to send from (uses server default if omitted)

reply_to_email

Reply to an existing email. Automatically sets To/CC, Re: subject prefix, and threading headers (In-Reply-To, References).

Parameters:

  • emailId: ID of email to reply to
  • replyAll (optional): Include all original recipients (default: false)
  • subject (optional): Custom reply subject (defaults to Re: <original>)
  • textBody (optional): Plain text body
  • htmlBody (optional): HTML body
  • identityId (optional): JMAP identity ID to send from (uses server default if omitted)

JMAP Server Compatibility

This server should work with any JMAP-compliant email server, including:

Development

Running in Development

just watch          # Run with file watching
just start          # Run without watching

Testing

just test           # Run all tests
just check          # Format check + lint + type check
just fmt            # Auto-format code

Architecture

The server is built using:

Security

  • All input is validated using Zod schemas
  • Environment variables are used for sensitive configuration
  • No secrets are logged or exposed in responses
  • Follows JMAP security best practices

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes following the functional programming style
  4. Test your changes thoroughly
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Related Projects

Release History

VersionChangesUrgencyDate
jmap-mcp-v0.6.4## [0.6.4](https://github.com/wyattjoh/jmap-mcp/compare/jmap-mcp-v0.6.3...jmap-mcp-v0.6.4) (2026-04-24) ### Bug Fixes * set fetchTextBodyValues/fetchHTMLBodyValues flags in Email.get calls ([f97a681](https://github.com/wyattjoh/jmap-mcp/commit/f97a681ec01c27898038a5b0ccedd9a6a894fd84)) * set fetchTextBodyValues/fetchHTMLBodyValues in Email.get calls ([20dd4c9](https://github.com/wyattjoh/jmap-mcp/commit/20dd4c94d7951a67daf08ea2a64d7565c868b0f4))High4/27/2026
jmap-mcp-v0.6.3## [0.6.3](https://github.com/wyattjoh/jmap-mcp/compare/jmap-mcp-v0.6.2...jmap-mcp-v0.6.3) (2026-04-21) ### Performance Improvements * use compact JSON output to reduce token usage ([d97c6c4](https://github.com/wyattjoh/jmap-mcp/commit/d97c6c4b2a66d4942678a8e291239a72bd52be0e)) * use compact JSON output to reduce token usage ([f08c2fa](https://github.com/wyattjoh/jmap-mcp/commit/f08c2fadea348c0f9eec50408af966ad0e57a082))High4/21/2026
jmap-mcp-v0.6.2## [0.6.2](https://github.com/wyattjoh/jmap-mcp/compare/jmap-mcp-v0.6.1...jmap-mcp-v0.6.2) (2026-04-13) ### Bug Fixes * add calculateTotal to JMAP query calls for reliable pagination ([5c85248](https://github.com/wyattjoh/jmap-mcp/commit/5c85248511cbbc4ae097a1e215e43cba1fead8ca)) * add calculateTotal to JMAP query calls for reliable pagination ([356406c](https://github.com/wyattjoh/jmap-mcp/commit/356406ca84b1e9a1de33d54ce9e1d23e798b92d9))High4/13/2026
jmap-mcp-v0.6.1## [0.6.1](https://github.com/wyattjoh/jmap-mcp/compare/jmap-mcp-v0.6.0...jmap-mcp-v0.6.1) (2026-04-06) ### Bug Fixes * add required type and title fields to userConfig entries ([1c5d60c](https://github.com/wyattjoh/jmap-mcp/commit/1c5d60cde183bda50505365107d602ff4f9e5392))High4/6/2026
jmap-mcp-v0.6.0## [0.6.0](https://github.com/wyattjoh/jmap-mcp/compare/jmap-mcp-v0.5.0...jmap-mcp-v0.6.0) (2026-04-06) ### Features * add userConfig for JMAP credentials in plugin manifest ([cdc352f](https://github.com/wyattjoh/jmap-mcp/commit/cdc352f16c02300b36bb7c883a6da84bf3f92a79))Medium4/6/2026
jmap-mcp-v0.5.0## [0.5.0](https://github.com/wyattjoh/jmap-mcp/compare/jmap-mcp-v0.4.0...jmap-mcp-v0.5.0) (2026-04-05) ### Features * add Claude Code plugin with marketplace auto-publishing ([bfcc71d](https://github.com/wyattjoh/jmap-mcp/commit/bfcc71d03dc78ed34edf13d4596dc248b2cd7a30)) ### Bug Fixes * add explicit type annotations to tool callback parameters ([79c13b4](https://github.com/wyattjoh/jmap-mcp/commit/79c13b481ab017e9b7f2aaf067d2c2238e1ca528))Medium4/5/2026
jmap-mcp-v0.4.0## [0.4.0](https://github.com/wyattjoh/jmap-mcp/compare/jmap-mcp-v0.3.0...jmap-mcp-v0.4.0) (2026-04-05) ### Features * Add incremental email sync tools ([e28eafc](https://github.com/wyattjoh/jmap-mcp/commit/e28eafcc83372d627f551c4938859627991ebb4c)) * add incremental email sync tools (get_email_changes, get_search_updates) ([ace0f56](https://github.com/wyattjoh/jmap-mcp/commit/ace0f5622b75f32720ce734241e9cb93149ebcca)) * improve search_emails pagination clarity for AI agents ([da02d78](https:Medium4/5/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

Perplexity-Comet-MCPNo descriptionmain@2026-06-07
google-workspace-mcp-with-scriptNo descriptionmain@2026-06-07
scagent🔍 Discover security flaws and improve code quality with ShenCha, an AI-powered autonomous code audit agent designed for developers.main@2026-06-07
claude-blockerđŸ›Ąī¸ Block distracting websites when Claude Code is in use, ensuring focused work sessions and minimizing interruptions.main@2026-06-07
any-api🚀 Seamlessly route requests between multiple LLM APIs using a unified gateway on Cloudflare Workers for efficient development and integration.main@2026-06-07

More in MCP Servers

PlanExeCreate a plan from a description in minutes
agentroveYour own Claude Code UI, sandbox, in-browser VS Code, terminal, multi-provider support (Anthropic, OpenAI, GitHub Copilot, OpenRouter), custom skills, and MCP servers.
ProxmoxMCP-PlusEnhanced Proxmox MCP server with advanced virtualization management and full OpenAPI integration.
node9-proxyThe Execution Security Layer for the Agentic Era. Providing deterministic "Sudo" governance and audit logs for autonomous AI agents.