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
12.5K downloads
158 stars

Microsoft 365 MCP Server is a Model Context Protocol server that enables interaction with Microsoft 365 and Office services through the Graph API. It allows applications to access email, calendar, files, and other Microsoft services with comprehensive authentication support.

Prerequisites

  • Node.js >= 14

Supported Services

The server provides access to multiple Microsoft 365 services:

Email (Outlook)

  • List mail messages and folders
  • Get message details
  • Send and delete emails

Calendar

  • List calendars and events
  • Create, update, and delete calendar events
  • Get calendar views

OneDrive & SharePoint Files

  • List drives and folder contents
  • Download and upload files
  • Delete files

Excel Operations

  • List worksheets
  • Get and format ranges
  • Create charts and sort data

OneNote

  • List notebooks, sections, and pages
  • Get and create page content

To Do Tasks

  • Manage task lists and individual tasks
  • Create, update, and delete tasks

Planner

  • List and get planner tasks
  • Create new tasks

Contacts

  • List and get Outlook contacts
  • Create, update, and delete contacts

Teams & Chats (Work/School accounts only)

  • Manage chats and messages
  • List teams and channels
  • Send messages and manage team members

SharePoint Sites (Work/School accounts only)

  • Search and access SharePoint sites
  • Manage site drives, lists, and items

User Profile

  • Get current user details

Installation and Setup

Claude Desktop Integration

To add this MCP server to Claude Desktop:

  1. Edit the config file under Settings > Developer:
{
  "mcpServers": {
    "ms365": {
      "command": "npx",
      "args": [
        "-y",
        "@softeria/ms-365-mcp-server"
      ]
    }
  }
}
  1. If you need access to work/school features (Teams, SharePoint), add the --force-work-scopes flag:
{
  "mcpServers": {
    "ms365": {
      "command": "npx",
      "args": [
        "-y",
        "@softeria/ms-365-mcp-server",
        "--force-work-scopes"
      ]
    }
  }
}

Claude Code CLI Integration

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

Authentication Methods

⚠️ You must authenticate before using tools.

1. Device Code Flow (Default)

For interactive authentication:

  • Using MCP client login:

    • Call the login tool (automatically checks for existing token)
    • If needed, get URL and code, visit in browser
    • Use verify-login tool to confirm authentication
  • Using CLI login:

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

    Follow the URL and code prompt in the terminal.

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

2. OAuth Authorization Code Flow (HTTP mode only)

When running in HTTP mode:

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

This mode:

  • Requires OAuth authentication
  • Advertises OAuth capabilities to MCP clients
  • Provides authentication endpoints at /auth/*
  • Requires Authorization: Bearer <token> for all MCP requests
  • Disables login/logout tools by default (use --enable-auth-tools to enable)

Setting up Azure AD for OAuth

To use custom Azure credentials:

  1. Create an Azure AD App Registration in the Azure Portal

  2. Configure redirect URIs:

    • http://localhost:6274/oauth/callback
    • http://localhost:6274/oauth/callback/debug
    • http://localhost:3000/callback (optional)
  3. Copy your client ID and create a client secret

  4. Create a .env file with:

    MS365_MCP_CLIENT_ID=your-azure-ad-app-client-id-here
    MS365_MCP_CLIENT_SECRET=your-azure-ad-app-client-secret-here
    MS365_MCP_TENANT_ID=common
    

3. Bring Your Own Token (BYOT)

For systems that manage Microsoft OAuth tokens externally:

MS365_MCP_OAUTH_TOKEN=your_oauth_token npx @softeria/ms-365-mcp-server

This method uses your pre-existing OAuth token and doesn't handle token refresh.

Command Line Options

Authentication Options

--login           Login using device code flow
--logout          Log out and clear saved credentials
--verify-login    Verify login without starting the server
--force-work-scopes Force inclusion of work account scopes during login

Server Options

-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)
--enable-auth-tools Enable login/logout tools in HTTP mode
--enabled-tools <pattern> Filter tools using regex pattern

Environment Variables

  • READ_ONLY=true|1: Alternative to --read-only flag
  • ENABLED_TOOLS: Filter tools using regex pattern
  • MS365_MCP_FORCE_WORK_SCOPES=true|1: Force work account scopes
  • LOG_LEVEL: Set logging level (default: 'info')
  • SILENT=true|1: Disable console output
  • MS365_MCP_CLIENT_ID: Custom Azure app client ID
  • MS365_MCP_TENANT_ID: Custom tenant ID (default: 'common')
  • MS365_MCP_OAUTH_TOKEN: Pre-existing OAuth token

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