Labsco
littlebearapps logo

Outlook Assistant

β˜… 24

from littlebearapps

MCP server for Outlook email, calendar, and contacts β€” let your AI assistant manage your inbox directly from the conversation.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedPaid serviceAdvanced setup
<p align="center"> <img src="https://raw.githubusercontent.com/littlebearapps/outlook-assistant/main/docs/assets/outlook-assistant-logo-full.png" height="200" alt="Outlook Assistant" /> </p> <h1 align="center">Outlook Assistant</h1> <p align="center"> <strong>MCP server for Outlook email, calendar, and contacts β€” let your AI assistant manage your inbox directly from the conversation.</strong> </p> <p align="center"> <a href="https://www.npmjs.com/package/@littlebearapps/outlook-assistant"><img src="https://img.shields.io/npm/v/@littlebearapps/outlook-assistant" alt="npm version" /></a> <a href="https://www.npmjs.com/package/@littlebearapps/outlook-assistant"><img src="https://img.shields.io/npm/dm/@littlebearapps/outlook-assistant" alt="npm downloads" /></a> <a href="https://github.com/littlebearapps/outlook-assistant/actions/workflows/ci.yml"><img src="https://github.com/littlebearapps/outlook-assistant/actions/workflows/ci.yml/badge.svg" alt="CI" /></a> <a href="https://github.com/littlebearapps/outlook-assistant/actions/workflows/codeql.yml"><img src="https://github.com/littlebearapps/outlook-assistant/actions/workflows/codeql.yml/badge.svg" alt="CodeQL" /></a> <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a> <a href="https://glama.ai/mcp/servers/littlebearapps/outlook-assistant"><img src="https://glama.ai/mcp/servers/littlebearapps/outlook-assistant/badges/score.svg" alt="Glama score" /></a> </p>

Outlook Assistant connects AI assistants to your Microsoft Outlook account through the Model 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.

<div align="center"> <br /> <a href="https://github.com/littlebearapps/outlook-assistant/blob/main/docs/demo/outlook-assistant-demo.mp4"> <img src="https://raw.githubusercontent.com/littlebearapps/outlook-assistant/main/docs/demo/outlook-assistant-demo.gif" alt="Outlook Assistant Demo β€” searching emails, reading, and drafting a reply" width="720" style="border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.12);" /> </a> <br /> <sub>Search inbox β†’ read &amp; summarise β†’ draft a reply β€” all from the conversation</sub> <br /><br /> </div>

What you can do

  • πŸ“¨ 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 folders, 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)

Why Outlook Assistant?

Without Outlook AssistantWith Outlook Assistant
Switch between your AI tool and Outlook to manage emailRead, search, send, and export emails directly from your AI assistant
Manually search and export email threadsFull email tools including search, threading, and bulk export
Context-switch for calendar and contactsManage calendar events, contacts, and settings in one place
Copy-paste email content into conversationsYour AI assistant reads your emails natively with full context
No programmatic access to mailbox rules or categoriesCreate inbox rules, manage categories, configure auto-replies
Manually check each email for phishing red flagsForensic header analysis β€” DKIM, SPF, DMARC, spam scores, and delivery chain in one call
Poll your inbox to check for new mailDelta sync returns only changes since your last check, with tokens for continuous polling

Features

ModuleToolsWhat You Can Do
Email8search-emails (list/search/delta/conversations), read-email (content + forensic headers), send-email (with dry-run + mail tips), draft (create/update/send/delete/reply/forward), update-email (read status, flags), attachments, export, get-mail-tips
Calendar3list-events, create-event, manage-event (update/decline/cancel/delete)
Contacts2manage-contact (list/search/get/create/update/delete), search-people
Categories3manage-category (CRUD), apply-category, manage-focused-inbox
Settings1mailbox-settings (get/set auto-replies/set working hours)
Folder1folders (list/create/move/stats/delete)
Rules1manage-rules (list/create/update/reorder/delete)
Advanced2access-shared-mailbox, find-meeting-rooms
Auth1auth (status/authenticate/about)

22 tools total β€” consolidated from 55 for optimal AI performance. See the Tools Reference for complete parameter details.

Export Formats

Format support varies by target:

FormatExtensiontarget=message (single)target=messages (batch)target=conversation (thread)
mime / eml.emlβœ…β€“βœ…
mbox.mboxβ€“β€“βœ…
markdown.mdβœ…βœ…βœ…
json.jsonβœ…βœ…βœ…
html.htmlβ€“β€“βœ…
csv.csvβœ…βœ…βœ…

Export individual emails, search results, or entire conversation threads β€” use target=messages with a search query (or the query shortcut) to batch-export without manually collecting IDs.

Account Compatibility

Outlook Assistant works with both personal and work/school Microsoft accounts, but some features behave differently:

FeaturePersonal (Outlook.com)Work/School (Microsoft 365)
Email read, send, searchFull supportFull support
Calendar eventsFull supportFull support
Contacts CRUDFull supportFull support
Inbox rulesFull supportFull support
FoldersFull supportFull support
Free-text query searchLimited β€” use subject, from, to filters insteadFull KQL support
CategoriesFull supportFull support
Mailbox settingsFull supportFull support
Focused InboxAPI works (overrides stored) but mail routing not affectedFull support
Shared mailboxesNot availableRequires Mail.Read.Shared
Meeting room searchNot availableRequires Place.Read.All + admin consent

