Skip to main content
Glama
Microsoft Graph MCP Server

Microsoft Graph MCP Server

by ry-ops

✨ Ask things like

"Onboard Jordan Lee to Sales with an E3 license." "Which licenses do we have, and how many are free?" "Who's in the Finance group?" "Find everyone called Taylor." "Move Sam from Marketing to Sales." "Who has access to the Projects SharePoint site? Give Alex read access."

Related MCP server: mcp-m365-mgmt

⚙️ How it works, and what it needs

The server signs in as an app registration with MSAL's client-credentials flow, with no user sign-in, and calls Microsoft Graph with that app-only token. What it can do is exactly what the application permissions you grant that app allow.

Area

Tools

Application permission

Users (4)

create_user ✎, get_user, search_user, list_users

User.ReadWrite.All (read-only: User.Read.All)

Licenses (2)

list_available_licenses, assign_license ✎ (with optional service plans turned off)

Organization.Read.All; assigning also needs User.ReadWrite.All

Groups (4)

list_groups, get_group_members, add_user_to_group ✎, remove_user_from_group ✎

Group.ReadWrite.All (read-only: Group.Read.All)

SharePoint (9)

list_sites, get_site, get_site_by_url, get_root_site, list_site_drives, list_site_lists, list_site_permissions, add_site_permission ✎, remove_site_permission ✎

Sites.Read.All; site permissions need Sites.FullControl.All

✎ = changes your tenant. New users get a temporary password and must change it at first sign-in, unless you say otherwise.

🚀 Setup

1. Register an app in the Entra admin center: go to App registrations → New registration. Then:

  • add the application permissions from the table above for the areas you want, and grant admin consent;

  • create a client secret;

  • note the tenant ID and client ID.

AZURE_SETUP.md walks through it step by step. Add the Sites.* permissions if you want the SharePoint tools.

2. Install. You need Python 3.10+ and uv.

git clone https://github.com/ry-ops/microsoft-graph-mcp-server
cd microsoft-graph-mcp-server
uv sync

3. Connect Claude Desktop. Add this to claude_desktop_config.json: ~/Library/Application Support/Claude/ on macOS, or %APPDATA%\Claude\ on Windows. There's a copy in claude_desktop_config.example.json.

{
  "mcpServers": {
    "microsoft-graph": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/microsoft-graph-mcp-server", "run", "mcp_graph_server.py"],
      "env": {
        "MICROSOFT_TENANT_ID": "your-tenant-id",
        "MICROSOFT_CLIENT_ID": "your-client-id",
        "MICROSOFT_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Quit and reopen Claude Desktop to load it. There are worked examples in EXAMPLES.md, a short version in QUICKSTART.md, and the design in PROJECT_OVERVIEW.md.

🔒 Security

  • Grant only the permissions you'll use. For a look-only assistant, use the .Read.All variants and leave SharePoint FullControl out.

  • App-only tokens are powerful. They act across the whole tenant, not as one person. Keep the client secret in your MCP client's env or a secrets manager, and rotate it.

  • Keep your MCP client's tool approval on. Creating users, assigning licenses and changing site access take effect immediately.

🤝 Agent-to-agent (A2A)

agent-card.json describes the server's skills, inputs and authentication for other agents to discover.

🩺 Troubleshooting

Set MICROSOFT_TENANT_ID, MICROSOFT_CLIENT_ID and MICROSOFT_CLIENT_SECRET in the env block.

The app is missing an application permission for that tool, or admin consent wasn't granted. Check the table above.

Add Sites.Read.All, plus Sites.FullControl.All for the site-permission tools, and grant admin consent again.

🙌 Contributors

SharePoint site management was contributed by @caffeinebounce in #1. Thank you!

License

MIT. See LICENSE.


Available Tools

19 tools
add_site_permissionC

Add a user permission to a SharePoint site

Inputs: site_id (required), user_id (required), role.

add_user_to_groupB

Add a user to a group (also grants access to group-connected SharePoint sites)

Inputs: user_id (required), group_id (required).

assign_licenseC

Assign a license to a user

Inputs: sku_id (required), user_id (required), disabled_plans.

create_userC

Create a new user in Microsoft 365

Inputs: password (required), display_name (required), mail_nickname (required), user_principal_name (required), +2 more.

get_group_membersC

Get all members of a group

Inputs: group_id (required).

get_root_siteB

Get the root SharePoint site for the tenant

Inputs: no named parameters.

get_siteA

Get details for a specific SharePoint site by ID

Inputs: site_id (required).

get_site_by_urlB

Get a SharePoint site by hostname and path

Inputs: hostname (required), site_path (required).

get_userC

Get details for a specific user

Inputs: user_id (required).

list_available_licensesA

List all available licenses (SKUs) in the tenant

Inputs: no named parameters.

list_groupsB

List all groups in the tenant

Inputs: no named parameters.

list_site_drivesB

List document libraries in a SharePoint site

Inputs: site_id (required).

list_site_listsC

List all lists in a SharePoint site

Inputs: site_id (required).

list_site_permissionsC

List all permissions on a SharePoint site

Inputs: site_id (required).

list_sitesA

List SharePoint sites in the tenant. Optionally search by name.

Inputs: search.

list_usersC

List all users in the tenant

Inputs: top.

remove_site_permissionC

Remove a permission from a SharePoint site

Inputs: site_id (required), permission_id (required).

remove_user_from_groupC

Remove a user from a group

Inputs: user_id (required), group_id (required).

search_userC

Search for users by display name or email

Inputs: search_term (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 19 tools

    Disambiguation4/5

    Most tools have clearly distinct resource+action targets, but the site-lookup family (get_site, get_site_by_url, get_root_site, plus list_sites with an optional search) offers four overlapping ways to reach a site, and search is a separate tool for users but a parameter for sites. User read tools (list_users, get_user, search_user) are distinguishable but close enough to occasionally confuse an agent.

    Naming Consistency5/5

    Every tool follows a consistent snake_case verb_noun pattern (create_user, list_site_permissions, remove_site_permission, get_group_members). Verbs are used predictably for their operations (list_ for enumeration, get_ for single-resource retrieval, add_/remove_ for membership and permissions).

    Tool Count4/5

    At 19 tools covering users, licenses, groups, SharePoint sites, permissions, drives, and lists, each tool maps to a distinct resource scope and the set is reasonably scoped. It sits at the upper end of comfortable, with the four site-getter tools being the main candidates for consolidation.

    Completeness3/5

    The surface is list/create-heavy: users can be created but not updated or deleted, licenses can be assigned but not revoked, and permissions can be added and removed but not updated. Most notably, list_site_drives is a dead end—there are no tools to enumerate drive items or read/write file content, which is a core Graph/SharePoint workflow left uncovered.

    Maintenance

    ActivitySlowing
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      Not graded
      maintenance
      Provides comprehensive management of Microsoft 365 services including Exchange, SharePoint, Teams, Azure AD, Intune device management, security & compliance frameworks, and universal access to 1000+ Microsoft Graph API endpoints with advanced features like batch operations, delta queries, and real-time webhooks.
      50
      15
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables identity provisioning and management for Microsoft 365/Entra ID via Microsoft Graph, including user creation, license assignment, group membership management, and more, with a focus on least-privilege and idempotency.
      18
      Apache 2.0