home / mcp / cli for microsoft 365 mcp server

CLI for Microsoft 365 MCP Server

Manage Microsoft 365 using MCP server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "pnp-cli-microsoft365-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@pnp/cli-microsoft365-mcp-server@latest"
      ]
    }
  }
}

You can manage Microsoft 365 with natural language by routing your requests through this MCP server, which translates your prompts into a sequence of CLI for Microsoft 365 commands. It helps you perform complex tasks across Entra ID, OneDrive, Outlook, Teams, SharePoint, and more without memorizing exact commands.

How to use

To use this MCP server, connect it to an MCP client such as VS Code Copilot or Claude, and start asking for actions in natural language. The server will interpret your request and execute a chain of m365 commands to fulfill it. For best results, clearly describe the objective (for example, create a new Teams team named โ€œAwesome Ducksโ€ or add a new SharePoint list with specific columns). The MCP server does not perform authentication itself; you must authenticate with the CLI before running commands, and the server will reuse that authentication context.

What you can accomplish

This server supports a wide range of Microsoft 365 areas, including Entra ID, OneDrive, OneNote, Outlook, Planner, Power Apps, Power Automate, Power Platform, SharePoint, Teams, Viva Engage, and more. You can chain multiple tasks in a single prompt so you can set up environments, configure resources, or perform maintenance across multiple services in one conversational flow.

Available tools

m365SearchCommands

Searches CLI for Microsoft 365 commands with fuzzy matching to quickly find relevant commands.

m365GetCommandDocs

Retrieves documentation for a specific CLI for Microsoft 365 command, including examples and option details.

m365RunCommand

Executes a specified CLI for Microsoft 365 command and returns the result and explanatory reasoning.