Local MCP server for Claude Desktop to read Outlook emails/bodies/attachments and send local files as attachments.
M365 Attachment Reader MCP Local
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A local stdio MCP server for Claude Desktop that reads Outlook emails and their attachments — and sends local files (e.g. a daily dashboard .pptx) as Outlook attachments — through the Microsoft Graph API.
> Status: Functional for personal single-user local use with Claude Desktop.
---
What's New in v0.2.0
- **send_outlook_email** — compose an Outlook email with **local files attached** (e.g. a .pptx) and either save it as a **draft** for review (default) or send it immediately (send_now: true). Small attachments only (each **Outbound send is opt-in per call.** send_outlook_email defaults to creating a **draft** in your Drafts folder — nothing leaves your mailbox until you review and send it in Outlook. Pass send_now: true to send directly. Each attachment must be **under 3 MB** (see Limitations).
---
Real-World Use Cases
Retail / Sales Operations
> "Pull the last 5 Daily Dashboard emails, read the Excel attachments, and analyze the sales trend across all store locations over the past week."
Finance / Accounting
> "Find the latest email from our vendor with 'Invoice' in the subject, read the PDF attachment, and extract the total amount, due date, and line items."
Legal / Contract Review
> "Open the most recent email from legal@partner.com, read the Word or PowerPoint attachment, and summarize the key terms."
HR / Recruiting
> "Find emails from recruiting@company.com with attachments, read each resume PDF, and create a comparison table of candidates."
Sending a report (outbound)
> "Attach ~/Desktop/Daily Dash.pptx and save a draft to my manager with the subject 'Daily Dash — today' — I'll review it before sending."
> "Send ~/Desktop/Daily Dash.pptx to jane@contoso.com right now with the subject 'Daily Dash' and a one-line note."
---
Prerequisites
- Windows 10/11, macOS, or Linux
- Node.js 20 or later
- Claude Desktop
- A Microsoft 365 / Outlook account
- A Microsoft Entra app registration (see Step 1 below)
---
Setup
1. Create a Microsoft Entra App Registration
Go to Microsoft Entra admin center → **App registrations** → **New registration**.
- **Name:** anything you like, e.g. m365-mcp-local
- **Supported account types:** Accounts in any organizational directory and personal Microsoft accounts
Then:
1. Copy the **Application (client) ID** from the Overview page
2. Go to **Authentication** → enable **Allow public client flows** → **Save**
3. Go to **API permissions** → **Add a permission** → **Microsoft Graph** → **Delegated permissions** → add User.Read, Mail.ReadWrite, and Mail.Send → **Grant admin consent**
4. Go to **Manifest** → find requestedAccessTokenVersion (it may be nested inside api) → set it to 2 → **Save**
> **Why Mail.ReadWrite + Mail.Send?** Reading emails/attachments needs read access (Mail.ReadWrite includes the old Mail.Read). Saving a draft needs Mail.ReadWrite; sending needs Mail.Send. The send_outlook_email tool uses both. If you only ever want to *read*, you can drop down to User.Read + Mail.Read and edit SCOPES in server.mjs accordingly.
> **Already set up an earlier read-only version?** Adding new scopes does **not** upgrade an existing login automatically. After adding Mail.ReadWrite and Mail.Send (and granting consent), restart Claude Desktop and run begin_auth again — you'll be prompted to consent to the new permissions, and a fresh token with send rights is issued.
> **Why step 4?** When your app supports personal Microsoft accounts, Microsoft Entra requires access tokens to be v2. The portal doesn't always set this automatically, and the common endpoint will fail with AADSTS50059 if the token version is still null or 1. If you skip this step you will get invalid_grant errors during begin_auth.
> **Using v1 API integrations?** Only set this to 2 if all your Graph/API permissions support v2 tokens (all Microsoft Graph delegated permissions do). If you're integrating custom APIs that only accept v1 tokens, use M365_TENANT_ID=consumers (personal accounts only) or a specific tenant ID instead of common, and leave requestedAccessTokenVersion at its default.