Official agent skill

Msgraph SDK

by github in github/awesome-copilot

Integrate Microsoft Graph SDK into any project — .NET, TypeScript/JavaScript, or Python.

OfficialMITAuto-check passedDocuments & Office

Install Msgraph SDK

skills CLI
$ npx skills add github/awesome-copilot --skill msgraph-sdk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install github/awesome-copilot msgraph-sdk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/msgraph-sdk .claude/skills/msgraph-sdk && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
msgraph-sdk
GitHub stars
40k
Token cost
~2.1k tokens
SKILL.md length
1,014 words
Files
4 (incl. references)
Skills in repo
417
Repo updated
First seen
Licence
MIT

At a glance

Integrate Microsoft Graph SDK into any project — .NET, TypeScript/JavaScript, or Python.

  • Works in 4 steps: Use the .NET workflow when the project… → Use the TypeScript / JavaScript workflow… → Use the Python workflow when the project… → …
  • Accessing Microsoft 365 data (users
  • SKILL.md covers Determine the target language…, Always consult live…, Authentication — choose the… and Core SDK usage patterns, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Msgraph SDK is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. Integrate Microsoft Graph SDK into any project — .NET, TypeScript/JavaScript, or Python. Covers auth patterns (client credentials, OBO, managed identity), SDK setup, calling Graph APIs, batching, delta queries, change notifications, throttling, and permission scopes. Use when accessing Microsoft 365 data (users, mail, calendar, Teams, files, SharePoint) from any application type.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/dotnet.md`, `references/python.md` and `references/typescript.md`).

It sits in Documents & Office, covering Cloud office suites. It works with Microsoft 365, Python, TypeScript and .NET. The repository describes itself as: Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot. The licence is MIT.

When your agent uses it

  • Accessing Microsoft 365 data (users
  • SharePoint) from any application type

Example prompts

  • “/msgraph-sdk”

Requirements

  • Python 3
  • Node.js

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Use the .NET workflow when the project contains .cs, .csproj, or .sln files, or when the user asks for C# guidance. Follow…
  2. Use the TypeScript / JavaScript workflow when the project contains package.json, .ts, or .js files, or when the user asks for Node.js /…
  3. Use the Python workflow when the project contains .py, pyproject.toml, or requirements.txt, or when the user asks for Python guidance…
  4. If multiple languages are present, match the language of the files being edited or ask the user.

What it can do on your machine

Read from SKILL.md and the folder at commit 7cce7cf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com
    • developer.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Msgraph SDK loads about 2.1k tokens when it runs, and up to ~7.8k if it reads all its reference files. Until then it costs about 99 tokens; SKILL.md has 1,014 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from github/awesome-copilot at commit 7cce7cf, republished under its MIT licence (© github). 1,014 words, ~2,054 tokens.

Download SKILL.mdSave it as .claude/skills/msgraph-sdk/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
msgraph-sdk
description
Integrate Microsoft Graph SDK into any project — .NET, TypeScript/JavaScript, or Python. Covers auth patterns (client credentials, OBO, managed identity), SDK setup, calling Graph APIs, batching, delta queries, change notifications, throttling, and permission scopes. Use when accessing Microsoft 365 data (users, mail, calendar, Teams, files, SharePoint) from any application type.

Microsoft Graph SDK

Use this skill when integrating Microsoft Graph into an application to access Microsoft 365 data and services.

Always ground implementation in the current Microsoft Graph SDK documentation and SDK version for the target language rather than relying on memory alone.

Determine the target language first

  1. Use the .NET workflow when the project contains .cs, .csproj, or .sln files, or when the user asks for C# guidance. Follow references/dotnet.md.
  2. Use the TypeScript / JavaScript workflow when the project contains package.json, .ts, or .js files, or when the user asks for Node.js / browser guidance. Follow references/typescript.md.
  3. Use the Python workflow when the project contains .py, pyproject.toml, or requirements.txt, or when the user asks for Python guidance. Follow references/python.md.
  4. If multiple languages are present, match the language of the files being edited or ask the user.

Always consult live documentation

Authentication — choose the right pattern

Selecting the wrong auth flow is the most common Graph integration mistake. Apply this decision tree before writing any auth code:

ScenarioFlow to use
Background service / daemon with no userClient credentials (app-only)
Agent or API acting on behalf of a signed-in userOn-Behalf-Of (OBO)
App running in Azure (Function, Container App, VM)Managed Identity (preferred over secrets)
CLI tool or local dev scriptDevice code or interactive browser
Single-page app (browser only)Authorization code + PKCE
  • Never use client credentials when a user context is required — Graph enforces this at the permission level (application vs. delegated).
  • Prefer DefaultAzureCredential in Azure-hosted apps; it tries managed identity first and falls back gracefully for local dev.
  • Never hardcode secrets. Use environment variables, Azure Key Vault, or the Secret Manager.

Core SDK usage patterns

Building the client

Always construct GraphServiceClient once and reuse it (it manages token caching internally).

Pass a credential from the Azure Identity library — never build raw HTTP clients manually.

Making calls
  • Use the fluent builder API: client.Users[userId].Messages.GetAsync(...).
  • Always await async calls.
  • Specify $select to limit returned fields — Graph returns large default payloads.
  • Use $filter server-side rather than filtering returned collections in memory.
  • Use $expand to fetch related resources in a single call when relationships are small.
Pagination

Graph paginates collections. Never assume all items arrive in one response:

  • Check for an @odata.nextLink on the response.
  • Use the SDK's PageIterator helper (available in all three SDKs) to walk pages automatically.
  • Set $top to control page size (max varies by resource, typically 999).

Advanced patterns

Batch requests

Combine up to 20 independent Graph calls into a single HTTP request using the $batch endpoint. Use batching when:

  • Initializing data for a dashboard or agent that needs multiple resources upfront.
  • Reducing latency in high-call-count operations.

Batch responses arrive out of order — match them by the id field you assigned each request.

Delta queries

Use delta queries to sync changes incrementally instead of polling full collections:

  • First call: GET /users/delta returns all items + a @odata.deltaLink.
  • Subsequent calls: use the deltaLink to receive only what changed since the last sync.
  • Supported on: users, groups, messages, calendar events, Teams channels, and more.
  • Store the deltaLink durably (database, blob) between sync runs.
Change notifications (webhooks)

Subscribe to resource changes with POST /subscriptions:

  • Graph delivers change events to your HTTPS notification URL.
  • Subscriptions expire — renew them before expirationDateTime (max varies by resource; typically 1–3 days for mail/calendar, up to 4230 minutes for users/groups).
  • Validate the subscription handshake: Graph sends a validationToken query parameter on creation — echo it back as plain text with HTTP 200.
  • Use lifecycle notifications (notificationUrl + lifecycleNotificationUrl) to handle missed events and reauthorization.
  • For high-volume scenarios prefer change notifications with resource data (requires additional encryption setup).
Show full SKILL.md (387 more words)Show less
Throttling

Graph throttles aggressively. Always handle HTTP 429:

  • Read the Retry-After header — it specifies exact seconds to wait, not a fixed backoff.
  • The SDK's built-in retry middleware handles 429 automatically when configured; enable it explicitly.
  • Avoid fan-out patterns that hit Graph with hundreds of parallel requests; use batching or queuing instead.

Permissions

Get permissions right before writing auth code — wrong scopes result in 403 errors that are hard to debug later.

  • Application permissions run without a user (daemon / service). Require admin consent.
  • Delegated permissions run in the context of a signed-in user. Some require admin consent.
  • Request the minimum permissions needed. Graph's permission reference lists least-privilege options for every operation.
  • Use the Graph Explorer to test which permissions a call actually requires before coding.
  • In Azure app registrations: grant API permissions → Microsoft Graph → select type (Application or Delegated) → grant admin consent where required.

Common Graph resources — quick reference

GoalResource path
Get signed-in user's profileGET /me
List user's mailbox messagesGET /me/messages
Send an emailPOST /me/sendMail
List calendar eventsGET /me/events
Get user's OneDrive rootGET /me/drive/root/children
List Teams the user is inGET /me/joinedTeams
Post a Teams channel messagePOST /teams/{id}/channels/{id}/messages
List SharePoint site listsGET /sites/{siteId}/lists
Search across M365POST /search/query
List all users in tenant (app-only)GET /users
Get group membersGET /groups/{id}/members

In similar fashion, use the SDK's fluent API to navigate to these resources in code.

Workflow

  1. Determine the target language and read the matching reference file.
  2. Identify the auth scenario and choose the correct flow from the table above.
  3. Fetch current SDK docs and Graph Explorer examples before making implementation choices.
  4. Apply least-privilege permissions — confirm in the Graph permissions reference.
  5. Implement pagination from the start — don't assume single-page responses.
  6. Enable retry middleware for throttling from day one.
  7. For syncing scenarios, prefer delta queries over polling.
  8. Use the language-specific package names, auth provider setup, and code patterns from the chosen reference file.

Completion criteria

  • Auth flow matches the scenario (not defaulting to client credentials for user-context calls).
  • GraphServiceClient is constructed once and reused.
  • All collection reads handle pagination.
  • Throttling (429) is handled via retry middleware or explicit Retry-After logic.
  • Permissions are scoped to the minimum required.
  • No secrets or credentials are hardcoded.
  • Code matches current SDK version patterns for the selected language.

© github, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/msgraph-sdk of github/awesome-copilot.

  • SKILL.md
  • references/dotnet.md
  • references/python.md
  • references/typescript.md

Open the folder on GitHubat commit 7cce7cf

Compare with similar skills

Msgraph SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Msgraph SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Msgraph SDK this skillgithub/awesome-copilot40k—~2.1kAutomated safety check: PassMIT
Sharepoint Safe HTMLpnp/sharepoint-skills131—~6.4kAutomated safety check: PassMIT
Git HooksProrise-cool/Claude-Code-Multi-Agent305—~3.6kAutomated safety check: NotesNone
CLI Microsoft365pnp/cli-microsoft365-mcp-server131—~3.5kAutomated safety check: PassMIT
Spfx Releasepnp/docker-spfx134—~572Automated safety check: NotesMIT
CLI Microsoft365 Scriptpnp/cli-microsoft365-mcp-server131—~3.3kAutomated safety check: PassMIT

Similar skills

  • Sharepoint Safe HTML

    pnp/sharepoint-skills

    Creates accessible, single-file HTML artifacts that render reliably in SharePoint, OneDrive, Teams, File Viewer, and embedded iframe preview surfaces.

    131 GitHub stars~6.4k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Git Hooks

    Prorise-cool/Claude-Code-Multi-Agent

    Central authority on git hook implementations, modern best practices, and tooling for .NET/C, JavaScript/TypeScript, Python, and polyglot repositories.

    305 GitHub stars~3.6k tokensUpdated 22 days ago
    DevelopmentAuto-check: notes
  • CLI Microsoft365

    pnp/cli-microsoft365-mcp-server

    Use CLI for Microsoft 365 to manage Microsoft 365 tenants from the terminal.

    131 GitHub stars~3.5k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Spfx Release

    pnp/docker-spfx

    Automate SPFx version releases - branch, update files, commit, open PR, then tag after merge

    134 GitHub stars~572 tokensUpdated 3 mo ago
    Documents & OfficeAuto-check: notes
  • CLI Microsoft365 Script

    pnp/cli-microsoft365-mcp-server

    Write PowerShell scripts using CLI for Microsoft 365 commands to automate Microsoft 365 management tasks.

    131 GitHub stars~3.3k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • M365 Agents Py

    microsoft/skills

    Official

    Microsoft 365 Agents SDK for Python. An agent skill from microsoft/skills.

    3.1k GitHub starsUsed in 6 repos~3.5k tokens
    Documents & OfficeAuto-check: notes

More from github/awesome-copilot

All 417 skills in this repo
  • Acquire Codebase Knowledge

    github/awesome-copilot

    Official

    Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Azure Architecture Autopilot

    github/awesome-copilot

    Official

    Designs Azure infrastructure from a natural-language description, or diagrams an existing resource group, then refines the design through conversation and deploys it with Bicep.

    40k GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Draw.io Diagram Generator

    github/awesome-copilot

    Official

    Generates, edits and validates draw.io files with correct mxGraph XML, covering flowcharts, architecture, sequence, ER and UML class diagrams.

    40k GitHub starsUsed in 1 repo~4.9k tokens
    Auto-check passed
  • Credit Risk Data Cleaning

    github/awesome-copilot

    Official

    Cleans raw credit data and screens variables before loan modeling, dropping unstable, noisy or redundant features and writing an Excel report of every step.

    40k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Daily Focus Board

    github/awesome-copilot

    Official

    Builds a warm, browser-based daily focus board the user updates by talking to their agent, with Eisenhower priorities, a brain-dump box and kind not-today carryover.

    40k GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Python Pypi Package Builder

    github/awesome-copilot

    Official

    End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI.

    40k GitHub starsUsed in 1 repo~4.6k tokens
    Auto-check passed

Questions about Msgraph SDK

What does Msgraph SDK do?

Integrate Microsoft Graph SDK into any project — .NET, TypeScript/JavaScript, or Python. Msgraph SDK is an agent skill from github/awesome-copilot, published by the product's own GitHub organization.NET, TypeScript/JavaScript, or Python.

When should I use Msgraph SDK?

Msgraph SDK fits situations like: accessing Microsoft 365 data (users; sharePoint) from any application type.

How do I install Msgraph SDK in Claude Code?

Run `npx skills add github/awesome-copilot --skill msgraph-sdk -a claude-code`. Or copy the skill folder (skills/msgraph-sdk in github/awesome-copilot) into .claude/skills/msgraph-sdk in your project. Claude Code loads it when a task matches its description.

How do I install Msgraph SDK in Codex?

Run `npx skills add github/awesome-copilot --skill msgraph-sdk -a codex`. Or copy the skill folder (skills/msgraph-sdk in github/awesome-copilot) into .agents/skills/msgraph-sdk in your project. Codex loads it when a task matches its description.

Can I use Msgraph SDK in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add github/awesome-copilot --skill msgraph-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/msgraph-sdk, .gemini/skills/msgraph-sdk, .github/skills/msgraph-sdk and .opencode/skills/msgraph-sdk in your project.

What does Msgraph SDK need to run?

SKILL.md names no scripts, command-line tools or credentials: Msgraph SDK is instructions for the agent only. Our summary lists: Python 3; Node.js.

Does Msgraph SDK access the network?

SKILL.md names 2 domains. As links in the text: learn.microsoft.com and developer.microsoft.com. This is read from the text; nothing was executed.

Is Msgraph SDK safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Msgraph SDK use?

Msgraph SDK is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Msgraph SDK use?

About 2.1k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.7k tokens, read only when the agent opens those files.

What are the alternatives to Msgraph SDK?

Skills that share tags, products or a category with Msgraph SDK: Sharepoint Safe HTML (pnp/sharepoint-skills, 131 stars), Git Hooks (Prorise-cool/Claude-Code-Multi-Agent, 305 stars), CLI Microsoft365 (pnp/cli-microsoft365-mcp-server, 131 stars) and Spfx Release (pnp/docker-spfx, 134 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Msgraph SDK?

github (a GitHub organization, an official publisher) maintains it in github/awesome-copilot, which has 39,792 GitHub stars. The repository holds 417 skills in this directory. The repository was last updated on October 8, 2026.

Source: github/awesome-copilot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.