Skip to main content
Glama
EntraID MCP Server

EntraID MCP Server

by baoduy

EntraID MCP Server

An MCP server that lets an AI client such as Claude Desktop or Cursor read and manage your Microsoft Entra ID tenant — users, groups, MFA, devices, policies, logs and app registrations — through 48 Microsoft Graph tools.

📖 Overview

  • Users — search users, read a profile, list privileged users and a user's groups and roles (resources/users.py).

  • Groups — find, create, change and delete groups; add and remove members and owners (resources/groups.py).

  • Sign-in logs — a user's sign-ins over the last days (resources/signin_logs.py).

  • MFA — registered authentication methods for a user or every user in a group (resources/mfa.py).

  • Devices (Intune) — managed devices, detected apps, compliance and configuration, on the Graph beta endpoint (resources/managed_devices.py).

  • Conditional access — the tenant's policies as flat rows (resources/conditional_access.py).

  • Audit logs — the directory changes a user made (resources/audit_logs.py).

  • Password management — reset a password to a given or generated value; read password methods (resources/password_auth.py).

  • Permissions helper — suggest and search Microsoft Graph permissions (resources/permissions_helper.py).

  • Applications — list, read, create, change and delete app registrations (resources/applications.py).

  • Service principals — list, read, create, change and delete service principals (resources/service_principals.py).

Every tool carries an MCP mark, so a client can let lookups run and ask before a change: 34 tools are read-only; 5 change the tenant without destroying anything (the 3 creates, add member, add owner); 9 are destructive (the 3 deletes, remove member, remove owner, the password reset and the 3 updates).

The server publishes tools only — no MCP resources or prompts. It is started and called by an AI client on behalf of an Entra ID admin. It runs on the admin's machine, talks to the client over standard input and output, and signs in to Microsoft Graph as the admin (or as an app you configure).

Related MCP server: Microsoft Entra MCP Server

🏗️ Runtime architecture

An AI client sends tools/call over stdio to the FastMCP server, which dispatches to a tool function in server.py, then to a resource module, which uses GraphClient to call Microsoft Graph v1.0 (or beta for devices); on the first call GraphAuthManager gets a token from Microsoft Entra ID; main() starts the server after loading the first .env file found.

🌐 Downstream systems

System

What for

How

When it is down

Microsoft Graph v1.0

Every tool except the 9 device tools and the 2 permission-suggestion tools

HTTPS through msgraph-sdk

The tool call ends in an error result; the server sets no timeout or retry of its own

Microsoft Graph beta

The 9 device (Intune) tools

HTTPS through msgraph-beta-sdk

As above

Microsoft Entra ID

A token for Graph, on the first Graph call

The azure-identity credential the configuration selects

The tool call ends in an error result

The identity the server signs in as needs Graph permissions for the tools you use. Microsoft Graph checks them; the server checks none. This list is carried over from the previous README (application permissions):

Permission

For

User.Read.All

Users

Directory.Read.All

Directory data: users, groups, roles

RoleManagement.Read.Directory

Directory roles

Group.Read.All, GroupMember.Read.All

Reading groups and members

Group.ReadWrite.All

Creating, changing and deleting groups; adding and removing members and owners

AuditLog.Read.All

Sign-in logs and audit logs

UserAuthenticationMethod.Read.All

MFA and password methods

User-PasswordProfile.ReadWrite.All

Password reset (see ❓ Open questions)

Policy.Read.All, AuthenticationContext.Read.All

Conditional access policies

DeviceManagementManagedDevices.Read.All, DeviceManagementConfiguration.Read.All, DeviceManagementApps.Read.All

Device tools

Application.ReadWrite.All

Creating, changing and deleting applications and service principals

🚀 Quick Start

You need uv and Python 3.10 or later. The package pulls in fastmcp on its 4.x line (fastmcp>=4.1.3,<5), msgraph-sdk, msgraph-beta-sdk, msgraph-core, azure-identity, azure-core and python-dotenv, each pinned below its next major version in pyproject.toml.

  1. Sign in to Azure with an account that has the permissions above. The server uses this login by default:

    az login
  2. Add the server to the mcpServers object of your AI client's MCP settings — Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json:

    {
      "mcpServers": {
        "entraid": {
          "command": "uvx",
          "args": ["entraid-mcp-server"]
        }
      }
    }

    uvx downloads the latest release from PyPI and starts it; add @<version> to the package name to pin one.

  3. To sign in as an app instead of your Azure login (no interactive login available, for example), add an env block to the same entry. Never commit real values:

    "env": {
      "TENANT_ID": "<your-tenant-id>",
      "CLIENT_ID": "<your-client-id>",
      "CLIENT_SECRET": "<your-client-secret>"
    }

    Certificate sign-in, .env files and the order the server tries credentials in: configuration.

  4. Restart the client so it starts the server.

