A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Fast MCP server for handling email (IMAP and SMTP). Can for example be used with Claude Code and Claude App.
An MCP (Model Context Protocol) server that exposes common email operations as tools for LLM clients like Claude. Supports multiple named email accounts (e.g., work + Gmail) from a single server instance.
For more information, see my blog.
"Find the tax emails from my tax lawyers for 2025, and check the content and attachments to fully understand what documentation I need to provide. Please provide an action plan to get that documentation."
"Please help triage the emails in my inboxes. As per usual, flag anything that is actionable. Don't hesitate to read emails that you are uncertain about. For anything actionable, provide an action plan. For anything non-actionable, file according to the folder layout."
WARNING: This server performs real operations on your mailbox, for example moving emails around. By default it will not allow deletions and directly sending emails (this can be changed in the MCP config). The author assumes no responsibility for any loss of data or unintended consequences resulting from the use of this MCP server. Use at your own risk.
NOTE: That said, the author has been using this daily for weeks without issues.
| Tool | Description |
|---|---|
| Discovery | |
getVersion | Returns the server version |
listAccounts | List configured account names (call first to discover accounts) |
listFolders | List all mail folders (INBOX, Sent, Drafts, etc.) |
listFolderTree | Full folder hierarchy with message/unread counts |
createFolder | Create a new mail folder |
| Reading | |
listEmails | List emails in a folder with pagination. Sortable by date (default), size, or sender |
readEmail | Read the full content of a specific email. HTML bodies are converted to markdown by default |
getAttachment | Download an email attachment by name. Images are returned directly; PDFs are converted to extracted text; other types as base64 blobs |
selfTestPdf | Diagnostic: verify PDF text extraction works in this environment |
searchEmails | Search by subject, sender, or body |
getUnreadCount | Count unread emails in a folder |
getNextUnreadEmail | Get oldest unread email with all headers |
| Triage | |
triageCompact | Compact triage — from, subject, spam score, flags (start here) |
triageEmails | Full-header triage — use when compact is not enough |
| Organizing | |
moveEmail | Move a single email between folders (with optional mark-read) |
moveEmails | Batch move emails to one target folder |
batchMoveEmails | Move emails to multiple target folders in one call |
moveToSpam | Move emails to the cached spam folder |
setEmailFlags | Set any combination of seen, answered, forwarded, and flagged/starred on one or more emails |
deleteEmail | Permanently delete an email. Disabled by default — opt in via EMAIL_ALLOW_DELETION=true (see Enabling permanent deletion) |
| Spam | |
getSpamFolder | Auto-detect and cache the spam/junk folder |
setSpamFolder | Manually override the spam folder |
| Composing | |
saveDraft | Save a draft email for user review with CC/BCC (always available; preferred over send) |
sendEmail | Send an email via SMTP with CC/BCC. Disabled by default — opt in via EMAIL_ALLOW_SENDING=true (see Enabling outbound sending) |
replyEmail | Reply with proper threading headers and optional CC/BCC. Disabled by default — opt in via EMAIL_ALLOW_SENDING=true |
forwardEmail | Verbatim forward (body never enters LLM context). Disabled by default — opt in via EMAIL_ALLOW_SENDING=true |
forwardEmailWithComment | Forward with a comment prepended. Disabled by default — opt in via EMAIL_ALLOW_SENDING=true |
All tools (except listAccounts) require an account parameter — the name of the account to operate on (e.g., work, gmail).
The fastest way to get started is to download a pre-built release from the Releases page. Two options are available:
No Java installation required. Download the binary for your platform:
| Platform | File |
|---|---|
| Linux x86_64 | mcp-email-server-<version>-linux-x86_64 |
| Linux aarch64 | mcp-email-server-<version>-linux-aarch64 |
| macOS Apple Silicon | mcp-email-server-<version>-macos-aarch64 |
| Windows x86_64 | mcp-email-server-<version>-windows-x86_64.exe |
On Linux, make the binary executable: chmod +x mcp-email-server-*-linux-*
Runs on any platform with Java 21+ installed. Download mcp-email-server-<version>-runner.jar.
Then configure your MCP client (see Claude Desktop or Claude Code below).
All credentials are passed via environment variables — nothing sensitive goes in source control. The LLM never sees these variables — it only sees tool names/descriptions and the text your tools return.
Accounts are defined by convention: EMAIL_ACCOUNTS_<NAME>_IMAP_* and EMAIL_ACCOUNTS_<NAME>_SMTP_*, where <NAME> is the account name in uppercase.
| Variable pattern | Required | Default | Example |
|---|---|---|---|
EMAIL_ACCOUNTS_<NAME>_IMAP_HOST | yes | imap.gmail.com | |
EMAIL_ACCOUNTS_<NAME>_IMAP_USERNAME | yes | you@gmail.com | |
EMAIL_ACCOUNTS_<NAME>_IMAP_PASSWORD | yes | abcd efgh ijkl mnop | |
EMAIL_ACCOUNTS_<NAME>_IMAP_PORT | no | 993 | |
EMAIL_ACCOUNTS_<NAME>_IMAP_SSL | no | true | |
EMAIL_ACCOUNTS_<NAME>_SMTP_HOST | yes | smtp.gmail.com | |
EMAIL_ACCOUNTS_<NAME>_SMTP_USERNAME | yes | you@gmail.com | |
EMAIL_ACCOUNTS_<NAME>_SMTP_PASSWORD | yes | abcd efgh ijkl mnop | |
EMAIL_ACCOUNTS_<NAME>_SMTP_PORT | no | 587 | |
EMAIL_ACCOUNTS_<NAME>_SMTP_STARTTLS | no | true |
For Gmail, create an App Password.
You can define as many accounts as needed. For example, to add a work and gmail account, set environment variables for both EMAIL_ACCOUNTS_WORK_* and EMAIL_ACCOUNTS_GMAIL_*.
Permanent and outbound operations are opt-in for safety. By default the destructive/outbound tools are disabled and return an explanatory error so the LLM can tell the user what's happening and fall back to a safer alternative (moveEmail to a Trash folder, or saveDraft for the user to send manually).
| Variable | Default | Effect |
|---|---|---|
EMAIL_ALLOW_DELETION | false | Set to true to allow deleteEmail to actually delete messages. |
EMAIL_ALLOW_SENDING | false | Set to true to allow sendEmail, replyEmail, forwardEmail, and forwardEmailWithComment to actually transmit messages over SMTP. |
Equivalent system properties: -Demail.allow-deletion=true and -Demail.allow-sending=true. Restart the server after changing them.
When EMAIL_ALLOW_DELETION is unset (or false), deleteEmail is still listed (so the LLM can discover it and explain the limitation), but every invocation is rejected before any IMAP call is made. Use moveEmail to a Trash folder as the safe alternative.
When EMAIL_ALLOW_SENDING is unset (or false), the four outbound tools above all return an explanatory error and do nothing. saveDraft is unaffected — it only writes to the IMAP Drafts folder, so the LLM can still compose messages for the user to review and send manually from their mail client. This is the recommended default workflow even when sending is enabled.
Download a release (see Quick Start) or build from source.
Edit the Claude Desktop config file claude_desktop_config.json.
On Windows it is located at C:\Users\<UserName>\AppData\Roaming\Claude\claude_desktop_config.json.
On macOS it is at ~/Library/Application Support/Claude/claude_desktop_config.json.
Add the email entry to the mcpServers section. Here is an example with two accounts (work and gmail):
Using the native binary (Windows):
{
"mcpServers": {
"email": {
"command": "C:\\Users\\YourName\\path\\to\\mcp-email-server-windows-x86_64.exe",
"args": [
"-Dquarkus.mcp.server.stdio.enabled=true",
"-Dquarkus.config.locations=.",
"-Duser.dir=C:\\Users\\YourName\\claude"
],
"env": {
"EMAIL_ACCOUNTS_WORK_IMAP_HOST": "imap.example.com",
"EMAIL_ACCOUNTS_WORK_IMAP_USERNAME": "user@example.com",
"EMAIL_ACCOUNTS_WORK_IMAP_PASSWORD": "your-app-password",
"EMAIL_ACCOUNTS_WORK_SMTP_HOST": "smtp.example.com",
"EMAIL_ACCOUNTS_WORK_SMTP_USERNAME": "user@example.com",
"EMAIL_ACCOUNTS_WORK_SMTP_PASSWORD": "your-app-password",
"EMAIL_ACCOUNTS_GMAIL_IMAP_HOST": "imap.gmail.com",
"EMAIL_ACCOUNTS_GMAIL_IMAP_USERNAME": "you@gmail.com",
"EMAIL_ACCOUNTS_GMAIL_IMAP_PASSWORD": "your-gmail-app-password",
"EMAIL_ACCOUNTS_GMAIL_SMTP_HOST": "smtp.gmail.com",
"EMAIL_ACCOUNTS_GMAIL_SMTP_USERNAME": "you@gmail.com",
"EMAIL_ACCOUNTS_GMAIL_SMTP_PASSWORD": "your-gmail-app-password"
}
}
}
}
Using the uber-jar:
{
"mcpServers": {
"email": {
"command": "java",
"args": [
"-Dquarkus.mcp.server.stdio.enabled=true",
"-Dquarkus.config.locations=.",
"-Duser.dir=C:\\Users\\YourName\\claude",
"-jar",
"C:\\Users\\YourName\\path\\to\\mcp-email-server-runner.jar"
],
"env": {
"EMAIL_ACCOUNTS_WORK_IMAP_HOST": "imap.example.com",
"EMAIL_ACCOUNTS_WORK_IMAP_USERNAME": "user@example.com",
"EMAIL_ACCOUNTS_WORK_IMAP_PASSWORD": "your-app-password",
"EMAIL_ACCOUNTS_WORK_SMTP_HOST": "smtp.example.com",
"EMAIL_ACCOUNTS_WORK_SMTP_USERNAME": "user@example.com",
"EMAIL_ACCOUNTS_WORK_SMTP_PASSWORD": "your-app-password",
"EMAIL_ACCOUNTS_GMAIL_IMAP_HOST": "imap.gmail.com",
"EMAIL_ACCOUNTS_GMAIL_IMAP_USERNAME": "you@gmail.com",
"EMAIL_ACCOUNTS_GMAIL_IMAP_PASSWORD": "your-gmail-app-password",
"EMAIL_ACCOUNTS_GMAIL_SMTP_HOST": "smtp.gmail.com",
"EMAIL_ACCOUNTS_GMAIL_SMTP_USERNAME": "you@gmail.com",
"EMAIL_ACCOUNTS_GMAIL_SMTP_PASSWORD": "your-gmail-app-password"
}
}
}
}
Download a release (see Quick Start) or build from source.
Edit ~/.claude.json and add an mcpServers section. Here is an example with two accounts (work and gmail):
Using the native binary (Linux):
{
"mcpServers": {
"email": {
"command": "/path/to/mcp-email-server-linux-x86_64",
"args": [
"-Dquarkus.mcp.server.stdio.enabled=true"
],
"env": {
"EMAIL_ACCOUNTS_WORK_IMAP_HOST": "imap.example.com",
"EMAIL_ACCOUNTS_WORK_IMAP_USERNAME": "user@example.com",
"EMAIL_ACCOUNTS_WORK_IMAP_PASSWORD": "your-app-password",
"EMAIL_ACCOUNTS_WORK_SMTP_HOST": "smtp.example.com",
"EMAIL_ACCOUNTS_WORK_SMTP_USERNAME": "user@example.com",
"EMAIL_ACCOUNTS_WORK_SMTP_PASSWORD": "your-app-password",
"EMAIL_ACCOUNTS_GMAIL_IMAP_HOST": "imap.gmail.com",
"EMAIL_ACCOUNTS_GMAIL_IMAP_USERNAME": "you@gmail.com",
"EMAIL_ACCOUNTS_GMAIL_IMAP_PASSWORD": "your-gmail-app-password",
"EMAIL_ACCOUNTS_GMAIL_SMTP_HOST": "smtp.gmail.com",
"EMAIL_ACCOUNTS_GMAIL_SMTP_USERNAME": "you@gmail.com",
"EMAIL_ACCOUNTS_GMAIL_SMTP_PASSWORD": "your-gmail-app-password"
}
}
}
}
Using the uber-jar:
{
"mcpServers": {
"email": {
"command": "java",
"args": [
"-Dquarkus.mcp.server.stdio.enabled=true",
"-jar",
"/path/to/mcp-email-server-runner.jar"
],
"env": {
"EMAIL_ACCOUNTS_WORK_IMAP_HOST": "imap.example.com",
"EMAIL_ACCOUNTS_WORK_IMAP_USERNAME": "user@example.com",
"EMAIL_ACCOUNTS_WORK_IMAP_PASSWORD": "your-app-password",
"EMAIL_ACCOUNTS_WORK_SMTP_HOST": "smtp.example.com",
"EMAIL_ACCOUNTS_WORK_SMTP_USERNAME": "user@example.com",
"EMAIL_ACCOUNTS_WORK_SMTP_PASSWORD": "your-app-password",
"EMAIL_ACCOUNTS_GMAIL_IMAP_HOST": "imap.gmail.com",
"EMAIL_ACCOUNTS_GMAIL_IMAP_USERNAME": "you@gmail.com",
"EMAIL_ACCOUNTS_GMAIL_IMAP_PASSWORD": "your-gmail-app-password",
"EMAIL_ACCOUNTS_GMAIL_SMTP_HOST": "smtp.gmail.com",
"EMAIL_ACCOUNTS_GMAIL_SMTP_USERNAME": "you@gmail.com",
"EMAIL_ACCOUNTS_GMAIL_SMTP_PASSWORD": "your-gmail-app-password"
}
}
}
}
/mcp to reconnect). The email tools should appear in the tool list.Note: Unlike Claude Desktop, Claude Code does not typically need the -Duser.dir and -Dquarkus.config.locations workarounds since it launches the server from a normal working directory.
Only needed if you want to contribute or run a development build.
Prerequisites: Java 21+ and Maven 3.9+
mvn package
The uber-jar will be at target/mcp-email-server-<version>-runner.jar.
Prerequisites: GraalVM 25 with native-image, and Maven 3.9+. On Windows, Visual Studio 2022 with the "Desktop development with C++" workload is also required.
mvn package -Dnative -DskipTests
The native binary will be at target/mcp-email-server-<version>-runner (or .exe on Windows).
AccessDeniedException: C:\WINDOWS\system32\config: on Windows, Claude Desktop may launch the server with C:\WINDOWS\system32 as the working directory, causing Quarkus to fail when scanning for config files. The -Duser.dir argument in the example config overrides the working directory, and -Dquarkus.config.locations=. prevents Quarkus from scanning restricted system directories. Point -Duser.dir to any directory your user can write to.-Dquarkus.mcp.server.stdio.enabled=true is in the args before -jar.mcp-email-server.log (in the working directory), not to stdout/stderr, to avoid interfering with the STDIO transport. Check that file for errors.JAVA_HOME points to JDK 21+. The system java on PATH may differ from what Maven uses.listAccounts first to see which accounts are configured. Account names are lowercase as defined in the environment variables (e.g., work, gmail).A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots