# cli-microsoft365-mcp-server

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 135
- Author: pnp
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pnp/cli-microsoft365-mcp-server
- Updated: 2026-10-13
- HTML: https://affpapa.org/en/nevibecode/mcp/cli-microsoft365-mcp-server

## What it 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`.

## Requirements
- Needs: Node.js (commands run via npx)
- Works with: SharePoint

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add cli-microsoft365-mcp-server -- npx -y @pnp/cli-microsoft365-mcp-server
```

### Codex

**Platform CLI**
```bash
codex mcp add cli-microsoft365-mcp-server -- npx -y @pnp/cli-microsoft365-mcp-server
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cli-microsoft365-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@pnp/cli-microsoft365-mcp-server"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cli-microsoft365-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@pnp/cli-microsoft365-mcp-server"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add cli-microsoft365-mcp-server npx -y @pnp/cli-microsoft365-mcp-server
```

## When to use it
- 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
- 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

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