Note: On personal accounts, Microsoft's $search API 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).

What Makes This Different

  • Progressive search β€” on accounts where Microsoft's $search API 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 v3.8.0 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.

Safety & Token Efficiency

Outlook Assistant is designed with safety-first principles for AI-driven email access:

Destructive action safeguards β€” Every tool carries MCP 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 β€” The send-email tool 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 via OUTLOOK_MAX_EMAILS_PER_SESSION (default: unlimited)
  • Recipient allowlist β€” restrict sending to approved addresses/domains via OUTLOOK_ALLOWED_RECIPIENTS

Recommended setup: enable both safety belts in your .mcp.json from day one. They're off by default; auth action=about reports their state and prints a setup hint when unset. See .mcp.json.example for a copy-paste template.

Copy & paste β€” that's it
"env": {
  "OUTLOOK_CLIENT_ID": "…",
  "OUTLOOK_CLIENT_SECRET": "…",
  "OUTLOOK_MAX_EMAILS_PER_SESSION": "10",
  "OUTLOOK_ALLOWED_RECIPIENTS": "your-domain.com,trusted@example.com"
}

Draft protections β€” The draft tool shares send-email safety controls: dry-run preview, recipient allowlist, mail-tips validation, and rate limiting. The send action shares the send-email rate 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.

Azure App Registration

First time with Azure? The Azure Setup Guide covers everything from creating an account to your first authentication, including billing setup and common pitfalls.

Create the App

  1. Open Azure Portal
  2. Sign in with a Microsoft Work or Personal account
  3. Search for App registrations and click New registration
  4. Enter a name (e.g. "Outlook Assistant Server")
  5. Select Accounts in any organizational directory and personal Microsoft accounts
  6. Set redirect URI: platform Web, URI http://localhost:3333/auth/callback
  7. Click Register
  8. Copy the Application (client) ID

Add Permissions

  1. Go to API permissions > Add a permission > Microsoft Graph > Delegated permissions
  2. Add these required permissions:
    • 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
  3. Optionally add org-only permissions (work/school accounts only):
    • Mail.Read.Shared β€” shared mailbox access
    • Place.Read.All β€” meeting room search (requires admin consent)
  4. Click Add permissions

Create a Client Secret

  1. Go to Certificates & secrets > New client secret
  2. Enter a description and select expiration
  3. Click Add
  4. Copy the secret Value immediately β€” you won't be able to see it again. Use the Value, not the Secret ID.

Authentication Flow

Device Code Flow (Default β€” Recommended)

No auth server needed. Works everywhere, including remote/headless environments.

  1. Ask your AI assistant to authenticate (calls auth tool with action=authenticate)
  2. Visit the URL shown (microsoft.com/devicelogin) on any browser, any device
  3. Enter the code, sign in with your Microsoft account, and grant permissions
  4. Tell your AI assistant to complete authentication (calls auth with action=device-code-complete)
  5. Tokens are saved to ~/.outlook-assistant-tokens.json and refresh automatically

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, so device-code-complete works even if the MCP server restarts between steps 1 and 4 (e.g., Untether/Telegram bridge, Claude Desktop session changes).

Browser Redirect Flow (Alternative)

For localhost development or if you prefer the traditional OAuth flow:

Copy & paste β€” that's it
npm run auth-server

This starts a local server on port 3333 to handle the OAuth callback.

  1. In your AI assistant, use the auth tool with action=authenticate, method=browser
  2. Open the provided URL in your browser
  3. Sign in and grant permissions β€” tokens are saved automatically

Note: The auth server reads OUTLOOK_CLIENT_ID and OUTLOOK_CLIENT_SECRET from environment variables. Your MCP client's "env" config only applies to the MCP server process, not a separately-started auth server.

Directory Structure

Copy & paste β€” that's it
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

Development

Running Tests

Copy & paste β€” that's it
npm test                     # Jest unit tests
npm run inspect              # MCP Inspector (interactive)

Test Mode

Run with mock data (no real API calls):

Copy & paste β€” that's it
USE_TEST_MODE=true npm start

Extending the Server

  1. Create a new module directory (e.g. tasks/)
  2. Implement tool handlers in separate files
  3. Export tool definitions from the module's index.js
  4. Import and add tools to the TOOLS array in main index.js
  5. Add tests in test/
  6. Update docs/quickrefs/tools-reference.md

Documentation

GuideDescription
Getting StartedInstall, configure, and authenticate β€” start here
Azure Setup GuideAzure account creation, app registration, permissions, and secrets
How-To Guides29 practical guides for email, calendar, contacts, and settings
RoadmapActive milestones (v3.7.5, v3.8.0, v3.9.0) and recent releases
Troubleshooting & FAQCommon problems, re-authentication, and frequently asked questions
Tools ReferenceAll 22 tools with parameters
AI Agent GuideTool selection and workflow patterns for AI agents

Full documentation: docs/

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Security

For security concerns, please see our Security Policy. Do not open public issues for vulnerabilities.

Changelog

See CHANGELOG.md for version history.

About

Built and maintained by Little Bear Apps. Outlook Assistant is open source under the MIT License.