M3

Microsoft 365

Created 5 months ago

MCP server for executing CLI for Microsoft 365 commands using natural language.

development documentation public

What is Microsoft 365?

Single MCP server that allows to manage many different areas of Microsoft 365, for example: Entra ID, OneDrive, OneNote, Outlook, Planner, Power Apps, Power Automate, Power Platform, SharePoint Embedded, SharePoint Online, Teams, Viva Engage, and many more.

Documentation

CLI for Microsoft 365 MCP Server# 💡 Description

This MCP server allows the use of natural language to execute any CLI for Microsoft 365 commands. It may handle complex prompts that will be executed as a chain of CLI for Microsoft 365 commands that will try to fulfill the user's request. Thanks to this, you may manage many different areas of Microsoft 365, for example: Entra ID, OneDrive, OneNote, Outlook, Planner, Power Apps, Power Automate, Power Platform, SharePoint Embedded, SharePoint Online, Teams, Viva Engage, and many more. For best results, use it with Claude Sonnet 4 or Claude Sonnet 3.7.

📦 Prerequisites

  • Node.js 20.x or higher
  • CLI for Microsoft 365 installed globally (npm i -g @pnp/cli-microsoft365)

🚀 Installation & Usage

👉 Check out the Getting Started recording 🎬

This MCP server uses the globally installed CLI for Microsoft 365 that you need to install globally using npm i -g @pnp/cli-microsoft365. After you install the CLI for Microsoft 365 perform the initial setup by running the:

m365 setup

For more information, please follow the Log in to Microsoft 365

After you set up the CLI for Microsoft 365, please update its configuration using the following commands:

m365 cli config set --key prompt --value false
m365 cli config set --key output --value text
m365 cli config set --key helpMode --value full

This will ensure that the MCP server will get as much information as possible from the CLI for Microsoft 365 when an error occurs or when a command is not executed properly. The MCP server will not do any authentication for you. You will need to first authenticate using CLI for Microsoft 365 using m365 login command. Once you are authenticated, the MCP server will use the same authentication context when running any tool.

🧠 LLM Suggestion

For best results, use it with Claude Sonnet 4 or Claude Sonnet 3.7.

📷 Use Cases

The below uses cases are only a few example how you may use this MCP server. It is capable of handling many different tasks, so feel free to experiment with it and basically manage all of Microsoft 365 using natural language. Also you may check the CLI for Microsoft 365 wiki to find more scenarios how ClI for Microsoft 365 can be used to manage Microsoft 365.

🛠️ Tools

Column 1 Column 2
m365GetCommands Gets all CLI for Microsoft 365 commands to be used by the Model Context Protocol to pick the right command for a given task
m365GetCommandDocs Gets documentation for a specified CLI for Microsoft 365 command to be used by the Model Context Protocol to provide detailed information about the command along with examples, use cases, and option descriptions
m365RunCommand Runs a specified CLI for Microsoft 365 command to be used by the Model Context Protocol to execute the command and return the result and reason over the response

🔗 Resources

Server Config

{
  "mcpServers": {
    "microsoft-365-server": {
      "command": "npx",
      "args": [
        "microsoft-365"
      ]
    }
  }
}

Links & Status

Repository: github.com
Hosted: No
Global: Yes
Official: Yes

Project Info

Hosted Featured
Created At: Jul 02, 2025
Updated At: Aug 07, 2025
Author: PnP Team
Category: community
License: MIT
Tags:
development documentation public