cli-microsoft365-mcp-server: Skill for Claude Code

.github/skills/cli-microsoft365-script/SKILL.md

cli-microsoft365-script is a skill for Claude Code, Codex from pnp/cli-microsoft365-mcp-server. It costs 85 tokens per session (3,438 once invoked), scanned A, original, MIT.

A guide for writing PowerShell scripts that use CLI for Microsoft 365, a command-line tool for managing Microsoft 365 services. It covers SharePoint, Entra ID, Teams, and related administration tasks.

In plain words
What is it for?
Use it to automate Microsoft 365 administration, including SharePoint provisioning, Entra ID users and groups, and Teams setup.
Why use it?
It provides consistent command-line settings and authentication steps so scripts can process structured output and handle errors predictably.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

This is pnp/cli-microsoft365-mcp-server's own configuration. It tells Claude Code and Codex how to work on cli-microsoft365-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cli-microsoft365-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to pnp/cli-microsoft365-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/pnp/cli-microsoft365-mcp-server/main/.github/skills/cli-microsoft365-script/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/pnp/cli-microsoft365-mcp-server

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cli-microsoft365-script

README.md
[![agentmods](https://agentmods.dev/badge/skills/pnp/cli-microsoft365-mcp-server/cli-microsoft365-script/github.svg)](https://agentmods.dev/skills/pnp/cli-microsoft365-mcp-server/cli-microsoft365-script)
Your own site
<a href="https://agentmods.dev/skills/pnp/cli-microsoft365-mcp-server/cli-microsoft365-script"><img src="https://agentmods.dev/badge/skills/pnp/cli-microsoft365-mcp-server/cli-microsoft365-script/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cli-microsoft365-script

Your own site · 80×15
<a href="https://agentmods.dev/skills/pnp/cli-microsoft365-mcp-server/cli-microsoft365-script"><img src="https://agentmods.dev/badge/skills/pnp/cli-microsoft365-mcp-server/cli-microsoft365-script.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00085 $0.03438
Opus 5.5 $0.00034 $0.01375
Sonnet 5.5 $0.00017 $0.00688
Haiku 4.5 $0.00009 $0.00344

Measured 2mo ago against content hash 8a07b7dcec28, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cli-microsoft365-script scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/skills/cli-microsoft365-script/SKILL.md · 464 lines

How it starts

The opening of the file, as written. The whole thing — 464 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLI for Microsoft 365 — PowerShell Scripting

You are an expert at writing PowerShell scripts that use CLI for Microsoft 365 (m365) to automate Microsoft 365 management tasks. Follow these instructions when the user asks you to write a PowerShell script that uses CLI for Microsoft 365 commands.

Script Setup

Every PowerShell script using CLI for Microsoft 365 should start with proper configuration. Use this template as a starting point:

#!/usr/bin/env pwsh

$ErrorActionPreference = "Stop"

# Configure CLI for scripting
m365 cli config set --key "output" --value "json"
m365 cli config set --key "errorOutput" --value "stdout"
m365 cli config set --key "showHelpOnFailure" --value "false"
m365 cli config set --key "printErrorsAsPlainText" --value "false"
m365 cli config set --key "prompt" --value "false"
$env:CLIMICROSOFT365_NOUPDATE = "1"

# Ensure authentication
m365 login --ensure

Why these settings matter

Setting Value Purpose
output json Structured data for reliable parsing
errorOutput stdout Allows PowerShell to capture errors in variables
showHelpOnFailure false Prevents help text from polluting output
printErrorsAsPlainText false Returns errors as JSON for structured handling
prompt false Prevents interactive prompts that block automation

The $env:CLIMICROSOFT365_NOUPDATE = "1" environment variable disables update checks to avoid delays in automated scripts.

Authentication

Check and establish authentication

Always use m365 login --ensure at the start of every script. This command checks if you are already authenticated and only prompts for login if necessary:

    m365 login --ensure

Authentication for automation and CI/CD

For unattended scripts, use certificate-based or secret-based authentication:

    # Certificate-based (recommended for CI/CD)
    m365 login --authType certificate --certificateFile "C:\certs\app.pfx" --password $env:CERT_PASSWORD

    # Client secret
    m365 login --authType secret --secret $env:CLIENT_SECRET

    # Managed identity (Azure-hosted only)
    m365 login --authType identity

Read the full file on GitHub · 464 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 464 lines · 85 tokens per session scan A 8a07b7dcec28

Subscribe to this mod's changes

cli-microsoft365-script is a skill published in the GitHub repository pnp/cli-microsoft365-mcp-server (135 stars, last pushed 4d ago), licensed MIT. It adds 85 tokens to every session and 3,438 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

cli-microsoft365-script compared with skills from other repositories

cli-microsoft365-script next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cli-microsoft365-scriptpnp/cli-microsoft365-mcp-serverSkill1354d agoMITA85Claude Code, Codex
zdx-investigate-multi-app-outagezscaler/zscaler-mcp-serverSkill5510d agoMITA155Claude Code
microsoft365-expertpersonamanagmentlayer/pclSkill4411d agoApache-2.0A78Claude Code
gke-compute-classesgoogle/skillsSkill22kyesterdayApache-2.0A83Claude Code, Codex
gke-reliabilitygoogle/skillsSkill22kyesterdayApache-2.0A85Claude Code, Codex
gke-workload-securitygoogle/skillsSkill22kyesterdayApache-2.0A171Claude Code, Codex
nemo-automodel-launcher-configNVIDIA/skillsSkill3.9kyesterdayApache-2.0A30Claude Code