MCP Server for Multiple Outlook Accounts
This server lets an AI assistant manage multiple Outlook/Microsoft 365 mailboxes simultaneously through a single interface.
Email Operations:
π
search_conversationsβ Search mailboxes with Gmail-style operators (paged results)π
read_conversationβ Read full email conversation threadsβοΈ
create_draftβ Compose and save a draft (supports recipient parsing, reply threading, and large attachments via upload sessions)π€
send_messageβ Send an email immediately (with no-duplicate-send safety policy)π·οΈ
list_labelsβ List all categories and folders (recursive)β
create_labelβ Create a new category or folderπ
organize_mailβ Tag, move, archive, trash, mark as junk, or change read-state across a conversationπ
list_accountsβ List all connected mailboxes
CLI Account Management:
outlook-mcp-auth connectβ Connect a new mailbox via browser OAuthoutlook-mcp-auth listβ List connected accountsoutlook-mcp-auth removeβ Remove a connected account
Security highlights:
OAuth tokens stored locally only (file mode
600in a700directory)Attachment access from local paths disabled by default (requires explicit allow-list)
Tokens and credentials are never logged
Click on "Deploy 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., "@MCP Server for Multiple Outlook Accounts list all connected mailboxes"
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.
MCP Server for Multiple Outlook Accounts
A local, single-connector Model Context Protocol server that lets an AI assistant operate several Outlook / Microsoft 365 mailboxes at once β searching, reading, drafting, sending, and organising mail β through one safety-annotated tool surface, with OAuth tokens that never leave your machine.
This is the Outlook / Microsoft Graph provider variant of a provider-neutral specification.
π
doc/business-specification.mdβ provider-neutral business + functional spec (the contract).π
doc/provider-mapping.mdβ how neutral requirements bind to Microsoft Graph.ποΈ
doc/architecture.mdβ how this variant is designed and built.β
doc/traceability-matrix.mdβ every requirement β module β test.π
doc/ONBOARDING.mdβ operator guide: register an Entra app, handle consent, connect a mailbox.β
doc/LIVE-ACCEPTANCE.mdβ live acceptance runbook +npm run live-smoke(the remaining work).π€
doc/CONTRIBUTING.mdβ handoff guide: how we work, workflow, and the per-phase record.π
doc/HANDOVER.mdβ handover snapshot: what's done and the outstanding-work checklist.
Project status: feature-complete (offline build)
Built with TypeScript 6.0.3; build, typecheck, tests (179), and format all green. All eight capabilities are implemented and the offline build is feature-complete. What exists today:
β Architecture design + requirements traceability matrix (
doc/).β Auth core: Entra credential-source discovery, MSAL public-client (consent + silent refresh), secure token store (
0600/0700, atomic + cross-process-locked), account-selection registry.β Account-management CLI:
outlook-mcp-auth connect | list | remove.β Microsoft Graph client: thin
fetchwrapper with a per-request timeout, bounded jittered retry (with the no-duplicate-send policy), and actionable error mapping.β Read tools:
list_accounts(C1),search_conversations(C2),read_conversation(C3) β with Gmail-style search-operator translation and bounded, truncating output.β Write tools:
create_draft(C4) andsend_message(C5) β recipient parsing (Display Name <addr>), header-injection stripping, allow-listed/TOCTOU-safe attachments, local outgoing-size validation, and reply threading. Small attachments ride inline; large ones (> ~3 MB) upload to the draft via a Graph upload session, so send becomes create-draft β upload β send with the final/sendunder thenonDuplicableretry policy β a retry can never double-deliver.β Organise tools:
list_labels(C6),create_label(C7), andorganize_mail(C8) β the label-decomposition fan-out that maps one neutral organise request to the right mix of Graph category-PATCH / read-state /movecalls (archive, trash, junk β mutually exclusive), applied per message across a conversation under a bounded concurrency limit, reporting the union of resulting labels.list_labelsenumerates folders recursively (full paths).β Hardening + onboarding: a secret-redaction boundary so tokens/credentials can never reach the logs (NFR-SEC-6), and the operator onboarding guide (Entra app registration, unverified-app consent, the connect CLI).
Remaining: the live acceptance runs (real browser consent + real Graph calls) that the
operator performs against an Entra app registration + Outlook mailbox. See doc/architecture.md Β§13.
Tests mock Microsoft Graph and MSAL. Live
Β§13acceptance β real browser consent and Graph calls β requires an Entra app registration + Outlook mailboxes and is run locally by the operator.
Related MCP server: msgraph-mcp
Capabilities (spec Β§5)
Tool | Purpose | Destructive? | Status |
| List connected mailboxes | No | β live |
| Search a mailbox (paged) | No | β live |
| Read a full conversation | No | β live |
| Compose a draft (not sent) | No | β live |
| Send immediately | Yes | β live |
| List categories + folders | No | β live |
| Create a category/folder | No | β live |
| Tag / move / read-state | Yes | β live |
Plus an out-of-band account-management CLI (outlook-mcp-auth connect | list | remove).
Development
Requires Node.js β₯ 18 (developed on Node 22).
npm install
npm run typecheck # tsc --noEmit
npm run build # compile to dist/
npm test # vitest (Graph/MSAL mocked)
npm run format:check # prettierConfiguration
All operational knobs are environment variables (see .env.example):
Env var | Meaning | Default |
| tokens + app-registration configs |
|
| pin one app registration (disables discovery) | unset |
| allow-list for | unset (disabled) |
| token-store lock wait |
|
| per-Graph-call timeout |
|
Connecting a mailbox
For the full walkthrough β Entra app registration, the unverified-app consent policy, and troubleshooting β see
doc/ONBOARDING.md. The short version:
Register a public-client app in Entra ID with the redirect URI
http://localhostand the delegated scopesMail.ReadWrite,Mail.Send,User.Read,offline_access.Drop a
credentials*.jsoninto the data dir (or pointOUTLOOK_OAUTH_CREDENTIALSat it):{ "clientId": "<application-client-id>", "tenant": "common" }Multiple
credentials*.jsonfiles are auto-discovered, so accounts under different app registrations each refresh with the client that authorised them.Connect, list, and remove mailboxes:
outlook-mcp-auth connect # opens the browser for consent outlook-mcp-auth connect --source acme # pick a specific app registration outlook-mcp-auth list outlook-mcp-auth remove user@example.com
Security posture
OAuth tokens are stored only on the local machine (file mode 600 in a 700 data dir). Reading
local files by path for attachments is disabled by default and only allowed from an explicit
allow-list. The server never logs tokens, credentials, or message content. See
doc/architecture.md Β§9.
License
MIT β see LICENSE.
Available Tools
1 toollist_accountsList connected accountsARead-onlyIdempotent
List the Outlook / Microsoft 365 mailboxes connected to this server. Use the returned identities as the 'account' selector for other tools.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity. Agents will always select list_accounts when any tool is needed.
The single tool follows a clear verb_noun pattern (list_accounts), making its purpose immediately understandable.
A single listing tool is far too few for a server purporting to handle multiple Outlook accounts. The user would expect tools for email operations, calendar management, or at least sending/reading messages.
The server only lists accounts and provides no way to actually interact with them. There are obvious missing operations like read_email, send_email, search_mailbox, or manage folders, leaving the surface severely incomplete.
Maintenance
Related MCP Connectors
Email inboxes for AI agents: read, search, send, reply, calendar invites. Hosted MCP with OAuth.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Persistent memory for AI assistants β one shared, OAuth-secured vault for every MCP client.
Give AI agents their own email inboxes: list, read and send mail via scoped, revocable OAuth grants.
Related MCP Servers
- FlicenseAqualityCmaintenanceLocal-first MCP server for agents that need to work across multiple Gmail and Microsoft 365 accounts without cloud token storage.6-
- FlicenseBqualityCmaintenanceMCP server providing AI assistants with full access to Microsoft Outlook email and calendar via the Microsoft Graph API, featuring 26 tools for mail, calendar, contacts, and scheduling with delegated authentication.29-
- AlicenseBqualityFmaintenanceLightweight MCP server that enables AI agents to manage Microsoft Outlook email, calendar, and files using PKCE authentication with only a Client ID.46MIT
- FlicenseNot gradedqualityDmaintenanceEnables reading, sending, and managing Microsoft 365/Outlook emails through MCP tools with OAuth 2.1 authentication.-