Skip to main content
Glama
Sultan-zd

Entra ID SecOps MCP Server

by Sultan-zd

Entra ID SecOps MCP Server

CI Python MCP License

An MCP server that exposes Microsoft Entra ID security logs as tools executable by an AI agent (Claude Desktop, Cursor, or any other MCP client).

Goal: allow an analyst to ask a question in natural language — "why can't this account sign in anymore?" — and get an answer in seconds based on the tenant's actual data.

📖 Installation and testing guide — the three ways to launch the server, step by step. 🔍 Technical brief — market scan and secure exposure.

Design Principle

A raw Microsoft Graph response contains about sixty fields per event. The server applies aggressive truncation: only about a dozen security indicators reach the model. This is both a cost optimization (factor ~35 on tokens) and a security control, since unlisted fields — some of which are attacker-controlled — never enter the context.

Aggregates (number of failures, distinct IPs, suspicious patterns) are computed in Python, not inferred by the model.

Tools

Tool

Purpose

Graph Permission

License

get_user_context

Account record: position, groups, held roles. Determines the severity of an incident.

Directory.Read.All

get_user_signins

Recent sign-ins for a UPN, with summary and suspicious patterns

AuditLog.Read.All

P1

get_risky_users

Accounts flagged as risky by Identity Protection

IdentityRiskyUser.Read.All

P2

get_risk_detections

Individual detections: why an account is at risk

IdentityRiskEvent.Read.All

P2

get_directory_audits

Administrative changes; flags persistence actions

AuditLog.Read.All

get_conditional_access_policies

Active policies and coverage gaps

Policy.Read.All

All tools are read-only: the server never modifies the tenant.

get_user_context     le compte est-il privilégié ? l'incident est-il grave ?
      ↓
get_user_signins     que s'est-il passé sur l'authentification ?
      ↓
get_risk_detections  qu'a détecté Identity Protection, et pourquoi ?
      ↓
get_directory_audits l'attaquant a-t-il modifié quelque chose une fois entré ?

This sequence is also described in the server's instructions, which the MCP client sends to the model.

Quick start (without an Azure tenant)

The fixture mode replays a demo incident and requires no tenant, license, or secret.

python -m venv venv
venv/Scripts/activate          # Windows ; sur Linux/macOS : source venv/bin/activate
pip install -e ".[dev]"

cp .env.example .env           # ENTRA_DATA_SOURCE=fixture est déjà la valeur par défaut
python -m entra_secops_mcp

Connecting to a real tenant

  1. Create an App Registration in the Entra portal.

  2. Add the application permissions from the table above, then grant admin consent.

  3. Generate a client secret.

  4. Fill in .env:

AZURE_TENANT_ID=...
AZURE_CLIENT_ID=...
AZURE_CLIENT_SECRET=...
ENTRA_DATA_SOURCE=graph

License required. Accessing sign-in logs via the API requires an Entra ID P1 license, and Identity Protection tools require P2. Without them, Graph returns 403. The other tools work without a paid license. Check the tenant's license before you start: this is the classic blocker that wastes several days.

Security

  • No secret is present in the code or in the Docker image. They are injected at startup via --env-file.

  • .env is excluded from git by .gitignore. A secret pushed to a repository must be revoked in Azure, not just deleted from the file.

  • Logging goes to stderr: in stdio transport, stdout carries the JSON-RPC protocol and tolerates no stray bytes.

Configuration

All variables are documented in .env.example.

Docker

docker build -t entra-secops-mcp .
docker run -i --rm --env-file .env entra-secops-mcp

Final image: 277 MB, multi-stage build, runs as a non-root user (uid=1000), no secrets in the layers.

-i keeps standard input open — that's where the MCP protocol passes through. No -t: a pseudo-terminal injects color codes that corrupt JSON frames.

Development

pytest              # 81 tests
ruff check src tests
mypy src            # mode strict
pre-commit install  # contrôles avant chaque commit
python demo.py      # investigation de démonstration

Status

Tools

6, all read-only

Tests

81, no Azure tenant required

Types

mypy --strict without warnings

MCP Protocol

2026-07-28 (SDK mcp 2.0)

Container

verified via a real MCP client: startup 2.4 s, tool call ~110 ms

License

MIT.

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sultan-zd/mcp-entra-secops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server