Skip to main content
Glama
outlook-mail-mcp

outlook-mail-mcp

by YehorMaly

outlook-mail-mcp

Local, read + draft only MCP server for Outlook / Exchange via macOS Mail.app.

Works with work and school Microsoft 365 accounts even when your organization blocks third-party Entra ID / Microsoft Graph OAuth apps ("Need admin approval"), because authentication is handled natively by Apple Mail.

Security Model

  • Pinned account: Strictly scoped to a single Mail.app account (MAIL_ACCOUNT, default Exchange) — other accounts in Mail.app (Gmail, iCloud, etc.) cannot be accessed.

  • Read + Draft only: No send, delete, or inbox-rule tools exist. Drafts are saved/opened in Mail.app for you to review and send manually.

  • No tokens on disk: Zero OAuth tokens, client secrets, or .env credentials stored by this server.

  • Injection-safe bridge: Calls osascript -l JavaScript via execFile (no shell) and passes all arguments as JSON via argv.

  • Prompt-injection hardening: Strips invisible/bidi-override Unicode characters and wraps read email bodies in === BEGIN UNTRUSTED EMAIL CONTENT === markers.

Related MCP server: Apple Mail MCP

Prerequisites

  • macOS

  • Node.js ≥ 20

  • Your Outlook/Exchange account signed into Apple Mail (System Settings → Internet Accounts → Microsoft Exchange)

Setup

git clone https://github.com/YehorMaly/outlook-mail-mcp.git
cd outlook-mail-mcp
npm install

Find your exact Mail.app account name (usually Exchange):

npm run accounts

Verify the server works end-to-end:

MAIL_ACCOUNT="Exchange" npm test

Client Configuration

Claude Desktop

  1. Run which node in Terminal to get your full Node binary path (e.g. /opt/homebrew/bin/node or /usr/local/bin/node). GUI apps on macOS often do not load .zshrc, so using the full path avoids spawn node ENOENT.

  2. Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "outlook": {
      "command": "/opt/homebrew/bin/node",
      "args": ["/ABSOLUTE/PATH/TO/outlook-mail-mcp/src/index.js"],
      "env": {
        "MAIL_ACCOUNT": "Exchange"
      }
    }
  }
}
  1. Restart Claude Desktop and click Allow when macOS asks permission to control Mail.app (System Settings → Privacy & Security → Automation).

Cursor / Antigravity / T3 Code

Add the same mcpServers.outlook block to:

  • Cursor: ~/.cursor/mcp.json

  • Antigravity: ~/.gemini/config/mcp_config.json

Codex

Add to ~/.codex/config.toml:

[mcp_servers.outlook]
command = "node"
args = ["/ABSOLUTE/PATH/TO/outlook-mail-mcp/src/index.js"]

[mcp_servers.outlook.env]
MAIL_ACCOUNT = "Exchange"

Available Tools

Tool

Description

list_mailboxes

List folders and message/unread counts in the configured account

list_emails

List recent emails (with pagination and unread_only)

search_emails

Search by query, sender, subject, date range, or body (include_body)

read_email

Read headers, attachment list, and sanitized plain-text body by ID

create_draft

Save a new draft in Mail.app (optionally opening the compose window)

create_reply_draft

Save a threaded reply / reply-all draft in Mail.app

mark_as_read

Mark a message read or unread

Limitations

  • macOS only (requires Mail.app and osascript).

  • Plain-text drafts only (Apple deprecated HTML scripting on outgoing message in Mail.app).

  • No attachment download/upload yet (read_email lists attachment names, sizes, and MIME types).

  • Body search (include_body: true) scans up to the 150 most recent candidate messages to stay within IPC timeouts.

License

MIT

Available Tools

7 tools
create_draftCreate Draft EmailA

Create and save a draft email in Mail.app under the Outlook/Exchange account. NEVER sends the email; the user reviews and sends it manually.

Inputs: cc, to, bcc, body, +2 more.

create_reply_draftCreate Reply DraftA

Create and save a properly threaded reply (or reply-all) draft to an existing email in Mail.app. NEVER sends the email; the user reviews and sends it manually.

Inputs: id (required), body, mailbox, reply_all, +1 more.

list_emailsList EmailsA
Read-onlyIdempotent

List recent emails in a mailbox (default: Inbox), newest first. Supports pagination and unread-only filtering.

Inputs: limit, offset, mailbox, unread_only.

list_mailboxesList MailboxesA
Read-onlyIdempotent

List all folders/mailboxes and message/unread counts in the configured Outlook (Exchange) account in Mail.app.

Inputs: no named parameters.

mark_as_readMark Email Read/UnreadB
Idempotent

Mark an email as read (is_read=true) or unread (is_read=false).

Inputs: id (required), is_read, mailbox.

read_emailRead EmailA
Read-onlyIdempotent

Read the full headers, attachment list, and sanitized plain-text body of a specific email by its Mail.app numeric ID.

Inputs: id (required), mailbox.

search_emailsSearch EmailsA
Read-onlyIdempotent

Search emails in a mailbox (or "all" non-trash mailboxes) by query, sender, subject, unread status, or ISO date range. Matches subject/sender fast; set include_body=true to also scan up to 150 recent bodies.

Inputs: limit, query, since, until, +5 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools target clearly distinct operations: listing mailboxes, listing emails, searching, reading one email, creating drafts (new vs. threaded reply), and toggling read state. The only mild overlap is between list_emails and search_emails, since both enumerate messages in a mailbox with unread filtering, but the query/sender/date parameters make search's purpose clear. An agent can reliably pick the right tool.

    Naming Consistency5/5

    All names are snake_case with a leading verb (list_, search_, read_, create_, mark_) followed by a clear noun or object. The pattern is predictable and readable throughout, with create_draft vs. create_reply_draft cleanly disambiguated by the noun.

    Tool Count5/5

    Seven tools is well-scoped for a read-and-draft email client. Each tool covers a distinct operation with no filler, and the surface stays small enough to reason about quickly.

    Completeness4/5

    Core workflows—discover folders, browse, search, read full content, draft new/reply messages, and manage read state—are all covered. Minor gaps remain: no move/archive/delete, no folder creation, and no attachment download (only listing), though the read-only-plus-drafts design suggests some omissions are intentional.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to search, read, and inspect Apple Mail on macOS, including conversations and attachments. It can create new, reply, reply-all, or forward drafts, but cannot send or modify existing messages.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables searching and reading email across permitted accounts and mailboxes on macOS, plus optionally saving drafts for review, without sending or deleting messages.
      5
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI clients to read, search, send and triage Microsoft 365 mail, manage folders, attachments and drafts, and work with calendar events and contacts by calling the same internal API the Outlook web app uses, with no Graph app registration or admin consent. Supports Azure CLI token refresh, a read-only mode, and compact normalized JSON output.
      40
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to read, search, organize, and draft email across all accounts configured in macOS Mail.app without passwords, API keys, or OAuth.
      MIT