A Model Context Protocol (MCP) server for managing Microsoft Entra ID users and groups via the Microsoft Graph API.
- get_users_verbose - Retrieve all users with full details
- get_groups_verbose - Retrieve all groups with full details
- make_group - Create new groups
- add_user_to_group - Add users to groups
- Python 3.13+
- Microsoft Entra ID application with Graph API permissions
- uv package manager
Your Entra ID app needs:
User.Read.All
Group.ReadWrite.All
GroupMember.ReadWrite.All
- Clone and install:
git clone https://github.com/toutatis-dev/graph-mcp-server.git
cd graph-mcp-server
uv install
- Create
.env
file:
GRAPH_CLIENT_ID=your_client_id
GRAPH_CLIENT_SECRET=your_client_secret
GRAPH_AUTHORITY=https://login.microsoftonline.com/your_tenant_id
Run the MCP server:
uv run python main.py
Quality checks:
uv run black .
uv run flake8 .
uv run mypy .