Microsoft 365 MCP server

Provides a bridge between Microsoft 365 services and natural language interfaces, enabling access to email, calendar, OneDrive files, and Excel operations through the Microsoft Graph API with simplified authentication and parameter handling.
Back to servers
Setup instructions
Provider
Softeria
Release date
Apr 28, 2025
Language
TypeScript
Package
Stats
30.5K downloads
262 stars

The Microsoft 365 MCP Server provides a Model Context Protocol server that lets you interact with Microsoft 365 and Office services through the Graph API, giving Claude access to your email, files, calendars, and more.

Installation

Prerequisites

  • Node.js >= 20 (recommended)
  • Node.js 14+ may work but with dependency warnings

Installing the MCP Server

You can install and run the Microsoft 365 MCP server using npx:

npx -y @softeria/ms-365-mcp-server

For organization features (Teams, SharePoint, etc.), enable organization mode:

npx -y @softeria/ms-365-mcp-server --org-mode

Integrating with Claude

Claude Desktop

To add this MCP server to Claude Desktop:

  1. Go to Settings > Developer
  2. Edit the config file:
{
  "mcpServers": {
    "ms365": {
      "command": "npx",
      "args": ["-y", "@softeria/ms-365-mcp-server"]
    }
  }
}

For organization features, add the --org-mode flag to the args:

{
  "mcpServers": {
    "ms365": {
      "command": "npx",
      "args": ["-y", "@softeria/ms-365-mcp-server", "--org-mode"]
    }
  }
}

Claude Code CLI

claude mcp add ms365 -- npx -y @softeria/ms-365-mcp-server

Authentication

You must authenticate before using any tools.

Device Code Flow (Default)

  1. Call the login tool (auto-checks existing token)
  2. If needed, you'll receive a URL and code to enter in your browser
  3. Use the verify-login tool to confirm successful authentication

Alternatively, authenticate directly from the command line:

npx @softeria/ms-365-mcp-server --login

Follow the URL and code prompt in the terminal.

Tokens are cached securely in your OS credential store (with fallback to file).

Available Features

Personal Account Tools (Available by default)

  • Email (Outlook): list messages, send emails, manage drafts, etc.
  • Calendar: manage events, view calendars
  • OneDrive Files: list drives, manage files, upload/download content
  • Excel Operations: work with worksheets, ranges, charts
  • OneNote: access notebooks, sections, and pages
  • To Do Tasks: manage task lists and tasks
  • Planner: view and create tasks
  • Contacts: manage Outlook contacts
  • User Profile: get current user information
  • Search: perform queries

Organization Account Tools (Requires --org-mode flag)

  • Teams & Chats: access chats, messages, teams, channels
  • SharePoint Sites: search and access sites, drives, lists
  • Shared Mailboxes: access and manage shared mailboxes
  • User Management: list organization users

Using Shared Mailboxes

To access shared mailboxes, you need:

  1. Organization mode enabled (--org-mode flag)
  2. Delegated permissions (Mail.Read.Shared or Mail.Send.Shared scopes)
  3. Exchange permissions (you must have been granted access to the shared mailbox)

Use the shared mailbox's email address as the user-id parameter in shared mailbox tools.

Example: use list-shared-mailbox-messages with user-id set to [email protected]

Server Options

When running as an MCP server, these options are available:

-v                Enable verbose logging
--read-only       Start server in read-only mode (disables write operations)
--http [port]     Use HTTP transport instead of stdio (default port: 3000)
--enabled-tools <pattern> Filter tools using regex pattern

Environment variables can also control behavior:

  • READ_ONLY=true|1: Alternative to --read-only flag
  • ENABLED_TOOLS: Filter tools using a regex pattern
  • MS365_MCP_ORG_MODE=true|1: Enable organization mode
  • LOG_LEVEL: Set logging level (default: 'info')
  • SILENT=true|1: Disable console output

OAuth Mode

When running with --http, the server supports OAuth authentication:

npx @softeria/ms-365-mcp-server --http 3000

This mode:

  • Advertises OAuth capabilities to MCP clients
  • Provides OAuth endpoints at /auth/*
  • Requires Authorization: Bearer <token> for all MCP requests
  • Validates tokens with Microsoft Graph API

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "ms365" '{"command":"npx","args":["-y","@softeria/ms-365-mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "ms365": {
            "command": "npx",
            "args": [
                "-y",
                "@softeria/ms-365-mcp-server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "ms365": {
            "command": "npx",
            "args": [
                "-y",
                "@softeria/ms-365-mcp-server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later