Mo187/MCP-365
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
- Clone the repository and navigate to the MCP server directory:
cd mcp-microsoft365-server
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Copy the environment configuration:
cp .env.example .env
- Configure your Azure app registration details in
.env
Azure App Registration
-
Go to Azure Portal
-
Navigate to Azure Active Directory > App registrations
-
Create a new registration with these settings:
- Supported account types: Accounts in this organizational directory only
- Redirect URI: Web -
http://localhost:8000/auth/callback
-
Configure API permissions:
- Microsoft Graph API:
Mail.Read,Mail.Send,Mail.ReadWriteFiles.Read.All,Files.ReadWrite.AllSites.Read.All,Sites.ReadWrite.AllCalendars.Read,Calendars.ReadWrite
- Microsoft Graph API:
-
Generate a client secret and update your
.envfile
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.