outlook-mcp
The outlook-mcp server enables AI assistants to manage Microsoft Outlook email, calendar, attachments, SharePoint, and receipts/invoices via the Microsoft Graph API.
Email Management
List, search, retrieve, send, reply, forward, and create draft emails
Delete, move, archive, mark as read/unread, flag, categorize, and batch process emails
Calendar Management
List, create, update, and delete events (including recurring events)
Respond to invitations, find meeting times, check availability, and schedule online meetings (Teams/Skype)
List calendars, get calendar views, and check permissions
Attachment Handling
List, download, and add attachments to drafts
Scan for large or suspicious attachments; save with SHA-256 validation
Folder Management
List, create, rename folders; get folder statistics
SharePoint & OneDrive
Fetch files via sharing links or IDs, list files in SharePoint/OneDrive, resolve sharing links for metadata
Office Document Processing
Parse and extract content from PDF, Word (.docx), PowerPoint (.pptx), and Excel (.xlsx) files
Receipt & Invoice Collection
Extract structured receipt data (vendor, amount, currency), save attachment PDFs, fetch billing PDFs from email links, render emails to PDF, and collect all receipts for a period with idempotent re-run support
Authentication & Security
OAuth 2.0 with PKCE, encrypted local token storage, automatic token refresh, and headless/scheduled run support
Large File Support
Automatically saves files locally when they exceed MCP response size limits
Allows fetching billing PDFs from Stripe invoices via links in email bodies, with domain allowlisting and content validation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@outlook-mcpshow my unread emails from today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Features
Email Operations: Read, search, send, reply to emails and download attachments
SharePoint Integration: Access SharePoint files via sharing links or direct file IDs. Download files shared to you via emails.
Calendar Management: View and manage calendar events and appointments
Office Document Processing: Parse PDF, Word, PowerPoint, and Excel files with extracted text content
Receipt & Invoice Collection: Discover emailed receipts by sender/subject/date, save them as verified and consistently named PDFs (attachment, billing link, or rendered fallback), and stage a review draft — built for scheduled, non-interactive runs
Large File Support: Automatic handling of files that exceed MCP response size limits
Related MCP server: MCP Outlook Server
Quick Start
Choose your installation method:
Method | Best For |
Claude Desktop users | |
Claude Code, mcp CLI, other MCP clients |
Prerequisites: Before installing, you'll need to set up an Azure application to get your Client ID and Tenant ID.
Installation
Installing as DXT Extension
For Claude Desktop users, DXT extensions provide the simplest installation experience.
Option 1: Download Pre-built Extension
Download
outlook-mcp.dxtfrom the Releases pageIn Claude Desktop, go to Settings → Extensions
Click Install from file and select the
.dxtfileEnter your Azure Client ID, Tenant ID, and optional download directory when prompted
Option 2: Build from Source
Clone and install dependencies:
git clone https://github.com/XenoXilus/outlook-mcp.git cd outlook-mcp npm installInstall the DXT CLI:
npm install -g @anthropic-ai/dxtPack the extension:
dxt pack . outlook-mcp.dxtInstall the generated
.dxtfile in Claude Desktop as above
Using with CLI Tools
For 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 install2. 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 Code:
~/.claude.jsonor project-level.mcp.jsonmcp CLI:
~/.config/mcp/servers.json
3. 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"Azure Setup Guide
To use this MCP server, you need to register an application in Microsoft Azure.
For Business/Work Accounts (Recommended)
Go to the Azure Portal and search for "App registrations".
Click New registration.
Name:
Outlook MCP(or similar)Supported account types: Accounts in this organizational directory only (Single tenant)
Redirect URI: Select Web and enter
http://localhost/callback
Click Register.
Go to Authentication in the sidebar.
Under "Advanced settings", set Allow public client flows to Yes.
Click Save.
On the Overview page, copy:
Application (client) ID → This is your
AZURE_CLIENT_IDDirectory (tenant) ID → This is your
AZURE_TENANT_ID
Go to API permissions in the sidebar.
Click Add a permission -> Microsoft Graph -> Delegated permissions.
Add these permissions:
Mail.Read,Mail.ReadWrite,Mail.SendCalendars.Read,Calendars.ReadWriteUser.Read,MailboxSettings.ReadFiles.Read.All,Files.ReadWrite.AllSites.Read.All,Sites.ReadWrite.Alloffline_access
Click Add permissions.
(Optional) If you are an admin, click Grant admin consent to suppress consent prompts for users.
Note: No client secret is required (PKCE auth flow).
For Personal Accounts (outlook.com, hotmail.com)
Personal Microsoft accounts can also register apps in Azure:
Sign in to the Azure Portal with your personal Microsoft account (outlook.com, hotmail.com, etc.).
If prompted to create a directory, follow the steps to create a free Azure directory.
Follow the same steps as above for Business accounts.
When configuring, use Accounts in any organizational directory and personal Microsoft accounts for supported account types.
Configuration Reference
Environment Variables
Variable | Required | Description |
| Yes | Your Azure AD application client ID |
| Yes | Your Azure AD directory (tenant) ID |
| No | Directory for saving large files (defaults to system temp) |
| No | Comma-separated extra directories save tools may write into when given an explicit |
| No | Delegated/shared mailbox to read; empty = own mailbox |
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:
Variable | Description |
| Directory where receipt/invoice PDFs are saved (falls back to work dir). Also passable per-call as |
| Optional JSON file of site-specific vendor rules (see below). Unset = generic heuristics only. If set but missing/invalid, receipt tools fail fast rather than silently degrade. |
| Comma-separated hosts |
| Receipt naming pattern (default: |
|
|
| Directory of the encrypted token store for headless runs (defaults to the built-in store) |
| Chrome/Chromium binary for |
Vendor rules (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 becomesproductLabel; without rules it isnull.
Receipt & Invoice-Run Tools (v1.1)
Five tools support autonomous expense-receipt collection (e.g. a scheduled monthly invoice run):
Tool | Purpose |
| Save an attachment's original bytes to a chosen path/filename. Auto-selects the |
| Fetch the PDF behind a billing link in an email body (fallback when a forward loses its attachment). HTTPS-only, allowlist-only (redirects included), content-type + magic-byte validated, 25 MB / 30 s bounded. |
| Compact structured summary of a receipt email (vendor, amount, currency, receipt/invoice numbers, product label, billing link, attachment ids) — never the 60 KB+ HTML body. |
| Render the sanitised email HTML to PDF via headless Chrome — audit-trail fallback for receipts with no attachment and no link (e.g. app-store order receipts). |
| One call per period: discovers each vendor's receipts by sender/subject/date across the whole mailbox, saves every PDF (attachment → link → rendered fallback), and returns a manifest plus |
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.
Headless (Scheduled) Runs
Seed tokens once, interactively:
npm run auth:bootstrap(opens the browser PKCE flow and stores an encrypted refresh token).Set
MCP_OUTLOOK_AUTH_MODE=headlessfor 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.Optionally set
MCP_OUTLOOK_REFRESH_TOKEN_PATHto point the run at a specific token store directory.
Large File Handling
When downloading large attachments or SharePoint files, the server automatically detects when the response would exceed the MCP 1MB limit and saves the content to local files instead.
If
MCP_OUTLOOK_WORK_DIRis set, large files are saved to this directoryIf not set, files are saved to the system temp directory
Files are automatically named with timestamps to avoid conflicts
Old files are periodically cleaned up to manage disk space
Example Prompts
Once installed, you can ask the AI assistant things like:
Email Management
"Show me my unread emails from this week"
"Find all emails from John about the project proposal"
"Send a reply to the last email from Sarah thanking her for the update"
"Draft an email to the team summarizing today's meeting"
Calendar
"What meetings do I have tomorrow?"
"Schedule a 30-minute call with Alex next Tuesday afternoon"
"Show me my availability for the rest of the week"
Attachments & SharePoint
"Download and summarize the PDF attachment from the latest email from Finance"
"Get the contents of this SharePoint link: [paste link]"
"What files were attached to emails from Legal this month?"
Receipts & Invoices
"Collect all my June receipts into my receipts folder and give me the manifest"
"Save the invoice PDF from the latest Acme receipt email as 'Acme 29Jun26 Invoice.pdf'"
"Draft an email to my accountant with last month's receipt PDFs attached — don't send it"
Office Document Processing
The server automatically parses:
PDF files: Extracts text content
Word documents (.docx): Extracts text content
PowerPoint (.pptx): Extracts slide text
Excel (.xlsx): Parses data into structured format
Authentication
The server uses OAuth 2.0 with PKCE for secure authentication:
First run will open a browser for Microsoft authentication
Tokens are encrypted and stored locally (uses OS keychain if available, otherwise encrypted file storage)
Automatic token refresh for long-term usage
No sensitive data stored in plain text
Required Permissions
The app requests these Microsoft Graph permissions:
Mail.Read,Mail.ReadWrite,Mail.Send- Email accessCalendars.Read,Calendars.ReadWrite- Calendar accessUser.Read,MailboxSettings.Read- User profileFiles.Read.All,Files.ReadWrite.All- OneDrive/SharePoint filesSites.Read.All,Sites.ReadWrite.All- SharePoint sitesoffline_access- Refresh tokens
Troubleshooting
Large File Issues
Problem: "Result exceeds maximum length" error
Solution: Ensure
MCP_OUTLOOK_WORK_DIRis set and writableAlternative: Files automatically save to system temp if work dir not configured
Authentication Issues
Problem: Authentication failures
Solution: Verify Azure AD app permissions and client ID
Reset: Clear stored tokens and re-authenticate
SharePoint Access Issues
Problem: Cannot access SharePoint files
Solution: Ensure sharing links are valid and user has access permissions
Alternative: Use direct file ID access if available
Development
Project Structure
outlook-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.jsonRunning Tests
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:benchmark # Performance benchmarksDebugging
npm run test:graph # Test Graph API connectionSupport
If this tool saved you time, consider supporting the development!
License
MIT License
Contributing
Fork the repository
Create a feature branch
Make changes with tests
Submit a pull request
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceEnables AI assistants to interact with Microsoft Graph API services including Outlook email, Calendar events, OneDrive files, and Contacts. Supports multiple Microsoft accounts with unified search across all services.Last updated
- Flicense-qualityDmaintenanceEnables AI agents to interact with Microsoft Outlook via the Microsoft Graph API for managing emails and calendar events. It allows users to read and send emails, list messages, and create calendar appointments with automatic Teams links.Last updated1
- Flicense-qualityDmaintenanceProvides programmatic access to Microsoft Outlook mailboxes, enabling AI assistants to search, analyze, and extract insights from emails in personal and shared mailboxes.Last updated
- Alicense-qualityCmaintenanceEnables AI agents to manage Microsoft Outlook emails through the Microsoft Graph API, supporting operations like listing, reading, sending, and moving emails.Last updatedMIT
Related MCP Connectors
Calendar API for AI agents: events, availability, Google/Microsoft setup, scheduling, and iCal.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/XenoXilus/outlook-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server