Microsoft Outlook MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to interact with Microsoft Outlook email and calendar through the Microsoft Graph API.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
A Model Context Protocol (MCP) server that enables AI assistants to interact with Microsoft Outlook email and calendar through the Microsoft Graph API.
MCP server for Microsoft Office 365 Outlook – email, calendar & SharePoint integration for Claude, ChatGPT, and AI assistants via Microsoft Graph API
Choose your installation method:
Prerequisites: Before installing, you'll need to set up an Azure application to get your Client ID and Tenant ID.
For Claude Desktop users, DXT extensions provide the simplest installation experience.
Option 1: Download Pre-built Extension
outlook-mcp.dxt from the Releases page.dxt fileOption 2: Build from Source
git clone https://github.com/XenoXilus/outlook-mcp.git
cd outlook-mcp
npm install
npm install -g @anthropic-ai/dxtdxt pack . outlook-mcp.dxt
.dxt file in Claude Desktop as aboveFor CLI-based MCP clients (Claude Code, mcp CLI, etc.), configure the server directly.
1. Clone and Install:
git clone https://github.com/XenoXilus/outlook-mcp.git
cd outlook-mcp
npm install
2. Configure your MCP client:
Add the following to your MCP servers configuration (location varies by client):
{
"outlook-mcp": {
"command": "node",
"args": ["/absolute/path/to/outlook-mcp/server/index.js"],
"env": {
"AZURE_CLIENT_ID": "your-azure-client-id",
"AZURE_TENANT_ID": "your-azure-tenant-id",
"MCP_OUTLOOK_WORK_DIR": "/optional/download/directory"
}
}
}
Common config file locations:
~/.claude.json or project-level .mcp.json~/.config/mcp/servers.json3. Alternative: Use environment variables
Instead of specifying env in the config, you can export the variables in your shell:
export AZURE_CLIENT_ID="your-azure-client-id"
export AZURE_TENANT_ID="your-azure-tenant-id"
export MCP_OUTLOOK_WORK_DIR="/optional/download/directory"
To use this MCP server, you need to register an application in Microsoft Azure.
Outlook MCP (or similar)http://localhost/callbackAZURE_CLIENT_IDAZURE_TENANT_IDMail.Read, Mail.ReadWrite, Mail.Send, Mail.Read.Shared, Mail.ReadWrite.Shared, Mail.Send.SharedCalendars.Read, Calendars.ReadWriteContacts.Read, Contacts.ReadWriteTasks.Read, Tasks.ReadWriteUser.Read, MailboxSettings.ReadFiles.Read.All, Files.ReadWrite.AllSites.Read.All, Sites.ReadWrite.Alloffline_accessNote: No client secret is required (PKCE auth flow).
Personal Microsoft accounts can also register apps in Azure:
The desktop extension (DXT) exposes only the mail settings above. The receipt/invoice-run behaviour below is configured by the calling process (e.g. a scheduled routine's MCP server config) via environment variables — it is intentionally not part of the extension settings UI:
RECEIPT_RULES_PATH)outlook_extract_receipt / outlook_collect_receipts work with zero configuration for
receipts issued via payment processors that put the vendor in the subject line
("Your receipt from Acme #1234"). For senders that need explicit mapping, or to
capture product labels, point RECEIPT_RULES_PATH at a JSON file
(see receipt-rules.example.json):
vendorSenders: [{ "pattern": "<case-insensitive regex on the from address>", "vendor": "<name>" }] — checked before the subject heuristic.productLabels: ["<case-insensitive regex>", ...] — first match becomes productLabel; without rules it is null.Five tools support autonomous expense-receipt collection (e.g. a scheduled monthly invoice run):
outlook_create_draft additionally accepts attachmentPaths (absolute local file paths, ≤ 3 MB each) and returns the draft's webLink — it stages the email for review and never sends.
Receipt matching notes (v1.2):
from and subjectContains combine as OR — either signal
matches a receipt, and each manifest entry reports matchedBy
(from, from-normalised, and/or subject).[email protected]) match both
exactly and via a plus-stripped fallback: when an exact from finds nothing,
the collector retries on the base local part and keeps only messages whose
normalised sender matches, noting searchNote in the manifest.periodStart/periodEnd (and outlook_search_emails' startDate/endDate)
accept bare dates: 2026-08-31 as an end covers the whole last day
instead of stopping at midnight.outlook_download_attachment accepts saveToFile/destDir/fileName/onExisting
to write raw bytes server-side and return only {savedPath, size, sha256} —
use this for real invoice PDFs instead of inline base64.Every mail, folder, and attachment tool — and every receipt tool
(collect_receipts, extract_receipt, save_attachment, render_email_pdf,
fetch_billing_pdf) — accepts an optional mailbox
argument (e.g. [email protected]). Precedence: per-call mailbox →
the MCP_OUTLOOK_SHARED_MAILBOX setting → your own mailbox. Requirements:
preserveUserStyling: false for shared sends.Mail.*.Shared delegated scopes — added in v1.3, so each user must
re-consent once: the interactive flow prompts automatically on next
sign-in; headless setups re-run npm run auth:bootstrap once.Graph offers no delegated API that lists the mailboxes you hold Full Access to,
so discovery is candidate-based: outlook_list_shared_mailboxes probes the
addresses in the Known Shared Mailboxes setting
(MCP_OUTLOOK_KNOWN_MAILBOXES), the Shared Mailbox setting, and any
candidates you pass, then reports which ones actually open (with inbox
counts) and which are denied, missing, or malformed. Feed an accessible
address straight back as the mailbox argument.
Calendar tools stay on your own calendar in this release.
npm run auth:bootstrap (opens the browser PKCE flow and stores an encrypted refresh token).MCP_OUTLOOK_AUTH_MODE=headless for the scheduled run. The server refreshes silently and never launches a browser; if re-consent is genuinely required it fails fast with an actionable error telling you to re-run the bootstrap.MCP_OUTLOOK_REFRESH_TOKEN_PATH to point the run at a specific token store directory.When downloading large attachments or SharePoint files, the server automatically detects when the response would exceed the MCP response cap (~30k characters by default — the practical tool-output token budget; override with MCP_OUTLOOK_MAX_RESPONSE_CHARS) and saves the content to local files instead.
MCP_OUTLOOK_WORK_DIR is set, large files are saved to this directoryOnce installed, you can ask the AI assistant things like:
Email Management
Calendar
Attachments & SharePoint
Receipts & Invoices
Office Document Processing
The server automatically parses:
The server uses OAuth 2.0 with PKCE for secure authentication:
The app requests these Microsoft Graph permissions:
Mail.Read, Mail.ReadWrite, Mail.Send - Email accessMail.Read.Shared, Mail.ReadWrite.Shared, Mail.Send.Shared - Shared/delegated mailbox email access (v1.3)Calendars.Read, Calendars.ReadWrite - Calendar accessContacts.Read, Contacts.ReadWrite - Contact accessTasks.Read, Tasks.ReadWrite - Task accessUser.Read, MailboxSettings.Read - User profileFiles.Read.All, Files.ReadWrite.All - OneDrive/SharePoint filesSites.Read.All, Sites.ReadWrite.All - SharePoint sitesoffline_access - Refresh tokensMCP_OUTLOOK_WORK_DIR is set and writableoutlook-mcp/
├── server/
│ ├── index.js # Main MCP server
│ ├── auth/ # Authentication management
│ ├── graph/ # Microsoft Graph API client
│ ├── schemas/ # MCP tool schemas
│ ├── tools/ # MCP tool implementations
│ │ ├── attachments/ # Attachment tools
│ │ ├── calendar/ # Calendar tools
│ │ ├── email/ # Email tools
│ │ ├── folders/ # Folder management
│ │ ├── receipts/ # Receipt/invoice-run tools
│ │ └── sharepoint/ # SharePoint tools
│ └── utils/ # Utility modules
└── package.json
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:benchmark # Performance benchmarks
npm run test:graph # Test Graph API connection
If this tool saved you time, consider supporting the development!
MIT License
MCP server for Microsoft Office 365 Outlook – email, calendar & SharePoint integration for Claude, ChatGPT, and AI assistants via Microsoft Graph API
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
Outlook 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 MCP server for Microsoft Office 365 Outlook – email, calendar & SharePoint integration for Claude, ChatGPT, and AI assistants via Microsoft Graph API