loading…
Search for a command to run...
loading…
Comprehensive MCP server for Claude to access Microsoft Outlook and Teams via Microsoft Graph API - including Email, Calendar, Contacts, Tasks, Teams, Chats, an
Comprehensive MCP server for Claude to access Microsoft Outlook and Teams via Microsoft Graph API - including Email, Calendar, Contacts, Tasks, Teams, Chats, and Online Meetings
npm version License: MIT MCP Compatible
Developed by Asan Stefanski
A comprehensive Model Context Protocol (MCP) server that provides Claude with full access to Microsoft Outlook and Microsoft Teams through the Microsoft Graph API. This server offers 75+ tools across 8 modules, making it one of the most complete Microsoft 365 integrations available for Claude.
npm install -g outlook-mcp
git clone https://github.com/stefanskiasan/outlook-mcp.git
cd outlook-mcp
npm install
You need to register an application in Azure Portal:
http://localhost:3333/auth/callbackIn your Azure app, go to "API permissions" → "Add a permission" → "Microsoft Graph" → "Delegated permissions" and add:
Core Permissions:
offline_accessUser.ReadEmail & Calendar:
Mail.ReadMail.ReadWriteMail.SendCalendars.ReadCalendars.ReadWriteContacts & Tasks:
Contacts.ReadContacts.ReadWriteTasks.ReadTasks.ReadWriteTeams & Communication:
Team.ReadBasic.AllTeamMember.Read.AllChannel.ReadBasic.AllChannelMessage.Read.AllChannelMessage.SendChat.ReadChat.ReadWriteChatMessage.ReadChatMessage.SendPresence.ReadPresence.Read.AllOnlineMeetings.ReadWriteCreate a .env file in the project root:
MS_CLIENT_ID=your-client-id-here
MS_CLIENT_SECRET=your-client-secret-here
USE_TEST_MODE=false
Note: The system supports both MS_CLIENT_ID/MS_CLIENT_SECRET and OUTLOOK_CLIENT_ID/OUTLOOK_CLIENT_SECRET environment variables for backwards compatibility.
Add to your Claude Desktop config file:
{
"mcpServers": {
"outlook-mcp": {
"command": "npx",
"args": ["outlook-mcp"],
"env": {
"MS_CLIENT_ID": "your-client-id-here",
"MS_CLIENT_SECRET": "your-client-secret-here"
}
}
}
}
Note: The npx outlook-mcp command is designed to run as an MCP server via stdio and is meant to be used by Claude Desktop, not run directly from the command line.
First, authenticate with Microsoft:
Use the "authenticate" tool in Claude to get an authentication URL
The server provides 75+ tools across these categories:
list-emails, search-emails, read-email, send-emailreply-email, forward-email, delete-emaillist-attachments, download-attachmentlist-categories, create-category, delete-categorylist-drafts, create-draft, update-draft, delete-draftmark-read, mark-unreadlist-inbox-emails - Lists emails EXCLUSIVELY from inboxsearch-inbox-emails - Advanced inbox-only search with date ranges, names, descriptions and attachmentsbulk-delete-emails - Delete multiple emails at once with batch operationslist-events, search-events, create-event, update-eventdelete-event, accept-event, decline-event, tentative-eventlist-calendars, create-calendar, update-calendar, delete-calendarlist-contacts, search-contacts, read-contact, create-contactupdate-contact, delete-contact, list-contact-folders, create-contact-folderlist-tasks, create-task, update-task, delete-tasklist-task-lists, create-task-list, delete-task-listlist-teams, get-team-details, list-team-memberslist-channels, get-channel-details, create-channel, update-channel, delete-channellist-channel-messages, get-message-details, send-channel-message, reply-to-messagelist-chats, get-chat-details, list-chat-messages, send-chat-message, create-chatget-my-presence, get-user-presence, set-my-presence, get-multiple-users-presencelist-online-meetings, create-online-meeting, get-online-meeting, update-online-meeting, delete-online-meetinglist-folders - Display complete folder hierarchies with unlimited nesting levelscreate-folder - Create folders at any depth (e.g., Projects/2024/Client-Work/Invoices)move-emails - Move emails to deeply nested folders with automatic discoverylist-rules, create-rule, delete-rule"List my recent emails from today"
"Create a meeting for tomorrow at 2 PM with the development team"
"Send a message to the general channel in our project team"
"Show my current presence status"
"Create a task to review the quarterly report"
# Inbox-Only Email Examples:
"Show me my latest 20 inbox emails"
"Search for emails from John in my inbox only"
"List unread emails in my inbox"
"Find emails with attachments in my inbox"
"Search inbox emails from last week (dateStart: '2024-07-07', dateEnd: '2024-07-14')"
"Find inbox emails from Sarah between January 1-15 with attachments"
"Show inbox emails mentioning 'project' from the last 30 days"
# Bulk Operations Examples:
"Delete multiple emails: bulk-delete-emails with emailIds: 'id1,id2,id3'"
"Move multiple emails to Archive folder using move-emails"
"Bulk delete old emails with JSON batching for better performance"
# Advanced Folder Management Examples:
"Create a folder structure: Projects/2024/Client-Work/Invoices"
"Show me all folders with their hierarchy and email counts"
"Move these emails to the Photography subfolder in my Hobbies folder"
"Create an Archive folder inside my existing Work/Completed folder"
Create and manage complex folder structures with unlimited nesting levels:
# Create deep folder structures
create-folder: { "name": "2024", "parentFolder": "Projects" }
create-folder: { "name": "Client-Work", "parentFolder": "2024" }
create-folder: { "name": "Invoices", "parentFolder": "Client-Work" }
# Result: Projects/2024/Client-Work/Invoices
The system automatically finds folders at any depth:
# Works even with deeply nested folders
create-folder: { "name": "Archive", "parentFolder": "Invoices" }
move-emails: { "emailIds": "abc123", "targetFolder": "Archive" }
View complete folder trees with proper indentation:
list-folders: { "includeChildren": true, "includeItemCounts": true }
# Example output:
# Projects - 45 items
# 2024 - 32 items (5 unread)
# Client-Work - 28 items (3 unread)
# Invoices - 15 items
# Archive - 8 items
# Contracts - 13 items (3 unread)
# 2023 - 13 items
For development and testing without API calls:
npm run test-mode
This uses mock data to simulate all Microsoft Graph API responses.
outlook-mcp/
├── index.js # Main MCP server entry point
├── config.js # Configuration management
├── auth/ # Authentication & token management
├── email/ # Email functionality (20 tools)
├── calendar/ # Calendar management (12 tools)
├── contacts/ # Contacts management (8 tools)
├── tasks/ # Tasks/To-Do integration (7 tools)
├── teams/ # Teams integration (25 tools)
├── folder/ # Folder operations (3 tools)
├── rules/ # Rules management (3 tools)
└── utils/ # Graph API helpers & mock data
npm start # Start the MCP server
npm run auth-server # Start authentication server
npm run test-mode # Run in test mode with mock data
npm run inspect # Debug with MCP Inspector
npm test # Run tests
Authentication Errors:
.envPermission Errors:
API Errors:
npm run test-modeEnable verbose logging:
DEBUG=outlook-mcp npm start
MIT License - see LICENSE file for details.
Made with ❤️ by Asan Stefanski
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"outlook-mcp": {
"command": "npx",
"args": [
"-y",
"outlook-mcp"
]
}
}
}