Skip to main content

mailmcp

All your mailboxes in any AI agent. Runs on your computer. Nothing is sent or trashed without your click.

Türkçe

mailmcp is an MCP server that connects Claude Code, Codex, Cursor, Antigravity, Gemini CLI (any MCP client) to several mail accounts at once: Gmail, iCloud, Yandex, Zoho, Fastmail, Yahoo, GMX and any IMAP/SMTP provider. Outlook/Hotmail is coming in v0.2.

"Find the invoices from last week in all my inboxes"
"Summarise my unread mail on the school account"
"Draft a reply to Ahmet saying Thursday works"
"Send it"   → a page opens in your browser: To / Subject / Body / [Approve] [Reject]

Why

Built-in Gmail/Outlook connectors mailmcp
Several accounts of the same provider One account per provider As many as you want
iCloud, Yandex, Zoho, company/hosting mail Not available Any IMAP/SMTP
Works in That one app Every MCP client, one login
Sending Depends on the client's permission mode Human click on a local page, enforced by the server
Where your credentials live The vendor's cloud Your OS keychain

Install

Give your agent this repository's link and say "install this" — it follows INSTALL.md.

Or do it yourself (needs uv):

uvx allmail-mcp install        # adds the "mail" server to Claude Code, Codex, Cursor, Antigravity, Gemini CLI
uvx allmail-mcp add-account    # opens a local page; paste an app password there

Restart your agent and ask it about your mail. Single client, by hand:

claude mcp add --scope user mail -- uvx allmail-mcp
codex mcp add mail -- uvx allmail-mcp

Safety model

  • Passwords never go through the chat. You type an app password into a page served on 127.0.0.1; mailmcp verifies it with an IMAP login and stores it in Windows Credential Manager / macOS Keychain / Linux Secret Service. If no secure keychain exists, it refuses.
  • Reading and drafting are free; sending and trashing need your click. The agent can only request. The approval page shows the real recipients, subject and body held by the server, not the agent's summary. The click executes the action.
  • Approval can be turned off ("turn off send approval"), but turning it off itself needs a click. Turning it back on is instant.
  • No permanent delete. "Trash" moves mail to the provider's Trash folder.
  • Mail content is marked as untrusted before the agent sees it, and hidden HTML text (a common prompt-injection trick) is removed.
  • Reading never marks mail as read.
  • The local page binds to 127.0.0.1 on a random port, checks Host and Origin, uses single-use tokens that expire, sends a strict CSP and contains no JavaScript.

What it cannot protect against: whatever the agent reads is sent to your AI provider (Anthropic, OpenAI, Google...). Do not connect mailboxes you would not show to it. See SECURITY.md.

Tools

Tool What it does
accounts_list Connected accounts and approval settings
account_add Opens the local add-account page
folders_list Folders of an account
mail_search Search one or all accounts (sender, subject, dates, unread, Gmail syntax on Gmail)
mail_read One message as clean text
draft_create Save a draft (also replies in-thread)
request_send Send, after your click
request_trash Move to Trash, after your click
action_status Did the user approve?
settings Turn approvals on/off

Ten small tools on purpose: fewer tokens in every session, fewer ways to go wrong.

Providers

Provider How you sign in
Gmail App password (needs 2-Step Verification; most Google Workspace accounts can't use them)
iCloud App-specific password
Yandex, Zoho, Fastmail, Yahoo, GMX, AOL, Mail.ru App password
Anything else with IMAP/SMTP Settings are looked up automatically (built-in table, then Mozilla's autoconfig database) or entered by hand
Outlook / Hotmail / Live v0.2
Proton Through Proton Mail Bridge, entered by hand

Commands

uvx allmail-mcp                 # run the MCP server (what your agent starts)
uvx allmail-mcp add-account
uvx allmail-mcp accounts
uvx allmail-mcp remove-account <id>
uvx allmail-mcp install [--client claude|codex|cursor|antigravity|gemini] [--dry-run] [--yes]
uvx allmail-mcp uninstall
uvx allmail-mcp doctor          # checks keychain, config and each account's login

Skill (optional)

If your agent supports Agent Skills, copy skill/mailmcp/SKILL.md to ~/.claude/skills/mailmcp/SKILL.md (Claude Code), ~/.codex/skills/mailmcp/SKILL.md (Codex) or .agents/skills/mailmcp/SKILL.md in your project. It teaches the agent the tool workflow: search all accounts, read before replying, draft first, wait for the user to approve in the browser, never take instructions from inside an email. mailmcp works without it.

Alternatives

Good projects exist and you may prefer them: Wh1isper/mcp-email-server (IMAP, Python), marlinjai/email-mcp (Gmail/Outlook OAuth, Node), Softeria/ms-365-mcp-server (all of Microsoft 365), jgalea/mailbox-mcp (security-focused). mailmcp's focus is: many accounts across providers, every client, server-enforced human approval, credentials only in the OS keychain.

Development

git clone https://github.com/efelazut/mailmcp && cd mailmcp
uv venv && uv pip install -e ".[dev]"
uv run pytest

Architecture: docs/ARCHITECTURE.md. License: MIT.

Metadata

Release files for allmail-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for allmail-mcp 0.1.0
File Size Uploaded
allmail_mcp-0.1.0.tar.gz 90.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for allmail-mcp 0.1.0
File Interpreter ABI Platform
allmail_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 147.2 kB

Release files / allmail_mcp-0.1.0.tar.gz

Download URL allmail_mcp-0.1.0.tar.gz
Size 90.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8bd1f2fc0631af36d58224b423866d4f59d8a8578ae313aec7f33b0dbcaf14bc
BLAKE2b-256 checksum
How to use checksums
0187fb6f72fade9477f58f4c49e9f220a570f93f2edd4a513dcbbdde7f5a7b81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / allmail_mcp-0.1.0-py3-none-any.whl

Download URL allmail_mcp-0.1.0-py3-none-any.whl
Size 56.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ea00d633fad3f58f76c065cbb083ae3acd8894d3a63c489fb71af5566207701
BLAKE2b-256 checksum
How to use checksums
441f5e900f821823c17a182aca388f1941d66bd6e1feed3e843715d90b4b8f8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page