Cli MCP Server

Model Context Protocol (MCP) server for CLI for Microsoft 365 that allows to use natural language to manage your Microsoft 365 tenant.

Local serverstdioTypeScript

What is the Cli MCP server?

Cli MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. Model Context Protocol (MCP) server for CLI for Microsoft 365 that allows to use natural language to manage your Microsoft 365 tenant.

What you get

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...

What the assistant can call

Once Cli is connected, these are the calls the assistant has available:

  • m365SearchCommands — 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
  • 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
  • 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
  • m365GetBestPractices — Gets best practices for using CLI for Microsoft 365 in scripts, including guidance on authentication checking, error handling, output handling, and

Setting it up

Installation goes through your MCP client rather than a global install: point it at @pnp/cli-microsoft365-mcp-server on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Choosing this one

This sits in the knowledge and memory group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Cli's toolset — m365SearchCommands, m365GetCommandDocs, m365RunCommand and 1 more — is a fair guide to whether it matches your workflow. It is maintained by adam-it; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Cli's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the cli mcp server does with a few real requests.

Available tools

ToolWhat it does
m365SearchCommandsSearches 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.
m365GetCommandDocsGets 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
m365RunCommandRuns 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
m365GetBestPracticesGets best practices for using CLI for Microsoft 365 in scripts, including guidance on authentication checking, error handling, output handling, and configuration

How to install the Cli MCP server

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

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • Use Cli to m365SearchCommands.
  • Use Cli to m365GetCommandDocs.
  • Use Cli to m365RunCommand.

Frequently asked questions

It connects Cli to MCP-compatible AI assistants such as Claude and Cursor, exposing 4 tools (m365SearchCommands, m365GetCommandDocs, m365RunCommand, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Cli directly.