home / mcp / entraid mcp server
MCP server for interacting with EntraID through Microsoft Graph API.
Configuration
View docs{
"mcpServers": {
"hieuttmmo-entraid-mcp-server": {
"command": "uv",
"args": [
"run",
"--with",
"azure-core",
"--with",
"azure-identity",
"--with",
"fastmcp",
"--with",
"msgraph-core",
"--with",
"msgraph-sdk",
"fastmcp",
"run",
"/path/to/src/msgraph_mcp_server/server.py"
],
"env": {
"CLIENT_ID": "<your-client-id>",
"TENANT_ID": "<your-tenant-id>",
"CLIENT_SECRET": "<your-client-secret>"
}
}
}
}You deploy and run the EntraID MCP Server to access Microsoft Graph data through a modular, resource‑oriented FastMCP interface. It exposes resources like users, groups, applications, service principals, sign‑in logs, MFA status, and more, through a centralized Graph client with secure authentication and practical tooling for permissions, auditing, and password management.
You interact with the MCP server through an MCP client. The server provides a set of resources and tool functions you can call to query data, manage entities, and perform common administration tasks. You can search and retrieve users, manage groups and memberships, handle applications and service principals, fetch sign‑in logs, verify MFA status, reset passwords, and explore Graph permissions to follow least‑privilege practices. Use the MCP client to invoke the exposed tools and inspect results and progress through the MCP context for consistent error handling and logging.
Prerequisites: make sure you have Python installed in your environment. You will also need access to an Azure AD tenant with a registered application (client ID/secret) for Microsoft Graph authentication.
Step 1: Prepare your environment variables and credentials. Create a file with these values set for your tenant and app registration:
TENANT_ID=your-tenant-id
CLIENT_ID=your-client-id
CLIENT_SECRET=your-client-secretYou can start the MCP server locally using Cursor’s startup configuration. This runs the server with the required modules and the path to your server entry file.
{
"EntraID MCP Server": {
"command": "uv",
"args": [
"run",
"--with", "azure-core",
"--with", "azure-identity",
"--with", "fastmcp",
"--with", "msgraph-core",
"--with", "msgraph-sdk",
"fastmcp",
"run",
"/path/to/src/msgraph_mcp_server/server.py"
],
"env": {
"TENANT_ID": "<your-tenant-id>",
"CLIENT_ID": "<your-client-id>",
"CLIENT_SECRET": "<your-client-secret>"
}
}
}Search users by name or email and return matching user profiles.
Retrieve full details for a user by their object ID.
List all users who are members of privileged directory roles.
Get all directory roles assigned to a user.
Return all groups for a user, including transitive memberships.
List all groups with paging support.
Fetch a group by its object ID, including metadata.
Search groups by their display name.
Get members of a specific group.
Create a new group with specified fields.
Update group properties such as displayName, mailNickname, description, visibility.
Delete a group by its ID.
Add a member to a group.
Remove a member from a group.
Add an owner to a group.
Remove an owner from a group.
Query sign‑in logs for a user over the last N days.
Get MFA status for a user.
Get MFA status for all members of a group.
List all managed devices, with optional OS filter.
List devices managed by a specific user.
Fetch all Conditional Access policies.
Get a single Conditional Access policy by its ID.
Retrieve directory audit logs for a user within a time window.
Reset a user password with an optional new value and change-on-sign-in requirement.
Suggest Microsoft Graph permissions best suited for a given task.
List all permission categories and their tasks for quick reference.
Query the Microsoft Graph permissions available to your app.
Search Graph permissions by keyword and optional type.
List all applications (app registrations) with paging.
Get an application by its object ID, including role assignments and delegated permissions.
Create a new application (app registration).
Update application properties such as displayName, signInAudience, tags, identifierUris, web, api, requiredResourceAccess.
Delete an application by its object ID.
List all service principals with paging.
Get a service principal by its object ID, including role assignments and delegated permissions.
Create a new service principal.
Update a service principal with fields like displayName and accountEnabled.
Delete a service principal by its object ID.
Example resource: greeting://{name} returns a personalized greeting.