Microsoft 365 MCP server

Integrates with Microsoft 365 services including Outlook, Calendar, OneDrive, and Contacts to enable email management, calendar operations, file handling, and contact management with multi-account authentication and advanced search capabilities.
Back to servers
Setup instructions
Provider
elyx
Release date
Jun 23, 2025
Language
Go
Stats
7 stars

Microsoft MCP server integrates with Microsoft Graph API to provide AI assistants with comprehensive access to Outlook, Calendar, OneDrive, and Contacts. It offers a complete toolkit for managing emails, calendar events, files, and contacts across multiple Microsoft accounts.

Installation

Azure App Registration

Before installing the MCP server, you need to register an application in Azure:

  1. Go to Azure Portal → Microsoft Entra ID → App registrations
  2. Create a new registration with name "microsoft-mcp"
  3. Set supported account types to: Personal + Work/School
  4. Under Authentication, allow public client flows
  5. Add these delegated API permissions:
    • Mail.ReadWrite
    • Calendars.ReadWrite
    • Files.ReadWrite
    • Contacts.Read
    • People.Read
    • User.Read
  6. Copy the Application ID for later use

Setting Up with Claude Desktop

The easiest way to install is through Claude Desktop:

# Add Microsoft MCP server (replace with your Azure app ID)
claude mcp add microsoft-mcp -e MICROSOFT_MCP_CLIENT_ID=your-app-id-here -- uvx --from git+https://github.com/elyxlz/microsoft-mcp.git microsoft-mcp

# Start Claude Desktop
claude

Manual Installation

If you prefer a manual setup:

  1. Clone the repository:

    git clone https://github.com/elyxlz/microsoft-mcp.git
    cd microsoft-mcp
    uv sync
    
  2. Set your Azure app ID and run authentication:

    export MICROSOFT_MCP_CLIENT_ID="your-app-id-here"
    uv run authenticate.py
    
  3. Follow the prompts to authenticate your Microsoft accounts

  4. Add to your Claude Desktop configuration:

    macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

    {
      "mcpServers": {
        "microsoft": {
          "command": "uvx",
          "args": ["--from", "git+https://github.com/elyxlz/microsoft-mcp.git", "microsoft-mcp"],
          "env": {
            "MICROSOFT_MCP_CLIENT_ID": "your-app-id-here"
          }
        }
      }
    }
    

Usage

Basic Usage Examples

# Email examples
> read my latest emails with full content
> reply to the email from John saying "I'll review this today"
> send an email with attachment to [email protected]

# Calendar examples  
> show my calendar for next week
> check if I'm free tomorrow at 2pm
> create a meeting with Bob next Monday at 10am

# File examples
> list files in my OneDrive
> upload this report to OneDrive
> search for "project proposal" across all my files

# Multi-account
> list all my Microsoft accounts
> send email from my work account

Multi-Account Support

All tools require an account_id parameter as the first argument:

# List accounts to get IDs
accounts = list_accounts()
account_id = accounts[0]["account_id"]

# Use account for operations
send_email(account_id, "[email protected]", "Subject", "Body")
list_emails(account_id, limit=10, include_body=True)
create_event(account_id, "Meeting", "2024-01-15T10:00:00Z", "2024-01-15T11:00:00Z")

Available Tools

Email Tools

  • list_emails - List emails with optional body content
  • get_email - Get specific email with attachments
  • create_email_draft - Create email draft with attachments support
  • send_email - Send email immediately with CC/BCC and attachments
  • reply_to_email - Reply maintaining thread context
  • reply_all_email - Reply to all recipients in thread
  • update_email - Mark emails as read/unread
  • move_email - Move emails between folders
  • delete_email - Delete emails
  • get_attachment - Get email attachment content
  • search_emails - Search emails by query

Calendar Tools

  • list_events - List calendar events with details
  • get_event - Get specific event details
  • create_event - Create events with location and attendees
  • update_event - Reschedule or modify events
  • delete_event - Cancel events
  • respond_event - Accept/decline/tentative response to invitations
  • check_availability - Check free/busy times for scheduling
  • search_events - Search calendar events

Contact Tools

  • list_contacts - List all contacts
  • get_contact - Get specific contact details
  • create_contact - Create new contact
  • update_contact - Update contact information
  • delete_contact - Delete contact
  • search_contacts - Search contacts by query

File Tools

  • list_files - Browse OneDrive files and folders
  • get_file - Download file content
  • create_file - Upload files to OneDrive
  • update_file - Update existing file content
  • delete_file - Delete files or folders
  • search_files - Search files in OneDrive

Utility Tools

  • unified_search - Search across emails, events, and files
  • list_accounts - Show authenticated Microsoft accounts
  • authenticate_account - Start authentication for a new Microsoft account
  • complete_authentication - Complete the authentication process after entering device code

Advanced Usage Examples

Email Management

# Get account ID first
accounts = list_accounts()
account_id = accounts[0]["account_id"]

# List latest emails with full content
emails = list_emails(account_id, limit=10, include_body=True)

# Reply maintaining thread
reply_to_email(account_id, email_id, "Thanks for your message. I'll review and get back to you.")

# Forward with attachments
email = get_email(email_id, account_id)
attachments = [get_attachment(email_id, att["id"], account_id) for att in email["attachments"]]
send_email(account_id, "[email protected]", f"FW: {email['subject']}", email["body"]["content"], attachments=attachments)

Calendar Management

# Get account ID first
accounts = list_accounts()
account_id = accounts[0]["account_id"]

# Check availability before scheduling
availability = check_availability(account_id, "2024-01-15T10:00:00Z", "2024-01-15T18:00:00Z", ["[email protected]"])

# Create meeting with details
create_event(
    account_id,
    "Project Review",
    "2024-01-15T14:00:00Z", 
    "2024-01-15T15:00:00Z",
    location="Conference Room A",
    body="Quarterly review of project progress",
    attendees=["[email protected]", "[email protected]"]
)

Troubleshooting

  • Authentication fails: Check your CLIENT_ID is correct
  • "Need admin approval": Use MICROSOFT_MCP_TENANT_ID=consumers for personal accounts
  • Missing permissions: Ensure all required API permissions are granted in Azure
  • Token errors: Delete ~/.microsoft_mcp_token_cache.json and re-authenticate

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "microsoft" '{"command":"uvx","args":["--from","git+https://github.com/elyxlz/microsoft-mcp.git","microsoft-mcp"],"env":{"MICROSOFT_MCP_CLIENT_ID":"your-app-id-here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "microsoft": {
            "command": "uvx",
            "args": [
                "--from",
                "git+https://github.com/elyxlz/microsoft-mcp.git",
                "microsoft-mcp"
            ],
            "env": {
                "MICROSOFT_MCP_CLIENT_ID": "your-app-id-here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "microsoft": {
            "command": "uvx",
            "args": [
                "--from",
                "git+https://github.com/elyxlz/microsoft-mcp.git",
                "microsoft-mcp"
            ],
            "env": {
                "MICROSOFT_MCP_CLIENT_ID": "your-app-id-here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later