Outlook Assistant
About
MCP server for Outlook email, calendar, and contacts — let your AI assistant manage your inbox directly from the conversation.
Details
- Author
- littlebearapps
- Categories
- Communication, Other, Automation, Productivity
Jump to
Setup
Install Outlook Assistant in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/littlebearapps/outlook-assistant
Follow the installation instructions in the repository README, then restart your MCP client.
MCP server for Outlook email, calendar, and contacts — let your AI assistant manage your inbox directly from the conversation.
MCP server for Outlook email, calendar, and contacts — let your AI assistant manage your inbox directly from the conversation.
Outlook Assistant connects AI assistants to your Microsoft Outlook account through theModel Context Protocol. Ask your AI assistant to search your inbox, send emails, schedule meetings, manage contacts, and configure mailbox settings — without leaving the conversation. Works with Claude, Cursor, Windsurf, and any MCP-compatible client.
Works with personal Outlook.com and work/school Microsoft 365 accounts.
- 📨Search and read emails— find messages by sender, subject, date, or keywords; read full threads with conversation grouping; batch flag, move, export, or categorise multiple emails at once
- 🛡️Send emails with safety controls— dry-run preview, pre-send mail tips (out-of-office, mailbox full, delivery restrictions), session rate limiting, and recipient allowlist to prevent mistakes
- ✏️Draft emails for review— create, update, and send drafts; reply and forward as drafts; preview before saving with dry-run mode
- 📅Manage your calendar— view upcoming events, schedule meetings with attendees, decline or cancel invitations
- 📦Export emails— save individual messages to Markdown, EML, JSON, or CSV; export full conversation threads to MBOX or HTML; bulk-export search results in one call
- 🔍Investigate email headers— full raw header access (DKIM, SPF, DMARC, delivery chain, X-Mailer, X-Originating-IP) for phishing investigation and compliance review
- 🗂️Organise your inbox— create nested folders (addressable by path), set up inbox rules, colour-code with categories, manage Focused Inbox — all work together for complete inbox automation
- 🔄Track inbox changes— delta sync detects new, modified, and deleted emails since your last check, with tokens for incremental polling
- 👥Manage contacts— search your contact book and organisational directory, create and update contact records
- ⚙️Configure settings— set out-of-office auto-replies, working hours, and time zone
- 📬Access shared mailboxes— read team inboxes and service accounts (Microsoft 365)
- 🏢Find meeting rooms— search by building, floor, capacity, AV equipment, and wheelchair accessibility (Microsoft 365)
22 tools total— consolidated from 55 for optimal AI performance. See theTools Referencefor complete parameter details.
Export individual emails, search results, or entire conversation threads — usetarget=messageswith a search query (or thequeryshortcut) to batch-export without manually collecting IDs.
Outlook Assistant works with both personal and work/school Microsoft accounts, but some features behave differently:
Note: On personal accounts, Microsoft's$searchAPI has limited support for free-text queries. Outlook Assistant handles this automatically with progressive search — if your query returns no results, it falls back through OData filters, boolean filters, and recent message listing to find your emails. For the most direct results on personal accounts, use the structured filter parameters (from,subject,to,receivedAfter).
- Progressive search— on accounts where Microsoft's$searchAPI is limited, Outlook Assistant automatically falls back through up to 4 search strategies to find your emails. Most Graph API wrappers fail silently; this one adapts.
- Email forensics— raw header access for DKIM, SPF, DMARC, delivery chain, X-Mailer, X-Originating-IP, and spam scores. Returns the full data so you can investigate phishing, audit compliance, or trace delivery issues. (Auto-verdict is on the roadmap; today the data is surfaced and analysed in-conversation.)
- Delta sync— incremental inbox monitoring returns only what changed since your last check, with tokens for continuous polling. Designed for agent workflows that need to watch a mailbox.
- Batch operations— flag, move, export, or categorise multiple emails in a single call. Search-driven export lets you batch-export results without collecting IDs manually.
- Pre-send intelligence— check recipients for out-of-office, full mailbox, delivery restrictions, and moderation status before sending — no other Outlook MCP server offers this.
- Compound automation— rules, categories, folders, and Focused Inbox work together. Set up complete inbox management through your AI assistant in one conversation.
Outlook Assistant is designed with safety-first principles for AI-driven email access:
Destructive action safeguards— Every tool carriesMCP annotations(readOnlyHint,destructiveHint,idempotentHint) so AI clients can auto-approve safe reads and prompt for confirmation on destructive operations like sending email or deleting events.
Send-email protections— Thesend-emailtool includes:
- Pre-send mail tips(checkRecipients: true) — check recipients for out-of-office, mailbox full, delivery restrictions before sending
- Dry-run mode(dryRun: true) — preview composed emails without sending
- Session rate limiting— configurable viaOUTLOOK_MAX_EMAILS_PER_SESSION(default: unlimited)
- Recipient allowlist— restrict sending to approved addresses/domains viaOUTLOOK_ALLOWED_RECIPIENTS
Recommended setup: enable both safety belts in your.mcp.jsonfrom day one. They're off by default;auth action=aboutreports their state and prints a setup hint when unset. See.mcp.json.examplefor a copy-paste template.
"env": { "OUTLOOK_CLIENT_ID": "…", "OUTLOOK_CLIENT_SECRET": "…", "OUTLOOK_MAX_EMAILS_PER_SESSION": "10", "OUTLOOK_ALLOWED_RECIPIENTS": "your-domain.com,trusted@example.com" }
Draft protections— Thedrafttool sharessend-emailsafety controls: dry-run preview, recipient allowlist, mail-tips validation, and rate limiting. Thesendaction shares thesend-emailrate limit counter, preventing circumvention via the draft-then-send pathway.
Token-optimised architecture— Tools are consolidated using the STRAP (Single Tool, Resource, Action Pattern) approach. 22 tools instead of 55 reduces per-turn overhead by ~11,000 tokens (~64%), keeping more of the AI's context window available for your actual conversation. Fewer tools also means the AI selects the right tool more accurately — research shows tool selection degrades beyond ~40 tools.
Important: These safeguards are defence-in-depth measures that reduce risk, but they are not a guarantee against unintended actions. AI-driven access to your email is inherently sensitive — always review tool calls before approving, particularly for sends and deletes. No automated guardrail is foolproof, and you remain responsible for actions taken through your mailbox.
npm install -g @littlebearapps/outlook-assistant
You need a Microsoft Azure app registration to authenticate. See theAzure Setup Guidefor a detailed walkthrough (including first-time Azure account creation), or if you've done this before:
- Create a new app registration atportal.azure.com
- Add Microsoft Graph delegated permissions (Mail, Calendar, Contacts)
- Create a client secret and copy theValue(not the Secret ID)
- Under Authentication >Add a platform>Mobile and desktop applications— checknativeclientURI
- Enable"Allow public client flows"in Authentication > Advanced settings
- (Optional)Set redirect URI tohttp://localhost:3333/auth/callback— only needed for browser auth flow
{ "mcpServers": { "outlook": { "command": "npx", "args": ["@littlebearapps/outlook-assistant"], "env": { "OUTLOOK_CLIENT_ID": "your-application-client-id", "OUTLOOK_CLIENT_SECRET": "your-client-secret-VALUE" } } } }
claude mcp add outlook -- npx @littlebearapps/outlook-assistant
Then set environment variables in your.envor shell.
{ "mcpServers": { "outlook": { "command": "npx", "args": ["@littlebearapps/outlook-assistant"], "env": { "OUTLOOK_CLIENT_ID": "your-application-client-id", "OUTLOOK_CLIENT_SECRET": "your-client-secret-VALUE" } } } }
{ "mcpServers": { "outlook": { "command": "npx", "args": ["@littlebearapps/outlook-assistant"], "env": { "OUTLOOK_CLIENT_ID": "your-application-client-id", "OUTLOOK_CLIENT_SECRET": "your-client-secret-VALUE" } } } }
Note: The auth server needsOUTLOOK_CLIENT_IDandOUTLOOK_CLIENT_SECRETenvironment variables. Your MCP client's"env"config only applies to the MCP server process — when running the auth server separately, ensure these are set in a.envfile or exported in your shell.
- Node.js18.0.0 or higher
- npm(included with Node.js)
- Azure accountfor app registration (free tier works)
npm install -g @littlebearapps/outlook-assistant
git clone https://github.com/littlebearapps/outlook-assistant.git cd outlook-assistant npm install
- offline_access— refresh tokens between sessions
- User.Read— basic profile
- Mail.Read,Mail.ReadWrite,Mail.Send— email operations
- Calendars.Read,Calendars.ReadWrite— calendar operations
- Contacts.Read,Contacts.ReadWrite— contact management
- MailboxSettings.ReadWrite— settings, auto-replies, categories
- People.Read— people search
- Mail.Read.Shared— shared mailbox access
- Place.Read.All— meeting room search (requires admin consent)
- Go toCertificates & secrets>New client secret
- Enter a description and select expiration
- ClickAdd
- Copy the secret Value immediately— you won't be able to see it again. Use theValue, not the Secret ID.
OUTLOOK_CLIENT_ID=your-application-client-id OUTLOOK_CLIENT_SECRET=your-client-secret-VALUE USE_TEST_MODE=false
Note:The server also acceptsMS_CLIENT_IDandMS_CLIENT_SECRETfor backwards compatibility.
Optional overrides(v3.8.0+) — see.env.examplefor the full list with commented worked examples:
If installed from source, usenodeinstead ofnpx:
{ "mcpServers": { "outlook": { "command": "node", "args": ["/path/to/outlook-assistant/index.js"], "env": { "OUTLOOK_CLIENT_ID": "your-application-client-id", "OUTLOOK_CLIENT_SECRET": "your-client-secret-VALUE" } } } }
Device Code Flow (Default — Recommended)
No auth server needed. Works everywhere, including remote/headless environments.
Prerequisite: Enable "Allow public client flows" in Azure Portal > your app > Authentication > Advanced settings.
Server restarts(v3.7.2+): Device code state is persisted to~/.outlook-assistant-pending-auth.json, sodevice-code-completeworks even if the MCP server restarts between steps 1 and 4 (e.g., Untether/Telegram bridge, Claude Desktop session changes).
For localhost development or if you prefer the traditional OAuth flow:
This starts a local server on port 3333 to handle the OAuth callback.
Note: The auth server readsOUTLOOK_CLIENT_IDandOUTLOOK_CLIENT_SECRETfrom environment variables. Your MCP client's"env"config only applies to the MCP server process, not a separately-started auth server.
outlook-assistant/ ├── index.js # Main entry point (22 tools) ├── config.js # Configuration settings ├── outlook-auth-server.js # OAuth server (port 3333) ├── auth/ # Authentication module (1 tool) ├── email/ # Email module (7 tools) │ ├── mail-tips.js # Pre-send recipient validation │ ├── headers.js # Email header retrieval │ ├── mime.js # Raw MIME/EML content │ ├── conversations.js # Thread listing/export │ ├── attachments.js # Attachment operations │ └── ... ├── calendar/ # Calendar module (3 tools) ├── contacts/ # Contacts module (2 tools) ├── categories/ # Categories module (3 tools) ├── settings/ # Settings module (1 tool) ├── folder/ # Folder module (1 tool) ├── rules/ # Rules module (1 tool) ├── advanced/ # Advanced module (2 tools) └── utils/ ├── graph-api.js # Microsoft Graph API client (includes $batch) ├── safety.js # Rate limiting, recipient allowlist, dry-run ├── odata-helpers.js # OData query building ├── field-presets.js # Token-efficient field selections ├── response-formatter.js # Verbosity levels └── mock-data.js # Test mode data
"Cannot find module '@modelcontextprotocol/sdk/server/index.js'"
"EADDRINUSE: address already in use :::3333"
"Invalid client secret" (AADSTS7000215)
You're using the SecretIDinstead of the SecretValue. Go to Azure Portal > Certificates & secrets and copy theValuecolumn.
If using browser flow: start the auth server first withnpm run auth-server. If using device code flow: visitmicrosoft.com/devicelogininstead.
Enable "Allow public client flows" in Azure Portal > App registrations > Authentication > Advanced settings.
Token refresh fails after ~60 minutes (device code auth)
Fixed in v3.7.2. Earlier versions sentclient_secretin token refresh requests for device-code auth, which Microsoft rejects for public client flows. Update to v3.7.2+ or re-authenticate.
Check authentication status with theauthtool (action=status). Tokens may have expired — re-authenticate if needed.
npm test # Jest unit tests npm run inspect # MCP Inspector (interactive)
- Create a new module directory (e.g.tasks/)
- Implement tool handlers in separate files
- Export tool definitions from the module'sindex.js
- Import and add tools to theTOOLSarray in mainindex.js
- Add tests intest/
- Updatedocs/quickrefs/tools-reference.md
- Personal account search: Free-textqueryand the rawsearchExpression(formerlykqlQuery) rely on Microsoft's$searchAPI, which has limited support on personal Outlook.com accounts — field-scoped raw$search(e.g.subject:"…") may return nothing there.querymitigates this with progressive fallback (OData filters, then client-side), so for reliable personal-account search prefer structured filters (from,subject,to,receivedAfter) orquery. Cross-folder search (searchAllFolders: true) returns a superset of inbox-only results.
- Focused Inbox: Only available on work/school Microsoft 365 accounts.
- Shared mailboxes: RequireMail.Read.Sharedpermission and a work/school account.
- Meeting room search: RequiresPlace.Read.Allpermission with admin consent (work/school accounts only).
- Export default path: Exports save to the system temp directory by default. UsesavePathoroutputDirto specify a different location.
Contributions are welcome! Please seeCONTRIBUTING.mdfor guidelines.
For security concerns, please see ourSecurity Policy. Do not open public issues for vulnerabilities.
Built and maintained byLittle Bear Apps. Outlook Assistant is open source under theMIT License.
Local email connectivity for AI agents — read, draft, send, and organize Outlook mail via MCP. Apache-2.0 licensed.
A service for managing multiple email accounts from various providers like 163, Gmail, QQ, and Outlook.
Interact with Fastmail email, contacts, and calendar data using the Fastmail API.
Most email MCP servers only read from IMAP. mail-mcp does everything: 30 tools for reading, searching, sending, replying, forwarding, and bulk operations across IMAP, SMTP, Microsoft Graph API, and Exchange Web Services. Multi-account, native OAuth2, built in Rust. Works with Gmail, Microsoft 365, Hotmail/Outlook.com, Zoho, and any standard IMAP/SMTP server.
MCP server for Fastmail — email, contacts, calendars, and files via JMAP, CardDAV, CalDAV, and WebDAV
Zo is your personal vibe server in the cloud with 50+ tools and integrations. Add texting, email, calendar, research and more to your harness easily.
An open-source server that gives AI assistants full access to Fastmail email, calendars, and contacts over JMAP.
Interact with Microsoft Outlook for calendar management, email operations, and search functionality.
Interact with Microsoft 365 services like Outlook, OneDrive, and Teams using the Graph API.
Access your Microsoft 365 mail, calendar, and files using the Microsoft Graph API.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.


