Get the FREE Ultimate OpenClaw Setup Guide →

microsoft-graph

MCP server integrating Microsoft Graph API for managing Microsoft 365 users, licenses, and groups

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ry-ops-microsoft-graph-mcp-server uvx microsoft_graph_mcp_server

How to use

This MCP server exposes Microsoft Graph capabilities through an integration with Claude, enabling automated administration of Microsoft 365 users, licenses, and groups. It supports creating new users, assigning licenses with optional service plan customization, adding users to groups, and querying available licenses or groups. The server uses a Python-based implementation and is designed to be managed through MCP tooling and Claude agent-to-agent communications for automated workflows. After starting the server, you can invoke its commands via MCP clients to perform common admin tasks, as well as leverage Claude to generate or modify user records, group memberships, and license configurations in a conversational or scripted fashion.

How to install

Prerequisites:

  • Python 3.10+ installed
  • uv package manager (uv) installed

Installation steps:

  1. Install uv (if not already installed) macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

  2. Clone or set up the project directory mkdir microsoft-graph-mcp cd microsoft-graph-mcp

  3. Prepare Python environment and install the server package

    Create and activate a virtual environment using uv

    uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate

    Install the package in editable mode (as described in the repo)

    uv pip install -e .

  4. Configure environment variables (see below) and start using the MCP server

Environment variables and configuration: Create a .env file in the project root with: MICROSOFT_TENANT_ID=your-tenant-id MICROSOFT_CLIENT_ID=your-client-id MICROSOFT_CLIENT_SECRET=your-client-secret

Notes:

  • Ensure you have an Azure AD app registered with the required permissions (User.ReadWrite.All, Directory.ReadWrite.All, Group.ReadWrite.All, Organization.Read.All) and admin consent.
  • The server expects these credentials to authenticate to Microsoft Graph.

To run the server in your MCP environment, use the mcp_config shown above (uvx with the appropriate package name).

Additional notes

Tips and common issues:

  • Ensure your Azure AD app has the necessary permissions granted and a valid client secret.
  • If you encounter environment variable issues, double-check the .env file path and that the file is loaded by the server process.
  • If the package name used in the mcp_config does not match your installation, adjust the args to reflect the actual Python package name defined in pyproject.toml or setup.py.
  • When running on Windows, use the Windows activation command for the virtual environment and adapt path separators accordingly.
  • The server exposes operations for user creation, license assignment, and group management; use Claude’s UI or CLI integrations to invoke these actions through the MCP protocol.

Related MCP Servers

Sponsor this space

Reach thousands of developers