Skip to content

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

  1. Go to Azure Portal
  2. Log in

2. Create App Registration

  1. Search for "Azure Active Directory"
  2. Click "App registrations" in left menu
  3. 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
  • 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!)

  1. Click "Authentication" in left menu
  2. Find "Advanced settings" section
  3. Set "Allow public client flows" to "Yes"
  4. 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

  1. Click "API permissions" in left menu

  2. Click "Add a permission"

  3. Select "Microsoft Graph"

  4. Select "Delegated permissions"

  5. 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
  6. 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 emails

Authentication Process

  1. When KIRA first accesses Microsoft 365, a browser opens automatically
  2. Log in with your account on the Microsoft login page
  3. Click "Accept" on the permission approval screen
  4. After authentication, you can close the browser
  5. 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 - Finance

Send 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.pptx

Search Files

User: Find "meeting notes" file in OneDrive
KIRA: [OneDrive search]
      1. 2024_Q1_Meeting_Notes.docx
      2. Executive_Meeting_Notes_0315.pdf

Download 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/project
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 Meeting

Create 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/
  • 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