CLI Microsoft365 MCP Server
Microsoft 365 management commands executed directly through natural language prompts.
Data last scanned today · Reviewed today
Overview
This MCP server bridges your AI assistant and the CLI for Microsoft 365, allowing you to manage environments like SharePoint, Teams, OneDrive, and Entra ID. It translates natural language requests into chains of CLI commands to perform administrative tasks across the Microsoft 365 ecosystem. To operate the server, you must have the CLI for Microsoft 365 installed globally and properly configured. The server relies on these local CLI installations to interpret and fulfill complex requests, requiring users to complete the standard setup process before it can interface with their Microsoft 365 tenants.
Our verdict
With a high-risk security score of 43/100, this tool should be treated with caution. The security status of its authentication methods and its read-only mode have not yet been reviewed, and it is maintained by the community rather than the official vendor. Developers should evaluate these risks before deploying it in environments handling sensitive enterprise data.
- Supports broad scope including Teams, SharePoint, and Entra ID
- Contains only two direct dependencies reducing supply chain surface
- Actively maintained with a repository commit from four days ago
- Authentication mechanism has not yet undergone a security review
- Read-only mode functionality remains unverified
- Community-maintained project lacking official Microsoft vendor oversight
Setup
{
"mcpServers": {
"cli-microsoft365-mcp-server": {
"args": [
"-y",
"@pnp/cli-microsoft365-mcp-server"
],
"command": "npx"
}
}
}Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), then restart Claude Desktop. Some servers require API keys or tokens as environment variables — check the project's README and add an "env" object if needed.
- No read-only mode — running this grants full read/write access.
- No built-in authentication — anyone with access to this config can invoke every tool it exposes.
Tools
| Tool | Description | Risk |
|---|---|---|
| m365SearchCommands | Searches CLI for Microsoft 365 commands using fuzzy search based on a query string. | low |
| 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 | low |
| 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 | high |
| m365GetBestPractices | Gets best practices for using CLI for Microsoft 365 in scripts, including guidance on authentication checking, error handling, output handling, and configuration | low |
Compatibility
| Client | Local | Docker | Remote | Read-only |
|---|---|---|---|---|
| Claude Desktop | ||||
| Cursor | ||||
| VS Code | ||||
| Windsurf | ||||
| ChatGPT |
Frequently asked questions
›What are the system requirements for this server?
You must have Node.js 20.x or higher installed and the CLI for Microsoft 365 package installed globally using the command npm i -g @pnp/cli-microsoft365.
›How do I handle authentication for this MCP server?
This server does not perform authentication itself. You must authenticate manually using the m365 login command, and the server will then use your existing authentication context.
›Are there specific configuration settings required for the CLI for Microsoft 365?
Yes, after initial setup, you must run specific configuration commands to set prompt to false, output to text, and helpMode to full to ensure the server functions correctly.
›Which LLM should I use for optimal performance?
The developers recommend using Claude Sonnet 3.5 or Claude Sonnet 3.7 for best results.
Alternatives
Badge
Maintain this server? Add the live badge to your README.