← Back to directory
C

CLI for Microsoft 365 MCP Server

Community
Manage Microsoft 365 using natural language
Category
Collaboration #16 of 55
Stars
★ 132 Popular
Transport
stdio (local process)
Runtime
Node.js 20+
Credentials
API key / credential required
License
MIT
Last commit
Tools
4
58FMRS · C

This MCP server, built by the PnP community, allows natural language management of Microsoft 365. It provides four tools for searching commands, getting docs, executing commands, and getting best practices. It relies on a globally installed CLI for Microsoft 365 and requires prior authentication. The server integrates with several popular MCP clients and provides clear installation instructions.

Strongest · Documentation 14/20 Weakest · Reliability 8/20

Reliability
8/20
Security and permissions
12/20
Maintenance
12/20
Documentation
14/20
Setup experience
12/20
Why each score
Reliability 8/20
The project provides clear tool definitions (m365SearchCommands, m365GetCommandDocs, m365RunCommand, m365GetBestPractices), but no verifiable execution evidence (such as real CI workflows and committed tests covering key paths) is present in the provided materials. Since nothing is executed, we cannot confirm startup and tool-list handshake. It depends on a globally installed CLI for Microsoft 365, and error handling may be documented but lacks test support. Therefore, the maximum is capped at 12, and we give 8.
Security and permissions 12/20
Authentication is handled by an external CLI (via m365 login), and the MCP server itself does not handle credentials, reducing risk. The tools are primarily command executors, but there is no mention of confirmation mechanisms for dangerous operations or least privilege. The documentation does not clearly disclose data flow or permission scope. No red-line issues (like malware or credential theft) are apparent, but security practice details such as confirmation steps and permission minimization are incomplete, so we give 12.
Maintenance 12/20
The repository is active (commits, releases, version 0.1.23), has MIT license, and has few open issues. No evidence of dependency updates or issue response speed. The maintenance sustainability is clear, but governance details like security response channel are not disclosed, so we give 12.
Documentation 14/20
The README includes installation, configuration, usage scenarios, and tool descriptions, which is good. It provides configuration examples for multiple clients (VS Code, Copilot, Claude, Cursor). The documentation mentions limitations (e.g., need for global CLI and authentication) but lacks detailed troubleshooting or cost info. Evidence is sufficient, but lack of layered docs and detailed troubleshooting holds it back, so we give 14.
Setup experience 12/20
Installation steps are relatively clear, requiring Node 20+ and global CLI, with configuration examples for multiple clients. Local build and debugging are explained. However, setup steps rely on manual CLI configuration (e.g., setting prompt, output) and no automation script is provided. Since not executed, verification is impossible, but documentation provides clear steps, so we give 12.

Static review · not runListed 2026-08-07

Read the FMRS scoring method →

Fit and risk

What it can accessUses the networkChanges third-party account data

Best for

  • Developers or admins who want to interact with Microsoft 365 using natural language
  • Scenarios managing SharePoint, Teams, Planner, Power Platform, etc.
  • Users of MCP clients like VS Code, Claude Desktop, Cursor

Not for

  • Users who don't need Microsoft 365 management
  • Environments that cannot install Node.js or CLI for Microsoft 365
  • Users who expect the MCP server to handle authentication itself (it does not)

Required permissions

  • Requires global installation of CLI for Microsoft 365
  • Requires logging in to Microsoft 365 with appropriate permissions
  • Requires local network access to communicate with Microsoft 365 APIs

Risks and side effects

  • Commands executed may make changes; test with caution
  • Erroneous or unexpected prompts could cause unintended changes
  • Dependency on CLI for Microsoft 365 configuration; misconfiguration may lead to incomplete error messages

Setup

Before you start

Runtime:Node.js 20+

Prerequisites: Node.js 20.x or higher, and global installation of CLI for Microsoft 365 (npm i -g @pnp/cli-microsoft365). Run 'm365 setup' to initialize, then authenticate using 'm365 login'. Configure CLI: 'm365 cli config set --key prompt --value false', 'm365 cli config set --key output --value text', 'm365 cli config set --key helpMode --value full'. Then add the server to your MCP client with command: npx -y @pnp/cli-microsoft365-mcp-server@latest.

claude_desktop_config.json
{
  "mcpServers": {
    "CLI-Microsoft365": {
      "command": "npx",
      "args": ["-y", "@pnp/cli-microsoft365-mcp-server@latest"]
    }
  }
}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "CLI-Microsoft365": {
      "command": "npx",
      "args": [
        "-y",
        "@pnp/cli-microsoft365-mcp-server@latest"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add CLI-Microsoft365 -- npx -y @pnp/cli-microsoft365-mcp-server@latest

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

The client's tool list should show m365SearchCommands, m365GetCommandDocs, m365RunCommand and m365GetBestPractices; after authenticating with m365 login, asking the agent to search for CLI for Microsoft 365 commands proves the connection works.

Troubleshooting

  1. Ensure CLI for Microsoft 365 is correctly installed and configured
  2. Ensure you are logged in (m365 login)
  3. Ensure config settings are correct (prompt, output, helpMode)
  4. If commands fail, check CLI error output and confirm you have sufficient permissions

Things to try

Once connected, you can ask your AI assistant things like:

  • Using CLI for Microsoft 365, create a new SharePoint list titled 'awesome ducks' on this site and add a few test items
  • Using CLI for Microsoft 365, create a new Teams team named 'Awesome Ducks' and add a welcome post to the General channel
  • Check if I have a Power Automate flow called HoursReportingReminder and disable it if I do
  • Create a new Planner plan with some sample buckets and tasks to get started

Tools 4

m365SearchCommands read-only
Searches CLI for Microsoft 365 commands using fuzzy search based on a query string. This is more efficient than getting all commands as it returns only relevant matches. Use this tool first to find relevant commands.
m365GetCommandDocs read-only
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 writes
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
m365GetBestPractices read-only
Gets best practices for using CLI for Microsoft 365 in scripts, including guidance on authentication checking, error handling, output handling, and configuration

Use cases

Manage SharePoint Online naturally, e.g., create lists, add columns and items (see example 'awesome ducks').
Create Microsoft Teams teams and add welcome posts to channels.
Manage Power Platform solutions, e.g., disable a Power Automate flow.
Create Planner plans with sample buckets and tasks.

Supported clients

VS Code
GitHub Copilot CLI
Claude Desktop
Cursor

Listed from the project's documentation, not tested by this site.

Overview

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.

Similar servers

Source revision 6d897079f8a5 Data synced 2026-10-12 Read the FMRS scoring method