← Back to directory
M

Microsoft 365 MCP Server

Community
An MCP server for interacting with Microsoft 365 and Office services through the Graph API.
GitHub source repository ↗
★ 937 Stars Category · Cloud Storage Very popular Source revision 3c44ae2ed420
61FMRS · C
Reliability
8/20
Security and permissions
13/20
Maintenance
10/20
Documentation
16/20
Setup experience
14/20

Powerful project covering most of Microsoft 365 Graph API, with many deployment options and advanced configuration, but requires careful attention to permissions, token storage, and third-party risks. Suitable for technical users; it's advisable to read the documentation thoroughly.

Read the FMRS scoring method →

ms-365-mcp-server is a Model Context Protocol (MCP) server providing access to Microsoft 365 and Office services via the Microsoft Graph API. It supports multiple Microsoft cloud environments (Global, China 21Vianet) and offers 300+ tools covering email, calendar, OneDrive files, Excel, OneNote, To Do, Planner, contacts, user profile, search, and with organization mode, Teams, SharePoint, online meetings, and more. It supports multiple authentication methods (device code flow, OAuth authorization code flow, bring-your-own-token) and provides advanced features like multi-account support, tool presets, dynamic tool discovery, TOON output format (token reduction), read-only mode, tool filtering, scope filtering, and more. This project is a third-party open-source implementation (MIT license), not official Microsoft.

Tools

login
Log in using device code flow, checks for existing token.
list-mail-messages
List mail messages.
get-mail-message
Get details of a specific mail message.
list-calendar-events
List calendar events.
list-drives
List OneDrive or SharePoint drives.
get-drive-item
Get drive item details.
download-bytes
Universal binary reader to download files, attachments, photos, etc.
graph-batch
Execute batch Graph API requests.
list-shared-mailbox-messages
List messages from a shared mailbox (requires org mode and delegated permissions).
list-users
List users and shared mailboxes (org mode).

Setup

  1. Ensure Node.js 20 or higher is installed.
  2. For Claude Desktop, add the following to your config file (Settings > Developer):
{
  "mcpServers": {
    "ms365": {
      "command": "npx",
      "args": ["-y", "@softeria/ms-365-mcp-server"]
    }
  }
}
  1. Save and restart Claude Desktop.
  2. Call the login tool in the client to authenticate via device code flow.
claude_desktop_config.json
{
  "mcpServers": {
    "ms365": {
      "command": "npx",
      "args": [
        "-y",
        "@softeria/ms-365-mcp-server"
      ]
    }
  }
}

Fit and risk

Best for

  • Developers who want to integrate Microsoft 365 data into AI assistants or custom applications.
  • Scenarios requiring unified access across multiple services (email, calendar, files, Teams, etc.).
  • Lightweight solutions to interact with Graph API via MCP protocol.

Not for

  • Highly secure enterprise production environments (requires careful scope management and deployment complexity).
  • Admin tasks requiring Microsoft 365 admin permissions (like security alerts, audit logs) — consider companion project ms-365-admin-mcp-server.
  • Environments without Node.js.
  • Support for non-Microsoft clouds like GCC High (only Global and China 21Vianet currently).

Required permissions

  • Requires Microsoft Graph API permissions, dynamically requested based on enabled tools. Examples: User.Read, Mail.Read, Files.Read.
  • Organization mode (--org-mode) requires additional Graph permissions for Teams, SharePoint, etc. (e.g., Sites.Read.All).
  • Shared mailbox access requires delegated Mail.Read.Shared or Mail.Send.Shared scopes.
  • Use --allowed-scopes to restrict tool exposure; --extra-scopes to add extra scopes. Note: --allowed-scopes only narrows, never expands permissions.

Risks and side effects

  • Token security: File-based token storage may be exposed; use OS credential storage or secure custom paths.
  • Overly broad permissions: default requests all scopes implied by tools; use allowed-scopes or tool filtering to limit.
  • Multi-tenant token risk: With default 'common' tenant, personal account refresh tokens may be rejected as of June 2026, causing session expiry.
  • Third-party project risk: Not officially maintained, potentially less stable than official solutions.
  • HTTP mode OAuth setup complexity: Requires correct Azure AD app registration and redirect URIs.

Troubleshooting

  1. Authentication failure: check if you've run --login or called login tool; verify device code steps.
  2. Token loss: default token cache may be lost on npm updates; set MS365_MCP_TOKEN_CACHE_PATH and MS365_MCP_SELECTED_ACCOUNT_PATH to persistent paths.
  3. Permission errors: use --list-permissions to see required scopes; ensure tenant admin consents.
  4. Tools unavailable: confirm correct mode (personal vs org) and presets (--preset).
  5. Personal account refresh token issue: set MS365_MCP_TENANT_ID=consumers to avoid 'common' tenant problem.
  6. HTTP mode port conflict: use --http [port] to specify port (default 3000).
  7. Proxy issues: if OAuth redirect is unreachable, set --public-url to a public address.

Use cases

Personal account: manage email, calendar, OneDrive files, Excel, OneNote, to-do tasks, etc.
Work/school account: access Teams, SharePoint, shared mailboxes, user management, and other organizational features.
Automation workflows: interact directly with Microsoft 365 data via MCP for mail processing, calendar management, file operations, etc.
AI assistant integration: read and manipulate M365 data directly in AI tools like Claude, boosting productivity.

Supported clients

Claude DesktopFull support
Open WebUIFull support