Microsoft 365 Outlook MCP Server
Create a powerful Model Context Protocol (MCP) server for Microsoft Outlook in minutes with our AI Gateway. This guide walks you through setting up seamless email and calendar integration with enterprise-grade security and instant OAuth authentication.
About Microsoft Outlook API
Microsoft Outlook API (via Microsoft Graph) provides comprehensive access to email, calendar, contacts, and tasks within Microsoft 365. It enables powerful integrations for productivity and communication across the enterprise.
Key Capabilities
- Mail Management: Read, send, and organize emails
- Calendar Operations: Schedule meetings and manage events
- Contact Management: Access and update address books
- Task Tracking: Create and manage to-do items
- Folder Organization: Manage mail folders and categories
- Rules & Filters: Automate email processing
- Attachments: Handle files and inline images
- Search: Advanced email and calendar search
API Features
- Microsoft Graph: Unified API endpoint
- Delta Queries: Track incremental changes
- Webhooks: Real-time notifications
- Batch Requests: Efficient bulk operations
- Immersive Reader: Accessibility features
- Focused Inbox: AI-powered prioritization
- Message Encryption: Security features
- Mail Tips: Recipient insights
What You Can Do with Microsoft Outlook MCP Server
The MCP server transforms Outlook API into a natural language interface, enabling AI agents to:
Email Management
-
Message Operations
- "Send email to team about project update"
- "Reply to latest message from John"
- "Forward meeting notes to participants"
- "Create draft for weekly report"
-
Inbox Organization
- "Move all newsletters to Reading folder"
- "Flag important emails from clients"
- "Mark promotional emails as read"
- "Archive emails older than 6 months"
-
Search & Filter
- "Find all emails with attachments from last week"
- "Show unread messages from manager"
- "Search for invoices in email"
- "List emails with specific subject keywords"
Calendar Integration
-
Event Management
- "Schedule meeting with team next Tuesday"
- "Check calendar availability for tomorrow"
- "Create recurring weekly standup"
- "Book conference room for presentation"
-
Meeting Coordination
- "Find time when all attendees are free"
- "Send meeting invitation with agenda"
- "Update meeting location to virtual"
- "Cancel tomorrow's 3 PM appointment"
-
Calendar Views
- "Show all meetings for next week"
- "List today's appointments"
- "Display shared calendar events"
- "Check team member availability"
Contact Management
-
Contact Operations
- "Add new contact from email signature"
- "Update phone number for client"
- "Create contact group for project team"
- "Import contacts from CSV file"
-
Distribution Lists
- "Create mailing list for department"
- "Add members to team distribution"
- "Remove inactive users from list"
- "Export contact list to Excel"
-
Contact Intelligence
- "Show recent emails from contact"
- "Find all communications with company"
- "Track interaction history"
- "Display contact's organization chart"
Task Management
-
Task Creation
- "Create task from email action item"
- "Add follow-up reminder for tomorrow"
- "Set deadline for project deliverable"
- "Assign task to team member"
-
Task Organization
- "Show all tasks due this week"
- "Mark completed tasks"
- "Prioritize urgent items"
- "Create task list for project"
-
Integration
- "Convert email to task"
- "Link task to calendar event"
- "Create tasks from meeting notes"
- "Sync with Microsoft To Do"
Folder & Category Management
-
Folder Operations
- "Create folder for project emails"
- "Move emails to appropriate folders"
- "Set up folder hierarchy"
- "Apply retention policies"
-
Categories
- "Tag emails by project"
- "Color-code by priority"
- "Categorize calendar events"
- "Filter by category"
-
Rules & Automation
- "Create rule to filter newsletters"
- "Auto-forward specific emails"
- "Set out-of-office reply"
- "Configure junk mail settings"
Analytics & Insights
-
Email Analytics
- "Show email volume trends"
- "Track response times"
- "Analyze sender patterns"
- "Monitor inbox zero progress"
-
Calendar Analytics
- "Calculate time in meetings"
- "Show meeting frequency"
- "Track attendance rates"
- "Analyze scheduling patterns"
-
Productivity Insights
- "Show focus time available"
- "Track email habits"
- "Monitor after-hours work"
- "Suggest productivity improvements"
Prerequisites
- Access to Cequence AI Gateway
- Microsoft 365 subscription
- Azure AD application registration permissions
- Outlook/Exchange Online access
Step 1: Register Azure AD Application
1.1 Access Azure Portal
- Navigate to portal.azure.com
- Sign in with Microsoft 365 admin account
- Go to Azure Active Directory
1.2 Register Application
- Navigate to App registrations
- Click New registration
- Configure:
- Name: "AI Gateway Outlook MCP"
- Supported account types: Based on needs
- Redirect URI: Web platform
https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
1.3 Configure API Permissions
- Go to API permissions
- Click Add a permission
- Select Microsoft Graph
- Choose Delegated permissions
- Add required permissions (see scopes section)
- Grant admin consent if needed
1.4 Create Client Secret
- Go to Certificates & secrets
- Click New client secret
- Add description and expiration
- Copy the secret value immediately
Step 2-4: Standard Setup
Follow standard steps to access AI Gateway, find Outlook API, and create MCP server.
Step 5: Configure API Endpoints
- Base URL:
https://graph.microsoft.com/v1.0
- Select Outlook-related endpoints
- Click Next
Step 6: MCP Server Configuration
- Name: "Microsoft Outlook Integration"
- Description: "Email and calendar management"
- Configure production mode
- Click Next
Step 7: Configure Authentication
- Authentication Type: OAuth 2.0
- Authorization URL:
https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/authorize
- Token URL:
https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token
- Enter Client ID and Secret
- Select required scopes
Available Microsoft Outlook OAuth Scopes
Mail Permissions
-
Mail.Read
- Read user mail
- Access folders
- View attachments
- Search messages
-
Mail.ReadWrite
- All read permissions
- Create and send mail
- Update messages
- Manage folders
-
Mail.Send
- Send mail as user
- Use send-as permissions
- Send on behalf
- Schedule sending
Calendar Permissions
-
Calendars.Read
- View calendars
- Read events
- Check free/busy
- Access shared calendars
-
Calendars.ReadWrite
- All read permissions
- Create events
- Update meetings
- Manage calendars
Contact Permissions
-
Contacts.Read
- View contacts
- Access address book
- Read contact folders
- Export contacts
-
Contacts.ReadWrite
- All read permissions
- Create contacts
- Update information
- Manage groups
Additional Permissions
-
Tasks.ReadWrite
- Manage tasks
- Create to-do items
- Update status
- Set reminders
-
MailboxSettings.ReadWrite
- Configure settings
- Manage rules
- Set signatures
- Update preferences
Recommended Scope Combinations
For Email Management:
Mail.ReadWrite
Mail.Send
MailboxSettings.Read
User.Read
For Full Outlook Access:
Mail.ReadWrite
Mail.Send
Calendars.ReadWrite
Contacts.ReadWrite
Tasks.ReadWrite
MailboxSettings.ReadWrite
User.Read
For Read-Only Access:
Mail.Read
Calendars.Read
Contacts.Read
User.Read
Step 8-10: Complete Setup
Configure security, choose deployment, and deploy.
Using Your Microsoft Outlook MCP Server
With Claude Desktop
{
"servers": {
"outlook": {
"url": "your-mcp-server-url",
"auth": {
"type": "oauth2",
"client_id": "your-client-id"
}
}
}
}
Natural Language Commands
- "Send email to team about tomorrow's deadline"
- "Schedule meeting with clients next week"
- "Find all unread emails from my manager"
- "Create task from email about bug fix"
- "Show my calendar for tomorrow"
API Integration Example
// Initialize MCP client
const mcpClient = new MCPClient({
serverUrl: 'your-mcp-server-url',
auth: {
type: 'oauth2',
token: 'access-token'
}
});
// Send email
const message = await mcpClient.outlook.mail.send({
message: {
subject: 'Project Update',
body: {
contentType: 'HTML',
content: '<p>Here is the latest project status...</p>'
},
toRecipients: [
{
emailAddress: {
address: 'team@company.com',
name: 'Project Team'
}
}
],
attachments: [
{
'@odata.type': '#microsoft.graph.fileAttachment',
name: 'report.pdf',
contentType: 'application/pdf',
contentBytes: 'base64-encoded-content'
}
]
},
saveToSentItems: true
});
// Create calendar event
const event = await mcpClient.outlook.calendar.events.create({
subject: 'Team Planning Session',
body: {
contentType: 'HTML',
content: 'Quarterly planning meeting'
},
start: {
dateTime: '2025-02-15T14:00:00',
timeZone: 'Eastern Standard Time'
},
end: {
dateTime: '2025-02-15T16:00:00',
timeZone: 'Eastern Standard Time'
},
location: {
displayName: 'Conference Room A'
},
attendees: [
{
emailAddress: {
address: 'manager@company.com',
name: 'Team Manager'
},
type: 'required'
}
],
isOnlineMeeting: true,
onlineMeetingProvider: 'teamsForBusiness'
});
// Search emails
const searchResults = await mcpClient.outlook.mail.search({
$search: '"project proposal"',
$filter: 'hasAttachments eq true and receivedDateTime ge 2025-01-01',
$orderby: 'receivedDateTime desc',
$top: 20
});
// Create task
const task = await mcpClient.outlook.tasks.create({
subject: 'Review contract',
body: {
content: 'Review and approve vendor contract',
contentType: 'text'
},
dueDateTime: {
dateTime: '2025-02-20T17:00:00',
timeZone: 'UTC'
},
importance: 'high',
isReminderOn: true,
reminderDateTime: {
dateTime: '2025-02-20T09:00:00',
timeZone: 'UTC'
}
});
Common Use Cases
Email Automation
- Auto-categorization
- Smart filtering
- Template responses
- Follow-up reminders
Meeting Management
- Schedule coordination
- Room booking
- Agenda distribution
- Meeting summaries
Productivity Enhancement
- Inbox zero strategies
- Time blocking
- Task prioritization
- Communication analytics
Team Collaboration
- Shared calendars
- Group scheduling
- Email delegation
- Distribution lists
Security Best Practices
-
OAuth Security:
- Use least privilege
- Regular token refresh
- Secure storage
- Audit access
-
Data Protection:
- Email encryption
- Attachment scanning
- DLP policies
- Retention rules
-
Access Control:
- Conditional access
- MFA enforcement
- Device compliance
- Session management
Troubleshooting
Common Issues
-
Authentication Failures
- Verify tenant ID
- Check permissions
- Validate redirect URI
- Review consent
-
Permission Errors
- Confirm admin consent
- Check scope access
- Verify mailbox permissions
- Review sharing settings
-
Sync Problems
- Check connectivity
- Validate time zones
- Handle conflicts
- Monitor throttling
Getting Help
- Documentation: AI Gateway Docs
- Support: support@cequence.ai
- Microsoft Docs: Graph API Reference