Home / MCP / CLI for Microsoft 365 MCP Server

CLI for Microsoft 365 MCP Server

Provides a natural language interface to run CLI for Microsoft 365 commands and manage multiple Microsoft 365 areas.

typescript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "cli_microsoft365": {
            "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

m365GetCommands

Retrieves all CLI for Microsoft 365 commands to help the model select the right command for a given task

m365GetCommandDocs

Fetches documentation for a specific CLI for Microsoft 365 command to provide use cases, options, and examples

m365RunCommand

Executes a specified CLI for Microsoft 365 command and returns the result and reasoning of the action