Microsoft Entra ID MCP server for AI agents

Live

OAUTH 2.0

IDENTITY MANAGEMENT

Developer Tools

Microsoft Entra ID gives your agent identity management for your tenant: look up users, groups, and devices, review sign-ins, audits, and risk detections, manage app registrations, and assign roles and licenses.

  • Per-user credentials: each call uses the actual user's token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Microsoft Entra ID
agent · Acme Q3
Run
Which users did Entra ID Protection flag as high risk this week?
S
microsoftentraid_risky_users_list
131ms
IT admin agent
3 users are flagged with a high risk level. 2 are still at risk and 1 has been remediated.
Sources: Entra ID Protection, 3 users
microsoftentraid
3 users
18:29
Message Claude...

Tools your IT admin agent reaches for on Microsoft Entra ID, scoped per user.

CALL ANY TOOL
82 tools for identity management in Microsoft Entra ID: read users, groups, devices, and roles, review sign-in, audit, and provisioning logs, manage app registrations and service principals, and assign roles, licenses, and group owners.
microsoftentraid_administrative_unit_members_list
List administrative unit members
List the users, groups and devices that belong to an administrative unit. Returns directory objects with @odata.type, id and displayName. Use administrative_unit_members_list to see who a scoped admin can manage. Use administrative_units_list to find the unit ID.
Parameters
Name
Type
Required
Description
administrative_unit_id
string
Required
Object ID (GUID) of the administrative unit.
$skiptoken
string
Optional
Opaque paging token. To fetch the next page, copy the value of the $skiptoken query parameter from the @odata.nextLink URL of the previous response.
$top
integer
Optional
Maximum number of results per page (1 to 999). When more results exist the response includes @odata.nextLink.
microsoftentraid_application_add_password
Application add password
microsoftentraid_application_create
Create application
microsoftentraid_application_federated_credentials_list
List application federated credentials
microsoftentraid_application_get
Get application
microsoftentraid_application_remove_password
Application remove password
microsoftentraid_application_update
Update application
microsoftentraid_authentication_strength_policies_list
List authentication strength policies
microsoftentraid_directory_audit_get
Get directory audit
microsoftentraid_directory_audits_list
List directory audits
microsoftentraid_directory_role_templates_list
List directory role templates
microsoftentraid_domains_list
List domains
microsoftentraid_group_create
Create group
microsoftentraid_group_get
Get group
microsoftentraid_group_members_list
List group members
microsoftentraid_group_transitive_members_list
List group transitive members
microsoftentraid_oauth2_permission_grants_list
List oauth2 permission grants
microsoftentraid_organization_get
Get organization
microsoftentraid_risky_users_list
List risky users
microsoftentraid_role_eligibility_schedule_instances_list
List role eligibility schedule instances
microsoftentraid_service_principal_app_role_assigned_to_create
Create service principal app role assigned to
microsoftentraid_service_principal_app_role_assignments_list
List service principal app role assignments
microsoftentraid_service_principal_owners_list
List service principal owners
microsoftentraid_sign_in_get
Get sign in
microsoftentraid_subscribed_skus_list
List subscribed skus
microsoftentraid_user_assign_license
User assign license
microsoftentraid_user_authentication_methods_list
List user authentication methods
microsoftentraid_user_member_of_list
List user member of
microsoftentraid_user_registered_devices_list
List user registered devices
microsoftentraid_user_set_manager
User set manager

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Microsoft Entra ID tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["microsoftentraid"], toolNames: [
    "microsoftentraid_users_list",
    "microsoftentraid_sign_ins_list",
    "microsoftentraid_risky_users_list"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "List users flagged as high risk this week" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["microsoftentraid"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "List users flagged as high risk this week" }],
  tools,
});

// Execute the tool call with the user's vaulted Microsoft Entra ID OAuth token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["microsoftentraid"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "List users flagged as high risk this week" }],
  tools,
});

// Tool call runs with the user's vaulted Microsoft Entra ID OAuth token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["microsoftentraid"] }, pageSize: 100,
});

const agent = new Agent({
  name: "it_admin_agent",
  model: "gemini-2.5-pro",
  instruction: "Microsoft Entra ID tools scoped to this user",
  tools,
});

await agent.run("List users flagged as high risk this week");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Microsoft Entra ID tool. Click to copy, paste into your agent, done.
Users and groups
Copy the prompt
Copied
Which groups is jane@acme.com in, including nested groups?
Copy the prompt
Copied
Create a security group called Finance Approvers.
Copy the prompt
Copied
Assign an E5 license to alex@acme.com.
Security and audit
Copy the prompt
Copied
Show sign-ins for jane@acme.com in the last 24 hours.
Copy the prompt
Copied
List risk detections from Entra ID Protection this week.
Copy the prompt
Copied
Who holds the Global Administrator role?
Apps and access
Copy the prompt
Copied
List the delegated permission grants for the Expense app.
Copy the prompt
Copied
Add a new client secret to the Billing Sync app registration.
Copy the prompt
Copied
Revoke all sign-in sessions for jane@acme.com.
SEE HOW AUTH WORKS
Each user signs in to Microsoft Entra ID once, and Scalekit stores and refreshes their tokens. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Microsoft Entra ID
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Microsoft Entra ID
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Microsoft Entra ID
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Microsoft Entra ID
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other developer tools and Microsoft connectors.
Engineering Teams
DevOps assistant agent
Polls GitHub for failing checks and stale PRs, opens Linear issues for the ones that need work, and posts a daily digest to Slack. It acts as the engineer, not a shared service account.
Engineering Teams
Slack triage
Polls Slack for new messages, classifies bugs and support requests with a LangGraph router, files GitHub issues or Zendesk tickets, and confirms in the thread.
Test other agents
See the same per-user auth pattern across other developer tools and Microsoft connectors.
ENGINEERING
DevOps assistant agent
Poll GitHub for failing checks and stale pull requests, open Linear issues for the ones that need work, and digest to Slack.
ENGINEERING
Slack triage agent
Classify new Slack messages as bugs or support requests, file the GitHub issue or Zendesk ticket, and reply in the thread.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Microsoft Entra ID token looks fine in a demo. In production every role assignment looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Microsoft Entra ID today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Microsoft Entra ID as the user or through a shared service account?
As the user. Each user signs in to Microsoft Entra ID once, and Scalekit stores and refreshes their tokens. Role assignments, group changes, and license updates the agent makes are attributed to that user in your audit trail, not a shared service account.
Where is the Microsoft Entra ID OAuth token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Refresh is automatic. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Microsoft Entra ID?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the read and log tools without microsoftentraid_role_assignment_create, which grants directory roles, and microsoftentraid_group_owner_remove. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Microsoft Entra ID access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Which Entra ID tenant does the agent work in?
The tenant of the user who signed in. microsoftentraid_me_get returns that user's profile, and microsoftentraid_organization_get returns the tenant ID, verified domains, and plans. User, group, device, and log tools read from that tenant.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""microsoftentraid"": {
""url"": ""https://mcp.scalekit.com/microsoftentraid"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.microsoftentraid]
url = ""https://mcp.scalekit.com/microsoftentraid""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""microsoftentraid"": {
""url"": ""https://mcp.scalekit.com/microsoftentraid"",
""type"": ""http""
}
}
}