outlook-mcp
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-mcplist my unread emails from this week"
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
MCP server for Claude that provides full Outlook email management via Microsoft Graph API. Read, send, organize, draft, and bulk-manage emails — all from Claude Code or Claude Desktop.
Quick Install
claude mcp add outlook -e OUTLOOK_CLIENT_ID=your_client_id -- npx -y @hamzashahbaz/outlook-mcpRelated MCP server: Claude-Read-Outlook-Attachments
Features
19 tools for complete email management:
Reading
Tool | Description |
| List emails in a folder with pagination and OData filters |
| Get full email details by message ID |
| Search emails using KQL queries |
| List all mail folders with unread counts |
Sending
Tool | Description |
| Send a new email to one or more recipients |
| Reply to an email (reply or reply-all) |
| Forward an email to new recipients |
Drafts
Tool | Description |
| Create a draft email (saved, not sent) |
| Update an existing draft |
| Send a previously created draft |
| Delete a draft |
Organization
Tool | Description |
| Move a message to a different folder |
| Delete a message (moves to Deleted Items) |
| Mark as read/unread, flag/unflag |
| Mark all messages in a folder as read |
| Create a new mail folder |
| Permanently delete all messages in a folder |
Bulk Operations
Tool | Description |
| Move all emails from a sender domain to a folder |
| Move emails matching a KQL search query to a folder |
Prerequisites
Node.js 18+
Azure App Registration with device code flow enabled
Setup
Azure App Registration
Go to Azure Portal > App Registrations > New Registration
Name:
Outlook MCP(or anything you like)Supported account types: Personal Microsoft accounts only (or include organizational if needed)
Redirect URI: Leave blank (device code flow doesn't need one)
Under Authentication > Advanced settings:
Enable Allow public client flows (required for device code)
Under API Permissions, add Microsoft Graph delegated permissions:
Mail.ReadWriteMail.SendUser.Read
Copy the Application (client) ID — this is your
OUTLOOK_CLIENT_ID
Authentication
On first run, the server initiates an OAuth 2.0 device code flow:
A URL and code are displayed in stderr output
Open the URL in your browser and enter the code
Sign in with your Microsoft account and grant permissions
Tokens are saved automatically for future use
Tokens auto-refresh using the refresh token. If a refresh fails (e.g., token revoked), delete the token file and restart — the device code flow will trigger again.
Configuration
Claude Code
Add via CLI (recommended):
claude mcp add outlook -e OUTLOOK_CLIENT_ID=your_client_id -- npx -y @hamzashahbaz/outlook-mcpOr add manually to .mcp.json:
{
"mcpServers": {
"outlook": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@hamzashahbaz/outlook-mcp"],
"env": {
"OUTLOOK_CLIENT_ID": "your_client_id"
}
}
}
}Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"outlook": {
"command": "npx",
"args": ["-y", "@hamzashahbaz/outlook-mcp"],
"env": {
"OUTLOOK_CLIENT_ID": "your_client_id"
}
}
}
}Token Storage
Tokens are stored at ~/.outlook-mcp/.tokens.json with 600 permissions (owner read/write only). This location persists across npx invocations.
The file contains:
Access token — short-lived, auto-refreshed
Refresh token — long-lived, used to obtain new access tokens
To re-authenticate, delete the token file:
rm ~/.outlook-mcp/.tokens.jsonFolder Names
Standard Outlook folder names: Inbox, SentItems, Drafts, DeletedItems, Archive, JunkEmail
Custom folders use the display name as created.
Troubleshooting
"OUTLOOK_CLIENT_ID environment variable is required"
Set OUTLOOK_CLIENT_ID in your MCP configuration's env block.
Authentication expired
Delete the token file and restart:
rm ~/.outlook-mcp/.tokens.jsonThe device code flow will trigger again on next use.
"Insufficient privileges"
Check your Azure App Registration > API Permissions. Ensure Mail.ReadWrite and Mail.Send are granted. For organizational accounts, admin consent may be required.
Rate limited
Microsoft Graph enforces rate limits. The server reports the Retry-After header value. Wait and retry.
Known Limitations
Cannot delete mail folders — Microsoft Graph API does not support folder deletion for personal accounts
Search pagination — KQL search results are limited to 25 per request (the server handles pagination internally)
Bulk operations — Process up to 200-500 messages per call to avoid timeouts
How It Works
API: Microsoft Graph API v1.0
Auth: OAuth 2.0 device code flow
Protocol: Model Context Protocol (MCP) over stdio
Validation: Zod schemas for all tool inputs
Built for: Claude Code and Claude Desktop
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/hamzashahbaz/outlook-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server