outlook-mcp-server
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-mcp-serverCheck my latest emails from my inbox."
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.
outlook-mcp-server
A local MCP server that gives Claude (Desktop or Code) read/write access to a personal Hotmail / Outlook.com mailbox via the Microsoft Graph API, using the OAuth 2.0 authorization code flow (with PKCE) against the Microsoft identity platform.
It exposes six tools: list_messages, get_message, search_messages,
send_message, create_draft, and list_folders.
Everything runs locally over stdio — there is no hosted service, and your mail never passes through anything but your machine and Microsoft's own Graph API.
How it works
Auth: MSAL Node runs an authorization-code + PKCE flow against
https://login.microsoftonline.com/consumers(personal accounts only — see Tenant choice), using a short-lived local HTTP server as the redirect target. Tokens (including theoffline_accessrefresh token) are cached and silently refreshed on future runs.Storage: the token cache is serialized by MSAL, encrypted with AES-256-GCM using a locally-generated key, and written to
~/.outlook-mcp-server/token-cache.enc(mode0600). The key itself lives in~/.outlook-mcp-server/cache.key(also0600). See Security notes for the threat model this does (and doesn't) cover.Graph calls: a thin
fetch-based client callshttps://graph.microsoft.com/v1.0/...with the current access token.MCP server: built on
@modelcontextprotocol/sdk, speaking stdio, so it can be launched directly by Claude Desktop / Claude Code as a child process.
Related MCP server: Outlook MCP Python
Prerequisites
Node.js 18+
A Microsoft account (Hotmail, Outlook.com, or Live) — the mailbox you want Claude to access.
A free Azure account to register the app (any Microsoft account can do this — it does not need to be a paid Azure subscription).
1. Install
git clone <this repo>
cd outlook-mcp-server
npm install2. Register an app in the Azure Portal
This registration is what issues the client ID this server uses to talk to
Microsoft Graph on your behalf. npm run setup (below) walks you through
this interactively, but the steps are:
Go to portal.azure.com and sign in with any Microsoft account.
Search for App registrations → + New registration.
Fill in the form:
Name: anything, e.g.
outlook-mcp-server.Supported account types: "Personal Microsoft accounts only". This is what restricts the app to Hotmail/Outlook.com/Live accounts rather than a work/school (Azure AD) tenant.
Redirect URI: platform "Public client/native (mobile & desktop)", value
http://localhost:8765/callback(or another port — just be consistent when the setup script asks).
Click Register, then copy the Application (client) ID from the Overview page.
Go to API permissions → + Add a permission → Microsoft Graph → Delegated permissions, and add:
Mail.ReadMail.ReadWriteMail.Sendoffline_access(often present by default)
Personal Microsoft account delegated permissions like these don't need admin consent — you consent yourself during sign-in in step 3 below.
(Optional, advanced) If you'd rather use a confidential client with a client secret instead of the public-client PKCE flow, add a Web platform redirect URI and create a secret under Certificates & secrets. Most people should skip this.
3. Run setup (auth + config)
npm run setupThis will:
Print the walkthrough above.
Prompt for the client ID (and optional secret / tenant / redirect URI), and save it to
~/.outlook-mcp-server/config.json.Open your browser to sign in and consent.
Verify the token works by calling
GET /me, printing your name/email.Print the JSON snippet to add to your Claude config (see below).
To re-authenticate later (revoked token, switching accounts, etc.) without re-entering the app registration details:
npm run login4. Build and register with Claude
npm run buildClaude Desktop — add to claude_desktop_config.json
(~/Library/Application Support/Claude/claude_desktop_config.json on
macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"outlook": {
"command": "node",
"args": ["/absolute/path/to/outlook-mcp-server/dist/src/index.js"]
}
}
}Claude Code:
claude mcp add outlook -- node /absolute/path/to/outlook-mcp-server/dist/src/index.jsRestart Claude Desktop / Claude Code. The tools below should now be available.
Tools
Tool | Description |
| List messages from a folder (default |
| Fetch the full content (body, all recipients) of one message by ID. |
| Free-text search ( |
| Send an email immediately ( |
| Create a draft in the Drafts folder without sending. |
| List mail folders and their IDs, for use with the |
All tools return JSON (as MCP text content) and surface Graph API errors as tool errors rather than crashing the server.
Tenant choice
By default this uses the consumers tenant
(https://login.microsoftonline.com/consumers), which only accepts
personal Microsoft accounts (Hotmail/Outlook.com/Live) — a work/school
account will be rejected at sign-in. If you need to support both personal
and Azure AD accounts, set the tenant to common during npm run setup
(or via OUTLOOK_MCP_TENANT=common). This project is designed and tested
for the personal-account (consumers) case.
Configuration reference
Everything can be set via npm run setup (written to
~/.outlook-mcp-server/config.json) or via environment variables, which
take precedence — see .env.example:
Variable | Purpose |
| Azure app registration's client ID. |
| Only if using a confidential client (Web platform). |
|
|
| Must match the Azure app registration. |
| Where config/token cache are stored. Defaults to |
Security notes
The token cache is encrypted at rest with a locally-generated AES-256-GCM key (
~/.outlook-mcp-server/cache.key, mode0600). This protects against casual disclosure — accidental commits, backups, other unprivileged users on a shared machine — but not against an attacker who already has read access to your user account's files, since the key sits next to the encrypted cache. For stronger protection, swap theICachePlugininsrc/auth/tokenCache.tsfor one backed by your OS keychain (e.g. viakeytar) — the plugin interface is intentionally isolated to that one file.Never commit
~/.outlook-mcp-server/(it's outside the repo by default) or a.envfile containingOUTLOOK_MCP_CLIENT_SECRET.send_messagesends immediately with no confirmation step inside this server — Claude is expected to confirm intent with you before calling it for anything sensitive. Prefercreate_draftwhen you want a review step.Requested scopes are limited to
Mail.Read,Mail.ReadWrite,Mail.Send, andoffline_access— no calendar, contacts, or broaderMail.*application-level access.
Troubleshooting
AADSTS50020/ "user account ... does not exist in tenant" — you're hitting a tenant that doesn't accept personal accounts, or you're signing in with a work/school account againstconsumers. Confirm the app registration's "Supported account types" is "Personal Microsoft accounts only" and thatOUTLOOK_MCP_TENANTisconsumers(orcommonif you intentionally want both).AADSTS50011/ redirect URI mismatch — theredirectUriin~/.outlook-mcp-server/config.jsonmust exactly match a redirect URI configured on the Azure app registration, including the port."Not signed in" tool errors — run
npm run login.Port already in use during setup/login — another process is using the redirect URI's port; stop it, or reconfigure the app registration and
npm run setupwith a different port.
Development
npm run dev # run the MCP server directly from TypeScript (stdio)
npm run build # compile to dist/
npm run clean # remove dist/Project structure
src/
index.ts MCP server entrypoint (stdio transport)
config.ts Config loading (env + config file)
auth/
crypto.ts AES-256-GCM file encryption helpers
tokenCache.ts MSAL ICachePlugin backed by crypto.ts
msalClient.ts MSAL app factory + silent token acquisition
loginFlow.ts Interactive loopback OAuth flow
graph/
client.ts Generic Microsoft Graph fetch wrapper
mail.ts Mail-specific Graph calls
types.ts Graph response types
tools/ One file per MCP tool, registered in index.ts
scripts/
setup.ts Interactive one-time (and re-runnable) setupMaintenance
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
- AlicenseBqualityCmaintenanceA MCP server for Claude that reads Outlook emails its attachments through the Microsoft Graph API.616MIT
- FlicenseNot gradedqualityDmaintenanceA Python-based MCP server for Microsoft Outlook integration using Microsoft Graph API, enabling email reading/sending, calendar management, and contact operations through Claude Desktop.1
- AlicenseNot gradedqualityDmaintenanceMCP server that enables Claude to manage Outlook emails, including reading, sending, organizing, drafting, and bulk operations via Microsoft Graph API.151MIT
- AlicenseAqualityBmaintenanceAn MCP server that gives Claude Code and Codex full control of a personal Outlook.com mailbox and calendar via the Microsoft Graph API, enabling mail, draft, folder, and calendar operations through natural language.311MIT
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
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/acangialosi/outlook-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server