CLI for Microsoft 365 MCP Server
An MCP server that turns a plain request into CLI for Microsoft 365 command chains: SharePoint, Teams, Planner, Power Platform.
- 135 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- Runs CLI commands as your Microsoft 365 account, including creating and deleting tenant resources.
- The agent builds command chains itself, so a model mistake can affect real organization data.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/cli-for-microsoft-365-mcp-serverDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Runs CLI commands as your Microsoft 365 account, including creating and deleting tenant resources.
- The agent builds command chains itself, so a model mistake can affect real organization data.
This is third-party code. Review the repository files before installing.
What it does
The server links an agent to CLI for Microsoft 365 from the PnP community. The agent finds commands with fuzzy search through `m365SearchCommands` and then runs them in a chain to fulfil the request. It can manage Entra ID, OneDrive, Outlook, Planner, Power Apps, Power Automate, SharePoint Online and Teams. The server does no authentication: first run `m365 setup` and `m365 login` in the CLI itself, and the server then uses the same context. The author advises setting the `prompt`, `output` and `helpMode` keys with `m365 cli config set` so the agent gets more detail on errors.
Who it is for. Microsoft 365 administrators and developers who manage a tenant from an agent chat instead of manual commands and portals.
Good fit when
- An agent creates a SharePoint list with columns and test items.
- You need to find a Power Automate flow and disable it.
- A Teams team is created with a welcome post in the General channel.
- A Planner plan is created with starter buckets and tasks.
Not a fit when
- The tenant is production and the account has broad rights.
- You want sign-in without separate CLI authentication.
- Tenant changes without manual review of the commands are unacceptable.
Example request
Using CLI for Microsoft 365, create a Planner plan for the project with three buckets and test tasks.MCP
- Transport
- stdio
- Authentication
- OAuth
Limitations
Node.js 20 or newer and a globally installed `@pnp/cli-microsoft365` are required. Sign in to Microsoft 365 beforehand with `m365 login`. The authors report the best results with Claude Sonnet 4 or 3.7. The server gets your account's rights, so use a separate test tenant for experiments. Claude Desktop must be restarted after a configuration change. The tenant role of your account defines the rights; the server does not restrict them itself. Authorization details are in the CLI documentation.
How to disable. Remove the server entry from `mcp.json` or `claude_desktop_config.json` and restart the client. Sign out of Microsoft 365 with `m365 logout`.
FAQ
How do I connect the server?
Add the command `npx -y @pnp/cli-microsoft365-mcp-server@latest` to your MCP client configuration. The README has instructions for VS Code, GitHub Copilot CLI, Claude Desktop and Cursor.
What must be installed first?
Node.js 20 or newer and the CLI: `npm i -g @pnp/cli-microsoft365`. Then run `m365 setup` and sign in to Microsoft 365.
Does the server sign in by itself?
No. It uses the sign-in context the CLI created with `m365 login`.
Which services can it manage?
Entra ID, OneDrive, OneNote, Outlook, Planner, Power Apps, Power Automate, Power Platform, SharePoint Embedded, SharePoint Online, Teams and Viva Engage.
What does `m365SearchCommands` do?
Runs fuzzy search over CLI commands for a query and returns only the matches, which is cheaper than handing the agent the whole command list.
Discussion
No questions or reviews yet.
Related
MCP serversMicrosoft 365 MCP Server
ms-365-mcp-server
An unofficial MCP server for Microsoft 365 and Office through the Graph API: mail, files, calendar, sign-in with a Microsoft account and an organization mode
An MCP gateway with OAuth, Entra roles and send confirmation for 21Vianet Microsoft 365: mail, calendar, files, Teams
An MCP server that gives the agent access to mail, calendar, OneDrive files and Power Automate flows through Microsoft Graph
A command-line client for personal OneDrive. Its mcp command gives an agent read-only access to the files on the drive.
An MCP server that lets an agent work on your computer: terminal and long-running processes, file search and edits, Excel, PDF and DOCX
A local MCP server for Mac and Windows that lets an agent work with mail, messengers, calendars and files.
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| CLI for Microsoft 365 MCP Server (this card) | no | OAuth | 135 | |
| Microsoft 365 MCP Server | no | OAuth | 1,134 | an unofficial Graph API server for mail, files and calendar; this one runs CLI for Microsoft 365 commands across the tenant |
| SharePoint Skills | no | 156 | 69 skills for Copilot in SharePoint; this is an MCP server for any CLI command |
README in short
The repository holds a TypeScript server, a `server.json` manifest for the MCP registry and two skills in `.github/skills/` for the CLI and scripts. Scenario examples are in the project wiki.