To run from a clone instead (from the repo root, with uv installed):

uv sync
uv run entraid-mcp-server          # or: uv run python -m msgraph_mcp_server

With the package installed in an environment (pip install entraid-mcp-server), the entraid-mcp-server command starts the same server.

✅ Verify it works

In your AI client, list the server's tools: you should see 48. Then call list_permission_categories_and_tasks — it needs no Graph access, so it works before any permission is granted. The result starts:

{"status": "success", "categories": {"users": {"tasks": [{"name": "read_user_profile", "description": "Read user profile information"}, ...

with the categories users, groups, mail, calendar, files, devices, audit_logs and directory. The server signs in only on the first tool that calls Microsoft Graph, so a sign-in problem shows up there, as the tool's error result.

The client also sees the server's name, EntraID MCP Server, and its version: the installed release number (from a clone, the version in pyproject.toml).

🛠️ Common commands

All from the repo root:

Command

What it does

uv sync --locked

Install the locked dependencies, dev tools included

uv build

Build the wheel and source archive into dist/

uv run pytest

Run the unit tests (an in-memory Microsoft Graph; no tenant needed)

uv run ruff check

Lint

uv run ruff format --check

Check formatting

uv run entraid-mcp-server

Start the server on stdio

Releases are automatic: there is no publish command to run. A pull request to dev, and a push to dev, run the check workflow (build, tests, lint, format). When dev is merged into main and the push touches src/msgraph_mcp_server/, pyproject.toml, README.md, LICENSE or the publish workflow, the publish workflow (which can also be started by hand on main) computes the next version from the git tags, builds the package, publishes it to PyPI and creates the GitHub release.

⚠️ Known limitations

  • The device tools use the Microsoft Graph beta endpoint, which Microsoft can change without notice.

  • The server sets no timeout or retry of its own; a slow or failing Graph call ends the tool call with an error result.

  • search_groups_by_name matches the start of the display name, not any part of it.

  • create_group is several Graph calls with no rollback: if an owner or member add fails, the group stays created.

  • reset_user_password_direct returns a generated password in its result, so it reaches the AI client's conversation.

  • Membership checks and searches read Graph with eventual consistency: a change made moments earlier may not be seen yet.

📚 Documentation

Page

Answers

Users

How to find users and read their groups and roles

Groups

How groups, members and owners are managed, and what each result means

Sign-in logs

How to read a user's sign-ins

MFA

How MFA status is worked out for a user or a group

Devices (Intune)

Which device, compliance and configuration data you can read

Conditional access

How policies are flattened into rows

Audit logs

How to read the changes a user made

Password management

How a reset works and how the password is protected

Permissions helper

How to find the Graph permissions a task needs

Applications

How app registrations are managed

Service principals

How service principals are managed

Configuration

Which settings choose how the server signs in, and where it reads them

LICENSE

MIT licence

❓ Open questions

Question

Why it matters

Checked

Who can answer

Is the permissions table above complete and least-privilege for the current 48 tools?

Admins grant exactly what this table says.

The code checks no permission; the table is carried over from the previous README. Only get_user_sign_ins names a permission in code (AuditLog.Read.All).

Maintainer (baoduy)

Does the password reset need User-PasswordProfile.ReadWrite.All (this table) or User.ReadWrite.All (the permissions helper's suggestion)?

A wrong grant makes the reset fail, or grants more than needed.

reset_user_password_direct sends PATCH /users/{id} with passwordProfile; COMMON_PERMISSION_MAPPINGS lists User.ReadWrite.All.

Maintainer (baoduy)

Where should users report problems or ask for support?

The README names no support route.

pyproject.toml lists the GitHub issues page as Issues; no support policy is in the repo.

Maintainer (baoduy)

Available Tools

48 tools
add_group_memberAdd Group MemberC

Add a member to a group.

Inputs: group_id (required), member_id (required). Returns: object

add_group_ownerAdd Group OwnerC

Add an owner to a group.

Inputs: group_id (required), owner_id (required). Returns: object

create_applicationCreate ApplicationC

Create a new application (app registration).

Inputs: app_data (required). Returns: object

create_groupCreate GroupC

Create a new group in Microsoft Graph.

Inputs: group_data (required). Returns: object

create_service_principalCreate Service PrincipalC

Create a new service principal.

Inputs: sp_data (required). Returns: object

delete_applicationDelete ApplicationA
Destructive

Delete an application (app registration) by its object ID.

Inputs: app_id (required). Returns: object

delete_groupDelete GroupC
Destructive

Delete a group from Microsoft Graph.

Inputs: group_id (required). Returns: object

delete_service_principalDelete Service PrincipalC
Destructive

Delete a service principal by its object ID.

Inputs: sp_id (required). Returns: object

get_all_graph_permissionsGet All Graph PermissionsB
Read-only

Get all Microsoft Graph permissions directly from the Microsoft Graph API.

Inputs: no named parameters. Returns: object

get_all_groupsGet All GroupsC
Read-only

Get all groups (up to the specified limit, with paging).

Inputs: limit. Returns: result

get_all_managed_devicesGet All Managed DevicesA
Read-only

Get all managed devices (optionally filter by OS).

Inputs: filter_os. Returns: result

get_application_by_idGet Application By IdB
Read-only

Get a specific application by its object ID.

Inputs: app_id (required). Returns: result

get_conditional_access_policiesGet Conditional Access PoliciesB
Read-only

Get all conditional access policies.

Inputs: no named parameters. Returns: result

get_conditional_access_policy_by_idGet Conditional Access Policy By IdB
Read-only

Get a single conditional access policy by its ID with comprehensive details.

Inputs: policy_id (required). Returns: object

get_detected_apps_for_deviceGet Detected Apps For DeviceA
Read-only

Get applications detected on a specific Intune managed device (beta endpoint).

Inputs: device_id (required). Returns: result

get_device_categoriesGet Device CategoriesA
Read-only

List all Intune device categories (beta endpoint).

Inputs: no named parameters. Returns: result

get_device_compliance_policiesGet Device Compliance PoliciesA
Read-only

List all Intune device compliance policies (beta endpoint).

Inputs: no named parameters. Returns: result

get_device_compliance_policy_statesGet Device Compliance Policy StatesB
Read-only

Get compliance-policy states for a specific Intune managed device (beta endpoint).

Inputs: device_id (required). Returns: result

get_device_configurationsGet Device ConfigurationsA
Read-only

List all Intune device configuration profiles (beta endpoint).

Inputs: no named parameters. Returns: result

get_device_configuration_statesGet Device Configuration StatesB
Read-only

Get configuration-profile states for a specific Intune managed device (beta endpoint).

Inputs: device_id (required). Returns: result

get_group_by_idGet Group By IdC
Read-only

Get a specific group by its ID.

Inputs: group_id (required). Returns: result

get_group_membersGet Group MembersB
Read-only

Get members of a group by group ID (up to the specified limit, with paging).

Inputs: group_id (required), limit. Returns: result

get_group_mfa_statusGet Group Mfa StatusB
Read-only

Get MFA status for all members of a group.

Inputs: group_id (required). Returns: result

get_managed_device_by_idGet Managed Device By IdB
Read-only

Get full details of a single Intune managed device (beta endpoint).

Inputs: device_id (required). Returns: result

get_managed_devices_by_userGet Managed Devices By UserC
Read-only

Get all managed devices for a specific userId.

Inputs: user_id (required). Returns: result

get_privileged_usersGet Privileged UsersA
Read-only

Get all users who are members of privileged directory roles.

Inputs: no named parameters. Returns: result

get_service_principal_by_idGet Service Principal By IdB
Read-only

Get a specific service principal by its object ID.

Inputs: sp_id (required). Returns: result

get_user_audit_logsGet User Audit LogsB
Read-only

Get all relevant directory audit logs for a user by user_id within the last N days (default 30).

Inputs: user_id (required), days. Returns: result

get_user_by_idGet User By IdC
Read-only

Get a specific user by their ID.

Inputs: user_id (required). Returns: result

get_user_groupsGet User GroupsA
Read-only

Get all groups (including transitive memberships) for a user by user ID.

Inputs: user_id (required). Returns: result

get_user_mfa_statusGet User Mfa StatusA
Read-only

Get MFA status and methods for a specific user.

Inputs: user_id (required). Returns: result

get_user_password_methodGet User Password MethodC
Read-only

Get a specific password authentication method for a user.

Inputs: user_id (required), method_id (required). Returns: result

get_user_rolesGet User RolesA
Read-only

Get all directory roles assigned to a user by user ID.

Inputs: user_id (required). Returns: result

get_user_sign_insGet User Sign InsA
Read-only

Get sign-in logs for a specific user within the last N days.

Requires AuditLog.Read.All permission.

Inputs: user_id (required), days. Returns: result

list_applicationsList ApplicationsB
Read-only

List all applications (app registrations) in the tenant, with paging.

Inputs: limit. Returns: result

list_permission_categories_and_tasksList Permission Categories And TasksA
Read-only

List all available categories and tasks for permission suggestions.

Inputs: no named parameters. Returns: object

list_service_principalsList Service PrincipalsA
Read-only

List all service principals in the tenant, with paging.

Inputs: limit. Returns: result

list_user_password_methodsList User Password MethodsC
Read-only

List a user's password authentication methods.

Inputs: user_id (required). Returns: result

remove_group_memberRemove Group MemberC
Destructive

Remove a member from a group.

Inputs: group_id (required), member_id (required). Returns: object

remove_group_ownerRemove Group OwnerC
Destructive

Remove an owner from a group.

Inputs: group_id (required), owner_id (required). Returns: object

reset_user_password_directReset User Password DirectC
Destructive

Reset a user's password with a specific password value.

Inputs: user_id (required), password, password_length, generate_password, +1 more. Returns: object

search_groups_by_nameSearch Groups By NameA
Read-only

Search for groups whose display name starts with the given text (case-insensitive, with paging).

Inputs: name (required), limit. Returns: result

search_permissionsSearch PermissionsC
Read-only

Search for Microsoft Graph permissions by keyword.

Inputs: search_term (required), permission_type. Returns: object

search_usersSearch UsersB
Read-only

Search for users by name or email.

Inputs: query (required), limit. Returns: result

suggest_permissions_for_taskSuggest Permissions For TaskC
Read-only

Suggest Microsoft Graph permissions for a specific task based on common mappings.

Inputs: task_name (required), task_category (required). Returns: object

update_applicationUpdate ApplicationC
Destructive

Update an existing application (app registration).

Inputs: app_id (required), app_data (required). Returns: object

update_groupUpdate GroupC
Destructive

Update an existing group in Microsoft Graph.

Inputs: group_id (required), group_data (required). Returns: object

update_service_principalUpdate Service PrincipalC
Destructive

Update an existing service principal.

Inputs: sp_id (required), sp_data (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 48 tools

    Disambiguation4/5

    Most tools target clearly distinct resource+action pairs, and related tools like get_user_mfa_status versus get_group_mfa_status or get_device_compliance_policies versus get_device_compliance_policy_states are distinguishable from their descriptions. Some clusters, especially the permissions and device-state tools, are close enough that an agent could occasionally hesitate.

    Naming Consistency4/5

    The set largely follows a predictable verb_noun convention: search_users, get_group_by_id, create_application, delete_service_principal, and similar. Minor inconsistencies appear in collection-listing verbs such as get_all_groups versus list_applications, plus a few suffixes like _direct, but the pattern remains easy to infer.

    Tool Count2/5

    With 48 tools, the surface is far above the typical 3–15 range and is heavy for an agent to navigate. The EntraID domain is broad, but the tool count still feels excessive and likely includes specialized operations that could be scoped or grouped more tightly.

    Completeness3/5

    Coverage is strong for read operations across users, groups, devices, MFA, conditional access, audit logs, and permissions, and there is full CRUD for groups, applications, and service principals. However, notable gaps remain, including user create/update/delete operations, group owner listing, and write operations for conditional access and managed devices.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      Not graded
      maintenance
      An MCP server that enables interaction with Microsoft 365 services like Outlook, OneDrive, Teams, and SharePoint via the Microsoft Graph API. It supports comprehensive operations including email management, file access, and organizational collaboration for personal and work accounts.
      78
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A FastMCP server that provides AI assistants with access to Microsoft Entra (Azure AD) directory services. It enables LLMs to search for users, groups, and check memberships using the Microsoft Graph API.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A Model Context Protocol server for Microsoft 365 administration using Graph API application permissions, enabling security monitoring, identity audits, incident response, and service health management.
      113 npm
      20
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Remote MCP server for Microsoft Graph with delegated OAuth support, enabling interaction with Microsoft 365 services like mail, calendar, OneDrive, SharePoint, Teams, and more via natural language.
      MIT