home / mcp / microsoft 365 mcp server
Provides programmatic access to Microsoft 365 data and actions via MCP using Graph API across personal and organization clouds.
Configuration
View docs{
"mcpServers": {
"softeria-ms-365-mcp-server": {
"url": "http://localhost:3000/mcp",
"headers": {
"READ_ONLY": "true",
"MS365_MCP_ORG_MODE": "true",
"MS365_MCP_CLIENT_ID": "00000000-0000-0000-0000-000000000000",
"MS365_MCP_TENANT_ID": "common",
"MS365_MCP_CLOUD_TYPE": "global",
"MS365_MCP_OAUTH_TOKEN": "<token>",
"MS365_MCP_KEYVAULT_URL": "https://myvault.vault.azure.net",
"MS365_MCP_OAUTH_SCOPES": "https://graph.microsoft.com/.default",
"MS365_MCP_CLIENT_SECRET": "<secret>",
"MS365_MCP_OUTPUT_FORMAT": "toon"
}
}
}
}You can run a Microsoft 365 MCP Server to access Microsoft Graph data and actions from your applications. It supports multiple clouds, offers both local (stdio) and HTTP-based operation modes, and includes configurable authentication and output formats to fit your use case.
Use an MCP client to connect to the Microsoft 365 MCP Server and perform operations such as reading emails, managing calendars, accessing OneDrive files, and more. You can operate in personal account mode or organization mode to access work or school resources. The server supports two output formats and can run in local (stdio) mode or HTTP mode for remote access.
To begin, run the server in one of the following ways, then connect your MCP client to the provided endpoints.
Prerequisites you need before installing and running the MCP server:
Install and run the server using one of the supported execution methods shown below.
To expose the MCP server over HTTP and enable dynamic client registration for the Open WebUI, start the server with HTTP mode and dynamic registration enabled.
npx @softeria/ms-365-mcp-server --http --enable-dynamic-registrationConnect the HTTP endpoint from your MCP client using the URL you configure, typically including the /mcp path. When integrating with Open WebUI, follow the steps to register the MCP client and verify the connection.
You can run the server locally using the standard command line invocation. The following example runs the server with the MCP package using the npx runner.
# Personal account example
npx -y @softeria/ms-365-mcp-server
# Organization/work account example (enable organization mode)
npx -y @softeria/ms-365-mcp-server --org-mode
# China 21Vianet organization example
npx -y @softeria/ms-365-mcp-server --org-mode --cloud chinaIn Claude Desktop or other integrations, you can configure the server using the same base command with additional flags as needed. For example, to enable organization mode in Claude Desktop, specify the command and arguments exactly as shown.
Authentication supports multiple methods. Device Code Flow is the default for interactive login. In HTTP mode, OAuth 2.1 is advertised and tokens are required for MCP requests. You can also supply a pre-existing OAuth token with BYOT (Bring Your Own Token) mode when needed.
Tool presets help reduce startup overhead by enabling only selected categories of tools. You can request presets like mail, calendar, files, or all tools, depending on your needs.
Azure Key Vault integration allows storing secrets outside the environment variables for production deployments. You can point the server to a Key Vault URL and map secrets to client IDs, tenant IDs, and client secrets as needed.
Examples show how to configure the server in different environments, including personal and organization modes, as well as how to integrate with Claude Desktop. Use these as practical references to tailor the MCP server for your setup.
Open WebUI supports MCP servers via HTTP transport with OAuth 2.1. Start the server with HTTP mode and dynamic registration, then add the MCP connection in WebUI under Admin Settings. Quick test setup demonstrates a default Azure app and a local URL like http://localhost:3000/mcp.
For local development, you can run the server and test with CLI tools or adapt the provided samples for your environment.
# Claude Code CLI example for personal account
claude mcp add ms365 -- npx -y @softeria/ms-365-mcp-server
# Work/School account example with organization mode
claude mcp add ms365 -- npx -y @softeria/ms-365-mcp-server --org-modeYou must authenticate before using tools. Choose from Device Code Flow, OAuth Authorization Code Flow (HTTP mode), or BYOT. In HTTP mode, login/logout tools are disabled by default and can be enabled with a flag if required.
Store secrets in Azure Key Vault for production deployments. Map Key Vault secrets to environment variables, and configure access policies for your deployment. The server automatically uses DefaultAzureCredential to obtain credentials from multiple sources.
If you encounter issues, start by verifying authentication status, ensuring the correct mode (stdio or http), and checking the configured output format. For help, create an issue, start a discussion, or reach out via email, Discord, or other provided contact options.
Authenticate using device code flow. Checks existing tokens and prompts for login if needed.
Clear saved credentials and sign out from the MCP server.
Verify the current login status without starting the server.
List tasks created in Microsoft To Do.
List email messages in a mailbox.
List folders within a mailbox.
Retrieve a specific email message by ID.
Send an email message.
List calendars in the account.
List events in a calendar.
Get details for a specific calendar event.
Create a new calendar event.
List OneDrive drives in the account.
Get the root item of a OneDrive drive.
List files in a folder in OneDrive.
Download content of a OneDrive file.
Upload content to a OneDrive file.
Upload a new file to OneDrive.
Delete a file from OneDrive.
List worksheets in an Excel workbook.
Get a range value from an Excel worksheet.
Create a chart in Excel.
Format a range in Excel.
Sort data in an Excel range.
List OneNote notebooks.
List sections within a OneNote notebook.
List pages within a OneNote section.
Get content of a OneNote page.
Create a new OneNote page.
List To Do task lists.
List tasks in a To Do list.
Get details for a To Do task.
Create a new To Do task.
Update an existing To Do task.
Delete a To Do task.
List Planner tasks.
Get Planner plan details.
List tasks in a Planner plan.
Get Planner task details.
Create a Planner task.
List contacts in Outlook.
Get a specific Outlook contact.
Create an Outlook contact.
Update a contact in Outlook.
Delete an Outlook contact.
Retrieve information about the signed-in user.
Perform a search across Microsoft 365 data.
List items in a SharePoint site.
Get a SharePoint site drive by ID.
Search SharePoint sites.
List lists within a SharePoint site.
List items in a SharePoint site.
Get a specific SharePoint site item.
Get a SharePoint site by URL.
Get delta changes for SharePoint sites.