home / mcp / microsoft 365 mcp server
Provides access to Microsoft 365 data (email, calendar, files, Teams, contacts, and more) via MCP-compatible AI clients.
Configuration
View docs{
"mcpServers": {
"aanerud-mcp-microsoft-office": {
"command": "node",
"args": [
"/path/to/MCP-Microsoft-Office/mcp-adapter.cjs"
],
"env": {
"PORT": "3000",
"JWT_SECRET": "YOUR_JWT_SECRET_HERE",
"MCP_SERVER_URL": "http://localhost:3000",
"MCP_BEARER_TOKEN": "paste-your-token-here",
"MICROSOFT_CLIENT_ID": "<MICROSOFT_CLIENT_ID>",
"MICROSOFT_TENANT_ID": "<MICROSOFT_TENANT_ID>",
"CORS_ALLOWED_ORIGINS": "https://yourdomain.com",
"MICROSOFT_REDIRECT_URI": "http://localhost:3000/api/auth/callback",
"DEVICE_REGISTRY_ENCRYPTION_KEY": "YOUR_32_BYTE_KEY_HERE"
}
}
}
}You set up a local MCP server that connects your Microsoft 365 data to your preferred AI assistant. It lets you read emails, manage calendars, access files, and interact with Teams, all while keeping control and security in your environment.
You interact with Claude Desktop or any MCP-compatible AI, and the MCP Adapter translates your requests into actions on the MCP Server. After youβve authenticated with Microsoft and started the server, your AI can read emails, fetch calendar events, access files, and perform Teams actions using natural language queries. The adapter runs on your machine and communicates with the local server, enabling multi-user access with data isolation.
Prerequisites: Install Node.js 18+ and make sure you have a Microsoft 365 account and an Azure App Registration ready for OAuth.
# 1) Clone the project
# Replace with your actual repository path if you clone locally
git clone https://github.com/Aanerud/MCP-Microsoft-Office.git
cd MCP-Microsoft-Office
# 2) Install dependencies (this also sets up the database)
npm install
# 3) Edit the environment file with your Azure app details
# Add these values to .env:
# MICROSOFT_CLIENT_ID=your-client-id-here
# MICROSOFT_TENANT_ID=your-tenant-id-here
# 4) Start the server for local development
npm run dev:webConfiguration, security, and troubleshooting details are covered to help you run a robust MCP server. You can authenticate with Microsoft, generate an MCP token for your AI client, and connect the local MCP Adapter to the server so your AI can perform actions across Mail, Calendar, Files, Teams, and more.
Security and multi-user isolation ensure each userβs data remains private. Tokens are stored securely, tokens are renewed automatically where supported, and the server enforces access controls and rate limits.
If you need to adjust client connections, configure the local adapter path, and ensure Claude Desktop points to the adapter with the correct MCP server URL and token.
Read your inbox messages from your connected Microsoft 365 account.
Send an email on behalf of the authenticated user.
Search for specific emails across mailboxes.
Flag or unflag an email for follow-up.
Retrieve full content of a specific email.
Mark emails as read or unread.
List attachments for a selected email.
Add an attachment to an email.
Remove an attachment from an email.
Fetch calendar events from Microsoft 365.
Create a new calendar event.
Modify an existing calendar event.
Cancel or delete a calendar event.
Check free/busy availability across calendars.
Find optimal meeting times based on attendee availability.
Accept a calendar invitation.
Decline a calendar invitation.
Tentatively accept a calendar invitation.
List all calendars.
Find available meeting rooms.
Add attachment to a calendar event.
Remove an attachment from a calendar event.
List OneDrive files.
Search for files in OneDrive.
Download a file from OneDrive.
Upload a new file to OneDrive.
Get file metadata.
Read file contents.
Write file contents.
Update file contents.
Create a share link for a file.
List sharing links for files.
Remove sharing permissions.
List Teams chats.
Get chat details.
Read messages in a chat.
Send a message to a chat.
List your Teams teams.
Get team details.
List channels in a team.
Get channel details.
Read messages in a channel.
Post a message to a channel.
Create an online meeting in Teams.
Get details of a Teams online meeting.
Find people by name in the directory.
Get frequent contacts.
Get detailed person information.
Unified search across emails, files, events, and people.
List all Task lists.
Get a specific task list.
Create a new task list.
Rename a task list.
Delete a task list.
List tasks in a list.
Get task details.
Create a new task.
Update a task.
Delete a task.
Mark a task as complete.
List your contacts.
Get contact details.
Add a new contact.
Update contact information.
Remove a contact.
Search your contacts.
List Microsoft 365 groups.
Get group details.
List members of a group.
List groups youβre in.