Stalwart Mail MCP logo

Stalwart Mail MCP

Connects AI clients to self-hosted Stalwart mailboxes for email, attachments, OCR, drafts, sending, and contacts.

Install Stalwart Mail MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "stalwart-mail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "stalwart-mail-mcp"
      ],
      "env": {
        "STALWART_URL": "YOUR_VALUE_HERE",
        "STALWART_USER": "YOUR_VALUE_HERE",
        "STALWART_PASSWORD": "YOUR_VALUE_HERE",
        "STALWART_TOKEN": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env STALWART_URL=YOUR_VALUE_HERE --env STALWART_USER=YOUR_VALUE_HERE --env STALWART_PASSWORD=YOUR_VALUE_HERE --env STALWART_TOKEN=YOUR_VALUE_HERE --transport stdio stalwart-mail-mcp -- npx -y stalwart-mail-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Automated check passed— started and listed 10 tools correctly ().

Overview

The stalwart-mail-mcp MCP server connects MCP clients to a self-hosted Stalwart mailbox through JMAP over HTTPS. It exposes tools for searching and reading messages, inspecting attachments, extracting text with optional OCR, sending mail, managing drafts, and working with contacts. Use it when an agent needs controlled access to a Stalwart mailbox through stdio or a remote HTTP deployment. Credentials can be supplied with Basic authentication or an OAuth bearer token, and write capabilities can be disabled individually.

Use cases

  • Search a self-hosted Stalwart mailbox by sender, subject, date, or thread
  • Read email attachments and extract text from scanned documents
  • Draft and send replies with files from disk
  • Look up contacts across address books and mail history
  • Restrict an agent to read-only mailbox access

Key features

  • JMAP access to self-hosted Stalwart mailboxes
  • Email search, reading, replies, and sending
  • Draft creation, sending, and deletion
  • Attachment extraction with optional OCR
  • Contact search and creation
  • Configurable write and attachment permissions

Tools10

What Stalwart Mail MCP lets your agent do. Expand a tool for its parameters.

Verified live~3.3k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

13/13 checks healthy over the last 48d

What it can do

From the 10 tools this server returned when we ran it; 10 declare their own safety hints.

Can delete or modify data · 1Makes network requests · 10Read-only tools · 9
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age32 days
Maintainers1

Observed 2026-11-04 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 4h ago via OSV.dev · stalwart-mail-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads612Package downloads in the last 30 days.
Last commit2mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed10Callable tools this server registers over MCP.

How Stalwart Mail MCP works

What the stalwart-mail-mcp MCP server does

The stalwart-mail-mcp MCP server gives an MCP-compatible client access to a mailbox hosted by Stalwart. It can list mailboxes and folders, search messages by content and metadata, retrieve complete messages, and inspect conversation threads. Message HTML is converted to text, while attachments are exposed separately.

Email actions include composing and sending new messages, replying within a thread, creating drafts, sending drafts, and deleting drafts. Contact tools search address books and people found in mail history, and can add contacts to an own or shared address book. The tool names use the mail_ prefix by default, with an option to change it.

How it works

The stdio deployment runs as a Node process launched by the MCP client. It communicates with the mailbox over HTTPS using JMAP protocols and the mailbox account's credentials. Nothing needs to be installed on the Stalwart host for this mode.

A remote mode runs the process alongside Stalwart and exposes it as a custom connector. This allows supported Claude environments, including claude.ai, mobile apps, and desktop chat, to reach the mailbox through Stalwart's OAuth sign-in flow. In that mode, the server does not retain mailbox credentials.

Attachment handling depends on the file type. Text and HTML can be returned as readable text, PDFs can be processed page by page, images are returned as images, and unsupported formats such as DOCX, XLSX, and ZIP are saved with their path returned. Scanned PDF pages and photographed documents can be sent to a configured OCR provider. OCR may use hosted services, a custom OpenAI-compatible endpoint, or local Ollama or LM Studio models.

Setup and configuration

Install the stalwart-mail-mcp MCP server from npm with npx -y stalwart-mail-mcp, or download the packaged .mcpb release for Claude Desktop. Configure STALWART_URL, STALWART_USER, and either STALWART_PASSWORD or STALWART_TOKEN. The password is sent using Basic authentication; a token uses Bearer authentication.

Optional settings control language, tool-name prefixes, branding, attachment download location, timezone, OCR provider, model, API key, and base URL. MISTRAL_API_KEY enables the Mistral shortcut for OCR. Attachment saving and OCR can be configured independently.

Capabilities that write data can be removed from the tool list with environment settings. Disable sending to prevent email transmission, disable drafts to remove draft creation and deletion, disable contact editing to prevent new contacts, and disable attachments to remove attachment retrieval. MAIL_SAVE_ATTACHMENTS=false keeps opened attachments from being written to disk.

Tools and capabilities

Available tools include:

  • mail_list_mailboxes for accounts, shared mailboxes, folders, counts, allowed senders, and address books.
  • mail_search_emails for full-text, sender, recipient, subject, folder, date, unread, attachment, and thread searches.
  • mail_get_email for retrieving a complete message and listing its attachments.
  • mail_get_attachment for reading text, PDFs, OCR results, and images, with optional file saving.
  • mail_send_email for new messages and replies with disk-based attachments.
  • mail_create_draft, mail_send_draft, and mail_delete_draft for draft workflows.
  • mail_search_contacts and mail_add_contact for contact lookup and creation.

Sending is immediate and cannot be undone, so the tool guidance requires explicit user instruction before sending and favors drafts otherwise. OCR is the only feature that sends mailbox content outside the mail server, unless a local OCR model is selected. Long scans may need page ranges when a local model exceeds the MCP client's tool timeout.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Stalwart Mail MCP

stalwart-mail-mcp is an MCP server that connects AI clients to a self-hosted Stalwart mailbox through JMAP. Its main tools search and read email, retrieve attachments with optional OCR, send messages and replies, manage drafts, and search or add contacts. It supports stdio and a remote HTTP deployment.

Install it with `npx -y stalwart-mail-mcp` in an MCP client's stdio configuration, or download the `.mcpb` release for Claude Desktop. Set `STALWART_URL`, `STALWART_USER`, and a password or OAuth token. A remote deployment can run with `--http` or the Docker image.

Enable OCR by selecting `MAIL_OCR_PROVIDER` and configuring the provider's required key, model, or base URL. Supported choices include Mistral, Anthropic, OpenAI-compatible services, OpenRouter, Gemini, Ollama, LM Studio, custom endpoints, and `off`. `MISTRAL_API_KEY` provides a shortcut for Mistral OCR.

Yes, disable sending, drafts, and contact editing with `MAIL_ALLOW_SEND=false`, `MAIL_ALLOW_DRAFTS=false`, and `MAIL_ALLOW_CONTACT_EDIT=false`. Disable attachment access with `MAIL_ALLOW_ATTACHMENTS=false`, or prevent files from being written while retaining reads with `MAIL_SAVE_ATTACHMENTS=false`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewStalwart Mail MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/stalwart-mail-mcp?style=directory)](https://allmcps.com/mcp/stalwart-mail-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/stalwart-mail-mcp"><img src="https://allmcps.com/api/badge/stalwart-mail-mcp?style=directory" alt="Stalwart Mail MCP on AllMCPs" /></a>