MCP-365

Mo187/MCP-365

3.2

If you are the rightful owner of MCP-365 and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The MCP Microsoft 365 Server is a Model Context Protocol server designed to facilitate interaction between AI assistants and Microsoft 365 services, such as Outlook and SharePoint.

MCP Microsoft 365 Server

A Model Context Protocol (MCP) server that enables AI assistants to interact with Microsoft 365 services including Outlook and SharePoint.

Features

Outlook Integration

  • Search and retrieve emails
  • Send emails and create drafts
  • Access email attachments
  • Manage mail folders
  • Calendar event management

SharePoint Integration

  • Document management (list, get, upload, update)
  • Folder operations
  • Document search capabilities
  • Sharing and permissions

Setup

Prerequisites

  • Python 3.10 or higher
  • Microsoft Azure App Registration with appropriate permissions
  • Microsoft 365 tenant access

Installation

  1. Clone the repository and navigate to the MCP server directory:
cd mcp-microsoft365-server
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Copy the environment configuration:
cp .env.example .env
  1. Configure your Azure app registration details in .env

Azure App Registration

  1. Go to Azure Portal

  2. Navigate to Azure Active Directory > App registrations

  3. Create a new registration with these settings:

    • Supported account types: Accounts in this organizational directory only
    • Redirect URI: Web - http://localhost:8000/auth/callback
  4. Configure API permissions:

    • Microsoft Graph API:
      • Mail.Read, Mail.Send, Mail.ReadWrite
      • Files.Read.All, Files.ReadWrite.All
      • Sites.Read.All, Sites.ReadWrite.All
      • Calendars.Read, Calendars.ReadWrite
  5. Generate a client secret and update your .env file

Usage

Starting the MCP Server

python -m src.server

Integration with Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "microsoft365": {
      "command": "python",
      "args": ["-m", "src.server"],
      "cwd": "/path/to/mcp-microsoft365-server"
    }
  }
}

Security

  • OAuth2 authentication with Microsoft
  • Encrypted token storage
  • Rate limiting
  • Request validation
  • Audit logging

Development

Running Tests

pytest

Code Formatting

black src/ tests/
isort src/ tests/

Type Checking

mypy src/

License

MIT License - see LICENSE file for details.