cli-microsoft365-mcp-server — Claude Code MCP server: manage
An MCP server that turns plain-language requests into chains of CLI for Microsoft 365 commands. Useful when tenant admin work is easier to describe than to script.
claude mcp add cli-microsoft365-mcp-server -- npx -y @pnp/cli-microsoft365-mcp-serverWhat cli-microsoft365-mcp-server does
The server takes a normal sentence and breaks it into a sequence of CLI for Microsoft 365 commands. One request can touch several areas at once: Entra ID, OneDrive, OneNote, Outlook, Planner, Power Apps, Power Automate, Power Platform, SharePoint Embedded, SharePoint Online, Teams, Viva Engage.
Authentication is not handled here. Sign in with m365 login first, and the server reuses that context. You need Node.js 20.x or higher and a global @pnp/cli-microsoft365 install, then m365 setup plus three m365 cli config set calls for prompt, output and helpMode — that way the server gets more detail when a command fails.
The authors suggest Claude or Claude for best results. It runs through npx -y @pnp/cli-microsoft365-mcp-server@latest.
What it helps with
- create an Entra ID user and assign a license
- list SharePoint Online sites matching a condition
- set up a Planner plan with tasks
- inspect tenant settings before changing them
- run a chain of m365 commands from one description
Example prompts for the agent
- Using CLI for Microsoft 365, list all users without a license
- Create a Teams team and add two members to it
- Find every SharePoint Online site created this month
How to install cli-microsoft365-mcp-server
Platform CLI
claude mcp add cli-microsoft365-mcp-server -- npx -y @pnp/cli-microsoft365-mcp-serverPlatform CLI
codex mcp add cli-microsoft365-mcp-server -- npx -y @pnp/cli-microsoft365-mcp-serverConfig file
{
"mcpServers": {
"cli-microsoft365-mcp-server": {
"command": "npx",
"args": [
"-y",
"@pnp/cli-microsoft365-mcp-server"
]
}
}
}Config file
{
"servers": {
"cli-microsoft365-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@pnp/cli-microsoft365-mcp-server"
]
}
}
}Platform CLI
gemini mcp add cli-microsoft365-mcp-server npx -y @pnp/cli-microsoft365-mcp-serverStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about cli-microsoft365-mcp-server
How do I install cli-microsoft365-mcp-server in Claude Code?
Run claude mcp add cli-microsoft365-mcp-server -- npx -y @pnp/cli-microsoft365-mcp-server. You need Node.js 20.x or higher and a global @pnp/cli-microsoft365 install first.
What does cli-microsoft365-mcp-server do?
It converts a natural-language request into a chain of CLI for Microsoft 365 commands and runs them. That covers Entra ID, Teams, SharePoint Online, Outlook, Planner and other tenant services.
Does the server handle authentication on its own?
No. Sign in with m365 login first, then the server uses the same authentication context for every tool call.