Microsoft 365 MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
pip install -r requirements.txt
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "MS_CLIENT_ID=${MS_CLIENT_ID}" -e "MS_TENANT_ID=${MS_TENANT_ID}" ms365-mcp-server -- python "<FULL_PATH_TO_MS365_MCP_SERVER>/dist/index.js"

Replace <FULL_PATH_TO_MS365_MCP_SERVER>/dist/index.js with the actual folder you prepared in step 1.

Required:MS_CLIENT_IDMS_TENANT_ID
README.md

Access Microsoft 365 email and calendar services via Microsoft Graph API.

Microsoft 365 MCP Server

An MCP server that gives Claude Desktop and Claude Code access to your Microsoft 365 email (Outlook) and calendar via Microsoft Graph API.

Quick Start Overview

Setting up this MCP server requires two main steps:

  1. Azure AD Setup (5-10 minutes, one-time): Create an app registration in Azure to get your credentials
  2. Local Installation (5 minutes): Install the server and configure Claude Desktop or Claude Code

Both are detailed below with step-by-step instructions.

Tools Included

Tool Description
ms365_list_emails List emails from any folder (inbox, sent, etc.)
ms365_read_email Read full email content by ID
ms365_search_emails Search emails by keyword
ms365_send_email Send an email
ms365_create_draft Create a draft email without sending
ms365_reply_email Reply to an email
ms365_list_mail_folders List all mail folders with counts
ms365_list_events List calendar events in a date range
ms365_get_event Get full event details
ms365_list_calendars List all calendars
ms365_find_free_time Check free/busy for people
ms365_get_profile Get your Microsoft 365 profile

Azure AD Setup (Required First)

Before you can use this MCP server, you need to create an Azure AD App Registration to get your MS_CLIENT_ID and MS_TENANT_ID. This only needs to be done once.

Step 1: Create the App Registration

  1. Go to the Azure Portal

  2. Access App Registrations

    • In the top search bar, type "App registrations"
    • Click on App registrations from the search results
  3. Create New Registration

    • Click "+ New registration" button at the top
    • Fill in the registration form:
      • Name: MS365 MCP Server (or any name you prefer)
      • Supported account types: Select "Accounts in this organizational directory only (Single tenant)"
      • Redirect URI:
        • Select "Mobile and desktop applications" from the dropdown
        • Enter: http://localhost
    • Click "Register" button
  4. Copy Your Credentials

    • You'll be taken to the app's Overview page
    • Copy and save these two values (you'll need them later):
      • Application (client) ID → This is your MS_CLIENT_ID
      • Directory (tenant) ID → This is your MS_TENANT_ID
    • Keep these values handy — you'll use them in the setup steps below

Step 2: Set API Permissions

  1. Navigate to API Permissions

    • In the left sidebar, click "API permissions"
  2. Add Microsoft Graph Permissions

    • Click "+ Add a permission"
    • Select "Microsoft Graph"
    • Select "Delegated permissions"
  3. Add Required Permissions

    • Search for and add each of these permissions:
      • Mail.Read - Read your emails
      • Mail.ReadWrite - Create and manage email drafts
      • Mail.Send - Send emails from your account
      • Calendars.Read - Read your calendar
      • User.Read - Read basic profile information
    • Click "Add permissions" when done
  4. Grant Admin Consent

    • Back on the API permissions page, look for the "Grant admin consent for [Your Organization]" button
    • If you're an admin: Click the button and confirm
    • If you're not an admin: Ask your IT administrator to grant consent
    • You should see green checkmarks under the "Status" column for all permissions

Step 3: Verify Your Setup

Your Azure configuration is complete when you have:

  • ✅ Application (client) ID copied
  • ✅ Directory (tenant) ID copied
  • ✅ All five permissions added and granted (green checkmarks)

Now you're ready to proceed with the local installation!


Local Installation

Prerequisites

  • Python 3.10+
  • Claude Desktop or Claude Code CLI installed
  • MS_CLIENT_ID and MS_TENANT_ID from Azure setup above

Step 1: Clone or Download the Project

Copy the ms365-mcp-server folder to a permanent location on your machine:

# Example: put it in your home directory
cp -r ms365-mcp-server ~/ms365-mcp-server
cd ~/ms365-mcp-server

Step 2: Create a Virtual Environment and Install Dependencies

cd ~/ms365-mcp-server
python3 -m venv .venv
source .venv/bin/activate       # macOS/Linux
# .venv\Scripts\activate        # Windows

pip install -r requirements.txt

Step 3: First-Time Authentication

Run the server once manually to complete the interactive Microsoft login:

cd ~/ms365-mcp-server
source .venv/bin/activate

export MS_CLIENT_ID="your-client-id-here"
export MS_TENANT_ID="your-tenant-id-here"

python server.py

This will open your browser for Microsoft login. Sign in and grant permissions. Once done, a token_cache.json file is created — this stores your refresh token so you won't need to log in again (token

Tools (12)

ms365_list_emailsList emails from any folder (inbox, sent, etc.)
ms365_read_emailRead full email content by ID
ms365_search_emailsSearch emails by keyword
ms365_send_emailSend an email
ms365_create_draftCreate a draft email without sending
ms365_reply_emailReply to an email
ms365_list_mail_foldersList all mail folders with counts
ms365_list_eventsList calendar events in a date range
ms365_get_eventGet full event details
ms365_list_calendarsList all calendars
ms365_find_free_timeCheck free/busy for people
ms365_get_profileGet your Microsoft 365 profile

Environment Variables

MS_CLIENT_IDrequiredApplication (client) ID from Azure AD App Registration
MS_TENANT_IDrequiredDirectory (tenant) ID from Azure AD App Registration

Configuration

claude_desktop_config.json
{"mcpServers": {"ms365": {"command": "python", "args": ["/path/to/ms365-mcp-server/server.py"], "env": {"MS_CLIENT_ID": "your-client-id", "MS_TENANT_ID": "your-tenant-id"}}}}

Try it

List the unread emails in my inbox.
Check my calendar for any meetings scheduled for tomorrow.
Find the email from my manager about the project deadline and summarize it.
Draft a reply to the last email I received thanking them for the update.
Check if I am free for a meeting at 2 PM on Friday.

Frequently Asked Questions

What are the key features of Microsoft 365 MCP Server?

Read and manage Outlook emails including drafts and replies. Search email folders and content using keywords. Access and list calendar events within specific date ranges. Check availability and free/busy status for contacts. Retrieve Microsoft 365 user profile information.

What can I use Microsoft 365 MCP Server for?

Automating email summaries and drafting responses directly from Claude. Quickly checking calendar availability without switching windows. Searching through historical email threads using natural language queries. Managing meeting schedules by querying calendar events via AI.

How do I install Microsoft 365 MCP Server?

Install Microsoft 365 MCP Server by running: pip install -r requirements.txt

What MCP clients work with Microsoft 365 MCP Server?

Microsoft 365 MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Microsoft 365 MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare