# Reported issues for cli-microsoft365-mcp-server

Pod holds 20 of 34 problems reported by people outside the maintainer team. Issues filed by the project's own owners, members and collaborators are excluded entirely — a maintainer's release checklist is not a warning to a prospective user.

Back to [cli-microsoft365-mcp-server](/mcp/cli-microsoft365-mcp-server).

## Most discussed

### 🐞 Bug report: using latest version all scopes not created

### ⭐ Priority

(Medium)😢 I'm annoyed but I'll live

### 📝 Describe the bug

Missing scope:
Sites.ReadWrite.All 

### 👣 Steps To Reproduce

adding list item or searching sharepoint for the list requires this scope

### 📜 Expected behavior

access to create and edit sharepoint list items

### 📷 Screenshots

_No response_

### ❓Node.js version

_No response_

### 🤔 Additional context

_No response_

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/27) · 2025-07-08 · closed · external user · 14 comments

### How Microsoft 365 MCP will authenticate towards CLI for Microsoft 365

Currently, how it is developed we may only use CLI for Microsoft 365 as a app by passing the app and tenant ID and base 64 encoded value and password. This is not ideal and we should check other options how a user may sign in to CLI for Microsoft 365 over the MCP server.

For example in GitHub Copilot chat mode we may expose buttons in the chat UI that will execute some logic in VS Code extension.
I wonder if the provided MCP server could pass some notify that the user is not signed in and we fi

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/2) · 2025-04-17 · closed · 9 comments

### m365_get_commands returns 800+ commands and exceeds token limits; needs pagination or filtering

## Description
The `m365_get_commands` tool returns all 800+ CLI for Microsoft 365 commands in a single response, which can exceed token limits when using models with request size restrictions (e.g., GitHub Models' gpt-4o has a 16,000 token limit).

## Steps to Reproduce
1. Configure an MCP client to use the CLI for Microsoft 365 MCP Server with a model that has token limits (e. g., gpt-4o via GitHub Models)
2. Send a prompt like "Get my Microsoft 365 user profile"
3. The agent calls `m365_get_c

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/82) · 2025-12-03 · closed · 5 comments

### 🐞 Bug report: Critical pathing bug in M365 CLI when run via Gemini CLI for Natural Language Queries

### ⭐ Priority

(Medium)😢 I'm annoyed but I'll live

### 📝 Describe the bug

I've identified a very specific and 100% reproducible path resolution bug in the CLI for Microsoft 365. I'm hoping you can provide some insight.

Use Case Context:

I am using the M365 CLI on an 'MCP' server, which is orchestrated by the Google Gemini CLI. The goal is to enable natural language queries against our Microsoft 365 tenant (e.g., asking "List all my Teams" in plain English).

Problem Summary:

Under this spe

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/28) · 2025-07-09 · closed · external user · 5 comments

### Add Prompts. Resources, and improve metadata of the MCP server

The aim of this issue is to add:
- [ ] [Resources](https://github.com/modelcontextprotocol/typescript-sdk/tree/main?tab=readme-ov-file#resources) - for example, we could expose dynamic resources to common information someone would like to get from Microsoft 365 tenant like a resource to get user profile by id or user email, or to get Entra App Reg properties by id or app name, or SharePoint sie properties.
- [ ] [Prompts](https://github.com/modelcontextprotocol/typescript-sdk/tree/main?tab=readm

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/15) · 2025-07-04 · closed · 5 comments

### How will we distribute the MCP server

Currently, for MCP created in TypeScript we have two ways either as a npm package and deliver it with npx command or as a docker image.
Consider both methods and decide which is the preferred option for now

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/4) · 2025-04-17 · closed · 5 comments

### Add MCP to GitHub MCP Registry

We should contribute this MCP server to make it visible here
https://github.com/mcp?utm_source=blog-source&utm_campaign=mcp-registry-server-launch-2025

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/51) · 2025-09-17 · closed · 4 comments

### Microsoft 365 MCP used in other tools besides VS Code

Currently in docs I only mention how to set it up for VS Code. 
We should investigate other tooling and check how this MCP server may be used in other places

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/3) · 2025-04-17 · closed · 4 comments

## Most recent

### Reduce token used for different MCP commands

## Update 1

What we need to do is ensure that if the command output is JSON, or when handling output for the all commands tool which is always JSON, we should trim all spaces and break lines to make the JSON compact as it is returned as text to the LLM.

## deprecated

~~We use different outputs for different MCP commands~~
~~For example getting all CLI commands uses JSON output mode which might be not most effective. Maybe using toon in this case would be better.~~

~~For CLI command response 

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/75) · 2025-11-10 · closed · 1 comment

### Add copilot instructions for repo

The aim is to add GitHub copilot instructions for this repo

Reference docs
https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/74) · 2025-11-10 · closed · 1 comment

### Ensure `--output json` is always added to CLI commands

**Description:**

## Summary
Currently, the `runCliCommand` function in `src/util.ts` executes commands without ensuring that the output format is JSON. This could lead to inconsistent output formats that are harder to parse.

## Current Behavior
The `runCliCommand` function executes commands as-is:
```typescript
const subprocess = spawn(command, {
    shell: true,
    timeout: 120000,
});
```

## Proposed Enhancement
Modify `runCliCommand` to automatically append `--output json` to commands if 

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/72) · 2025-11-10 · closed · 0 comments

### Add setup guide for GitHub Copilot in Terminal

The aim of this issue is to add setup guide how to install this MCP server in GitHub Copilot that runs in a terminal

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/62) · 2025-10-08 · closed · 1 comment

### Add Claude setup guide and .mcpb file

- [x] The aim is to add a setup guide how to configure this MCP with Claude. 
We could use Lokka guide as a perfect example how this could look like in our docs as it is really good 
https://lokka.dev/docs/install

- [x] also we should consider creating an .mcpb file for this MCP to make installing easier

~~- [ ] also we might consider submitting to Antropic as an approved desktop extension https://docs.google.com/forms/d/14_Dmcig4z8NeRMB_e7TOyrKzuZ88-BLYdLvS6LPhiZU/viewform?edit_requested=true

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/54) · 2025-09-18 · closed · 0 comments

### Add MCP to Docker Toolkit

Let's research what is needed and how this MCP server may be contributed to Docker toolkit
https://docs.docker.com/ai/mcp-catalog-and-toolkit/toolkit/

- [ ] add a Dockerfile for this repo
- [ ] contribute to the mcp registry https://github.com/docker/mcp-registry/blob/main/CONTRIBUTING.md

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/52) · 2025-09-17 · open · 0 comments

### Claim the MCP server on Glama

- [x] The aim is to claim the MCP server 
https://glama.ai/mcp/servers/@pnp/cli-microsoft365-mcp-server/score

- [ ] and improve its description to the latest state and sync

- [ ] Also at same time we may merge the PR https://github.com/pnp/cli-microsoft365-mcp-server/pull/8

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/50) · 2025-09-17 · closed · 1 comment

### 💡 [Feature]: Add a tool that brings in best practices for using CLI for Microsoft 365

### 🎯 Aim of the feature

The idea is to add a tool that the LM could use when creating a script that uses CLI for Microsoft 365 commands. The LM could retrieve/get additional context with best practices how CLI for M365 commands should be used in a script like  how to check auth, how to catch errors, how to handle output.

### 💡 idea 

How we could go about it is add a new .MD file with best practices for using CLI for Microsoft 365 in a script file for PowerShell in this repo and then add a MC

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/40) · 2025-08-06 · closed · 0 comments

### Refactor MCP server to use latest naming convention

MCP server got a refactor update...ye...AGAIN 😁. The latest [recommendation](https://github.com/modelcontextprotocol/typescript-sdk/tree/main?tab=readme-ov-file#display-names-and-metadata) is to use the word `register*` when adding tools, prompts, etc. Currently we use just `tool`. Along the way we could provide better, and shorter title for the tools

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/36) · 2025-08-03 · closed · 1 comment

### New sample for wiki

Hi, I wanted to share an example of MCP server usage that I posted on LinkedIn some time ago. If you find it useful, please feel free to use the content.

-----------------------------

# 8. Create a Report of Power Automate Flows That Failed in the Last 24 Hours
In this use case, the MCP server is used to retrieve a list of flows stored in the default environment. Then it gathers all failed runs from the last 24 hours, along with detailed information about the cause of each error. Additionally,

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/35) · 2025-08-01 · closed · external user · 1 comment

### 💡 [Feature]: Remote Hosting Support (e.g. Azure) for Integration with Copilot Studio

### 🎯 Aim of the feature

It would be great if the server could be hosted remotely, for example in Azure, so that it can be accessed and used from anywhere. This would also allow integration with tools like Copilot Studio, making the solution more flexible and broadly usable

### 📷 Images (if possible) with expected result

_No response_

### 🤔 Additional remarks or comments

_No response_

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/32) · 2025-07-15 · open · external user · 2 comments

### Add MCP to VS Code store

Contribute this MCP to https://code.visualstudio.com/mcp

[Read the thread](https://github.com/pnp/cli-microsoft365-mcp-server/issues/29) · 2025-07-10 · closed · 3 comments

The remaining reports are on [the project's issue tracker](https://github.com/pnp/cli-microsoft365-mcp-server/issues).
