JMAP

The JMAP MCP Server provides a set of tools for your AI agents to interact with email servers that use the JMAP protocol.

It’s built with Deno and acts as a translator that lets your agent manage emails, such as search, read, send, and organize, on services like Fastmail or a self-hosted Stalwart server.

You can use it to build automated email workflows, create AI assistants that handle your inbox, or integrate email functionality into other applications.

Features

  • 📧 Email Operations: Search emails with complex filters, fetch specific messages or entire conversation threads, and mark them as read or flagged.
  • 🗂️ Mailbox Handling: List all your email folders and understand their hierarchy.
  • ✍️ Compose & Send: Draft and send new emails, or reply to existing ones, with support for both plain text and HTML.
  • 🗑️ Email Housekeeping: Move messages between mailboxes or delete them for good.
  • ⚙️ Robust Foundation: Built on TypeScript with solid input validation, error handling, and full JMAP compliance.

Use Cases

  • Automated Inbox Triage: You could set up an agent to constantly watch your inbox. When an email arrives from a specific client, the agent uses search_emails to identify it and move_emails to file it into the correct project folder, keeping your main inbox clean.
  • AI-Powered Daily Briefing: An agent could run every morning, using search_emails to find unread messages received in the last 24 hours. It would then use get_emails to fetch their content, pass it to a language model for summarization, and send you a single “Here’s what you missed” message.
  • Actionable Email Workflows: Imagine an agent that scans for emails with subjects like “New Invoice”. It could use get_emails to pull the message body, extract the PDF attachment details (if the feature were extended), and then call another tool to add the invoice to your accounting software. This server is the piece that gets the data out of your email server.
  • Contact Management Assistant: You could build a tool that identifies when you’ve been emailing a new person frequently. The agent would use search_emails to find conversations, extract the person’s name and email, and then use a different MCP tool to see if they already exist in your contacts, adding them if they don’t.

How to Use It

1. You need Deno (version 1.40 or newer) installed and access to a JMAP-compliant email server. This could be a commercial service like FastMail or a self-hosted one like Cyrus IMAP.

2. Configure your agent by adding a new entry to its mcpServers block. This tells the agent how to run the JMAP MCP server.

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

3. The server requires a few environment variables to connect to your email account.

VariableRequiredDescription
JMAP_SESSION_URLYesThe session URL for your JMAP server.
JMAP_BEARER_TOKENYesYour authentication token or app-specific password.
JMAP_ACCOUNT_IDNoYour account ID. The server can often auto-detect this.

3. Once configured, your agent can access the following tools:

Email Management

  • search_emails: Finds emails using filters like text query, sender, recipient, subject, mailbox, keywords, and date ranges.
  • get_emails: Fetches the full content of specific emails by their IDs.
  • get_threads: Retrieves entire email conversations by their thread IDs.
  • mark_emails: Changes the status of emails, for instance, marking them as seen or flagged.
  • move_emails: Relocates emails to a different mailbox.
  • delete_emails: Permanently removes emails.

Mailbox Management

  • get_mailboxes: Lists your mailboxes or folders.

Composition

  • send_email: Composes and sends a new email.
  • reply_to_email: Sends a reply to an existing email, with a replyAll option.

FAQs

Q: What’s the point of this instead of just using a JMAP client library in my code?
A: This server standardizes the interface. By using the Model Context Protocol, you create an abstraction layer. Your agent speaks “MCP,” and the server translates that to “JMAP.” You could swap this JMAP server for a different one (say, a Microsoft Graph server for Outlook) and your agent’s core logic wouldn’t need to change. It promotes interoperability.

Q: How do I get the JMAP_BEARER_TOKEN?
A: This depends entirely on your email provider. For a service like Fastmail, you would go into your account settings under “Password & Security” and generate an “App Password” with JMAP access. For a self-hosted server, you’d follow its documentation for creating API tokens.

Q: Can I use this with my Gmail or Outlook account?
A: No, not directly. This server is specifically for email providers that support the JMAP protocol. Gmail and Outlook use their own proprietary APIs. You would need a different MCP server designed for those services.

Latest MCP Servers

Cursor n8n

Control your n8n workflows directly from Cursor IDE. This MCP server enables AI assistants to create, manage, and debug automations via the n8n API.

Apify

Connect AI assistants to 8000+ web scraping tools via Apify MCP Server. Extract social media data, contact details, and automate web research.

Blueprint

Use the Blueprint MCP Server to generate system architecture diagrams directly from your codebase using Nano Banana Pro.

View More MCP Servers >>

Featured MCP Servers

Apify

Connect AI assistants to 8000+ web scraping tools via Apify MCP Server. Extract social media data, contact details, and automate web research.

Blueprint

Use the Blueprint MCP Server to generate system architecture diagrams directly from your codebase using Nano Banana Pro.

Monday.com

Use the monday.com MCP server to connect AI agents to your Work OS. Provides secure data access, action tools, and workflow context.

More Featured MCP Servers >>

FAQs

Q: What exactly is the Model Context Protocol (MCP)?

A: MCP is an open standard, like a common language, that lets AI applications (clients) and external data sources or tools (servers) talk to each other. It helps AI models get the context (data, instructions, tools) they need from outside systems to give more accurate and relevant responses. Think of it as a universal adapter for AI connections.

Q: How is MCP different from OpenAI's function calling or plugins?

A: While OpenAI's tools allow models to use specific external functions, MCP is a broader, open standard. It covers not just tool use, but also providing structured data (Resources) and instruction templates (Prompts) as context. Being an open standard means it's not tied to one company's models or platform. OpenAI has even started adopting MCP in its Agents SDK.

Q: Can I use MCP with frameworks like LangChain?

A: Yes, MCP is designed to complement frameworks like LangChain or LlamaIndex. Instead of relying solely on custom connectors within these frameworks, you can use MCP as a standardized bridge to connect to various tools and data sources. There's potential for interoperability, like converting MCP tools into LangChain tools.

Q: Why was MCP created? What problem does it solve?

A: It was created because large language models often lack real-time information and connecting them to external data/tools required custom, complex integrations for each pair. MCP solves this by providing a standard way to connect, reducing development time, complexity, and cost, and enabling better interoperability between different AI models and tools.

Q: Is MCP secure? What are the main risks?

A: Security is a major consideration. While MCP includes principles like user consent and control, risks exist. These include potential server compromises leading to token theft, indirect prompt injection attacks, excessive permissions, context data leakage, session hijacking, and vulnerabilities in server implementations. Implementing robust security measures like OAuth 2.1, TLS, strict permissions, and monitoring is crucial.

Q: Who is behind MCP?

A: MCP was initially developed and open-sourced by Anthropic. However, it's an open standard with active contributions from the community, including companies like Microsoft and VMware Tanzu who maintain official SDKs.

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!