Microsoft 365 MCP
Microsoft 365 integration allows KIRA to access Outlook, OneDrive, SharePoint, and Calendar.
MS365 MCP
Interactive OAuth method for easy authentication.
📋 Prerequisites
- Microsoft 365 account
- Azure Portal access (for app registration)
🔑 Step 1: Register Azure App
1. Access Azure Portal
- Go to Azure Portal
- Log in
2. Create App Registration
- Search for "Azure Active Directory"
- Click "App registrations" in left menu
- Click "New registration"
3. App Registration Settings
- Name:
KIRA Bot(any name) - Supported account types:
- Internal only: "Accounts in this organizational directory only"
- All accounts: "Accounts in any organizational directory"
- Redirect URI:
- Public client/native:
http://localhost
- Public client/native:
- Click "Register"
4. Copy Application (client) ID
- Copy "Application (client) ID"
- Save for later
5. Copy Tenant ID
- Copy "Directory (tenant) ID"
- Save for later
6. Authentication Settings (Important!)
- Click "Authentication" in left menu
- Find "Advanced settings" section
- Set "Allow public client flows" to "Yes"
- Click "Save"
Interactive OAuth
MS365 MCP uses Interactive OAuth, so Client Secret is not required. Instead, "Allow public client flows" must be enabled.
7. API Permissions Setup
Click "API permissions" in left menu
Click "Add a permission"
Select "Microsoft Graph"
Select "Delegated permissions"
Add these permissions:
Mail (Outlook)
- ✅
Mail.Read- Read mail - ✅
Mail.ReadWrite- Read/write mail - ✅
Mail.Send- Send mail
Files (OneDrive/SharePoint)
- ✅
Files.Read- Read files - ✅
Files.Read.All- Read all files - ✅
Files.ReadWrite- Read/write files - ✅
Files.ReadWrite.All- Read/write all files - ✅
Sites.Read.All- Read SharePoint sites - ✅
Sites.ReadWrite.All- Read/write SharePoint sites
Calendar
- ✅
Calendars.Read- Read calendars - ✅
Calendars.ReadWrite- Read/write calendars
User
- ✅
User.Read- Read user info
- ✅
Click "Add permissions"
Admin Consent
For organizational accounts, admin approval may be required. Click "Grant admin consent" button to approve.
⚙️ Step 2: Configure KIRA
1. Launch KIRA App
Open the Environment Variables tab.
2. Find Microsoft 365 Section
MCP Settings > Microsoft 365 (Outlook, OneDrive, SharePoint)
3. Enable Setting
- Turn the toggle switch ON
4. Enter Azure Information
- MS365_CLIENT_ID: Application (client) ID
- MS365_TENANT_ID: Directory (tenant) ID
Client Secret Not Required
MS365 MCP uses Interactive OAuth, so Client Secret is not needed.
5. Save Settings
- Click "Save Settings" button
- Restart server
✅ Step 3: Complete Authentication with Test Question
After saving settings and starting the server, complete authentication by asking a test question.
Test Question Example
Ask KIRA in Slack:
Show me my last 3 emailsAuthentication Process
- When KIRA first accesses Microsoft 365, a browser opens automatically
- Log in with your account on the Microsoft login page
- Click "Accept" on the permission approval screen
- After authentication, you can close the browser
- Return to Slack and KIRA will respond with results
Authentication on KIRA's Computer
The browser opens on the computer where KIRA is running. If running on your own computer, you can authenticate directly.
One-Time Authentication
Auth tokens are stored securely, and authentication is automatic thereafter. Tokens are auto-refreshed when expired.
🎯 Usage Examples
📧 Outlook - Email
Read Emails
User: Show me last 5 emails
KIRA: [Outlook query]
1. [Important] Project Meeting - John Doe
2. Weekly Report - Jane Smith
...Search Emails
User: Search for emails with "invoice" keyword
KIRA: [Outlook search]
1. Invoice #1234 - Accounting
2. Payment Invoice - FinanceSend Email
User: Send email to john@company.com
Subject: Meeting Schedule
Body: Are you available for a meeting tomorrow at 2pm?
KIRA: [Outlook sent] Email sent successfully.Reply to Email
User: Reply to the latest email: "Got it, thank you"
KIRA: [Outlook reply] Reply sent successfully.📁 OneDrive - File Management
File List
User: Show me OneDrive root folder files
KIRA: [OneDrive query]
1. Project_Plan.docx
2. Budget.xlsx
3. Presentation.pptxSearch Files
User: Find "meeting notes" file in OneDrive
KIRA: [OneDrive search]
1. 2024_Q1_Meeting_Notes.docx
2. Executive_Meeting_Notes_0315.pdfDownload File
User: Download "Contract.pdf" from OneDrive
KIRA: [OneDrive download] Contract.pdf downloaded successfully.📄 SharePoint - Collaboration Documents
SharePoint Site List
User: Show me SharePoint site list
KIRA: [SharePoint query]
1. Team Site - https://company.sharepoint.com/team
2. Project Site - https://company.sharepoint.com/projectSharePoint File Search
User: Find "quarterly report" in SharePoint
KIRA: [SharePoint search]
1. Q1_Report_Final.docx - Team Site
2. Quarterly_Performance_Report.xlsx - Project Site📅 Calendar - Schedule Management
View Schedule
User: Show me today's schedule
KIRA: [Calendar query]
1. 10:00 - Team Meeting (Room A)
2. 14:00 - Client Meeting (Zoom)
3. 16:00 - 1:1 MeetingCreate Schedule
User: Schedule project kickoff meeting tomorrow at 3pm
KIRA: [Calendar created] Schedule added successfully.🔧 Troubleshooting
"Authentication failed"
- Verify Client ID and Tenant ID
- Check if app is active in Azure Portal
- Confirm "Allow public client flows" is set to Yes
"Insufficient permissions"
- Check Azure Portal > API Permissions
- Verify all required permissions are added
- Confirm Admin Consent is approved
OAuth Browser Not Opening
- Check if firewall is blocking localhost
- Disable browser popup blocker
- Check logs for error messages
"Redirect URI mismatch"
- Check Redirect URI in Azure App Registration
- Enter exactly
http://localhost - Verify Platform is "Public client/native"
💡 Tips
Security Best Practices
- Apply principle of least privilege
- Grant only necessary permissions
- Review permissions regularly
Efficient Usage
- Save SharePoint URLs in advance
- Example:
https://company-my.sharepoint.com/
- Example:
- Specify clear keywords when searching emails
- Organize OneDrive folder structure
- Utilize auto-categorization features
Using Organizational Accounts
- Request app approval from IT admin
- Review organizational policies
- Configure Multi-factor Authentication