
Mail MCP Server
io.github.igorolvPublished by GitHub account igorolvv0.1.1Updated Nov 14, 2026
Read-only mail for AI agents: on-premises Exchange and any IMAP mailbox, with attachment search
Overview
Read-only MCP server that syncs on-premises Exchange (EWS) or IMAP mailboxes to a local searchable copy so an assistant can search and read mail and…
- What you can do
- List configured mailboxes, folders and paged message cards
- Sync a mailbox on request and check sync progress
- Search messages full-text with word forms, sender, folder and date filters
- Read message headers, bodies in chunks and attachment text
- Summarize senders by address or domain and follow conversations across folders
- When to use it
- Useful when an assistant should answer questions from a real mailbox — finding letters on a topic, reading attachments such as PDFs or Office files, following a thread, or reviewing mail from a period — especially with on-premises Exchange that has no Graph access.
- Requirements
- Runs locally over stdio; needs JDK 25 and pandoc 3.x on PATH (or the Docker image, which still needs pandoc). Mailbox entries go in a connections file with EWS or IMAP host, username and a password source: Windows Credential Manager, a password command, an environment variable such as MAIL_GMAIL_PASSWORD, or a literal password. Network access to the mail server for sync.
Installation
In SourceWeft
- Open Mail MCP Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Mail MCP Server
[CI] [Release] [License] [Java 25] [MCP] [Glama score] [Listed on mcpservers.org]
Give your AI agent your whole mailbox, including on-premises Exchange, with no way to change it.
MCP server (stdio) for on-premises Microsoft Exchange over EWS and any IMAP mailbox with password sign-in, tested on Mail.ru and Gmail. It downloads every message once, converts bodies and attachments to Markdown on your machine, builds a Lucene search index, and answers the agent from that copy, so text inside PDF, Office and ZIP attachments is searchable in Russian and English.
Status: version 0.1.1 is published. Checked end to end on Exchange 2013 (about 8
thousand messages), Mail.ru (about 34 thousand) and Gmail with an app password. Developed and
tested on Windows.
Contents: Features · How it works · Typical Scenarios · Quickstart · MCP Tools · Commands · Build · Stack · Documentation · License
Features
- Works with on-premises Exchange. EWS with NTLM and your normal domain password, tested on Exchange 2013. No Microsoft Graph needed. Other mailboxes work over IMAP, tested on Mail.ru and Gmail.
- Attachments are searchable too. Text from PDF, Word, Excel, PowerPoint, ZIP archives,
attached emails, Outlook
.msgandwinmail.datis extracted and indexed, so the agent can find the contract inside the attachment, not just the message that carried it. - Search that understands word forms. Russian and English, across subject, body, addresses and attachments. Copies of one message appear once, and conversations are followed across folders (search).
- Cannot change your mailbox. Read-only is enforced at the protocol level: write commands are rejected before they are sent, and downloading a message does not mark it as read (security).
- Careful with your account. One sign-in per sync and no retries. After a rejected password, it stops trying until you fix it, which reduces the risk of a domain lockout.
- Fast, and works offline. The agent reads a local copy, so answers don't depend on the mail server. Sync runs only when you ask for it.
- Your mail stays on your machine. No cloud service of its own: conversion and indexing are local, and the local copy is unfiltered. Your AI client still sees what the tools return, and an optional secret filter masks passwords and codes in responses.
- Several mailboxes, one server. Passwords can stay out of the config, in Windows Credential Manager, a password manager or an environment variable (connections).
How it works
- Download all mail. The
synctool copies the included folders of each mailbox as original.emlfiles, then only changes on later runs. - Convert it locally to Markdown. Bodies and attachments — PDF, Office documents, archives, attached messages — are converted with pandoc (required), PDFBox and Apache POI.
- Index it. A Lucene index per mailbox with Russian and English word forms.
- Use it from MCP. Tools search and read the local copy only; they never contact a mail server.
Typical Scenarios
The agent picks the tools itself; these are the chains it usually follows.
Quickstart
1. Install JDK 25 and pandoc 3.x. Pandoc is required
and must be on PATH. Check in a new terminal:
2. Get the jar: download mail-mcp-server.jar from the
latest release, or build it yourself:
No local JDK or pandoc? Use the Docker image ghcr.io/igorolv/mail-mcp-server instead, with fewer
ways to store passwords: see Docker. To skip the manual download and the
JDK, but not pandoc, start the server with JBang:
jbang --quiet mail-mcp-server@igorolv/mail-mcp-server.
3. Describe your mailboxes in %USERPROFILE%\.mail-mcp-server\connections.json
(~/.mail-mcp-server/connections.json elsewhere), one entry per mailbox. Keep only the ones you
need and replace the example addresses:
Each entry shows a different password source: work reads Windows Credential Manager, mailru
runs a command that prints the password (here the macOS Keychain; 1Password, pass and others
work the same way), and gmail reads an environment variable, which must be set wherever the
server starts. A literal password works too. Which password each provider needs (domain password, Mail.ru or Gmail
app password, Gmail OAuth2) and how to store it: docs/connections.md.
4. Register the server with your MCP client, with an absolute path to the jar. Claude Code:
Other clients and environment variables: docs/clients.md. If you installed
pandoc or changed PATH while the client was running, fully restart the client.
5. Download your mail. Ask the agent: "Sync my work mailbox and tell me when it's done."
The first sync downloads the whole mailbox and can take a long time, so keep the client open. If it
stops, ask again and it continues. A password manager must be unlocked or ask in its own window,
because the server has no terminal to ask in. For a large mailbox, or to see progress in a
terminal, use mail-sync.
6. Try it. Ask the agent: "Which mailboxes can you read?" or "Find the letters about the
supply contract in work from last week."
Something went wrong: docs/troubleshooting.md.
MCP Tools
Every tool except listConnections takes a required connection argument.
Query syntax and results: docs/search.md. Arguments and limits: docs/tools-agent.md.
Commands
Offline maintenance, sign-in recovery and Gmail OAuth2 consent run in a terminal: docs/commands.md.
Build
The build needs a JDK 25 toolchain; Gradle can download one. Tests never contact a mail server:
they use loopback fakes and the synthetic data sets in testdata/. Tests that need pandoc are
skipped when it is not installed.
Stack
- Java 25, Gradle 9 with a version catalog
- Spring Boot
4.2.0-RC1, Spring AI2.1.0-RC1MCP server (stdio) - Apache HttpClient 5.6.5 (EWS with NTLM), StAX for SOAP
- Eclipse Angus Mail 2.0.5 (IMAP and MIME parsing)
- Apache Lucene 10.5.2 (index, Russian and English analysis, highlighting)
- pandoc 3.x (external process), Apache PDFBox 3.0.5, Apache POI 5.4.1
Documentation
License
This project is licensed under the Apache License, Version 2.0. Dependencies keep their own licenses: THIRD_PARTY_NOTICES.md.
Source: README.md at commit 9b77ea8
Tools
0Version history
1- v0.1.1LatestNov 14, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts

