intune-mcp-write
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@intune-mcp-writeAdd user jdoe@contoso.com to the VPN Users group"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
intune-mcp-write
MCP server providing read-write access to Microsoft Intune device properties and group memberships via the Microsoft Graph API. Allows Claude (or any MCP client) to manage devices, update properties, trigger syncs, and modify group membership.
Prerequisites
Node.js >= 18
An Azure AD (Entra ID) app registration with delegated permissions
Related MCP server: Microsoft 365 Core MCP Server
Setup
1. Register the Azure AD App
Create a public client app in Entra ID with these delegated permissions:
DeviceManagementManagedDevices.ReadWrite.AllDeviceManagementManagedDevices.PrivilegedOperations.AllDevice.Read.AllGroupMember.ReadWrite.AllGroup.ReadWrite.AllDirectory.Read.AllUser.Read.All
Grant admin consent for all permissions.
Warning:
PrivilegedOperations.Allgrants the ability to remotely wipe, retire, restart, and lock any managed device the authenticated user has Intune RBAC access to. Use Intune scope tags to limit which devices can be acted on.Warning:
Group.ReadWrite.Allis required to edit dynamic-group membership rules (GroupMember.ReadWrite.Allonly covers adding/removing members, not group properties). It grants the token write access to all group properties tenant-wide (rename, delete, ownership), even though the curated tools only PATCHmembershipRule. Only add it if you need the rule-editing tools, and note they are additionally gated behindENABLE_DESTRUCTIVE_ACTIONS.
Then create .env:
AZURE_CLIENT_ID=<your-app-client-id>
AZURE_TENANT_ID=<your-tenant-id>To enable destructive actions (retire, wipe, delete, and dynamic-rule editing), also set:
ENABLE_DESTRUCTIVE_ACTIONS=true2. Install and Build
npm install
npm run build3. Authenticate
npm run authFollow the device code prompt to sign in with your Microsoft account.
4. Run
Stdio mode (for MCP clients like Claude Desktop):
npm startHTTP mode (for web-based MCP clients):
npm run start:http5. Claude Desktop Configuration
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"intune-mcp-write": {
"command": "node",
"args": ["F:/Repositories/Intune MCP Write/dist/index.js"],
"env": {
"AZURE_CLIENT_ID": "<your-client-id>",
"AZURE_TENANT_ID": "<your-tenant-id>"
}
}
}
}Tools
Device Read Operations
Tool | Description |
| List managed devices with OData filtering and cursor-based pagination |
| Get full details for a device by Intune ID |
| Search by device name, UPN, or serial number |
Device Write Operations
Tool | Description |
| Rename a managed device |
| Update device notes (uses beta API) |
| Change ownership type (company/personal) |
| Trigger a device sync with Intune |
| List available device categories in the tenant |
| Assign a device category by name or ID |
| Destructive — Remove a device from Intune management entirely |
User Operations
Tool | Description |
| Search Entra ID users by display name or UPN |
| Change the primary user assigned to a device |
Remote Device Actions
Tool | Description |
| Reboot a device remotely (Windows, Android, macOS) |
| Lock a device remotely (iOS, Android, macOS) |
| Rotate BitLocker recovery keys (Windows only) |
| Destructive — Remove company data, preserve personal data |
| Destructive — Factory reset the device |
retire_device,wipe_device, anddelete_devicerequireENABLE_DESTRUCTIVE_ACTIONS=trueand aconfirmDeviceNameparameter that must match the device's actual display name. The dynamic-rule editors (update_group_membership_rule,modify_membership_rule_value) are likewise gated behindENABLE_DESTRUCTIVE_ACTIONS=trueand take a matchingconfirmGroupName.
Group Read Operations
Tool | Description |
| Search Entra ID groups by display name |
| List members (users and devices) of a group |
| Look up directory object ID from Azure AD device ID |
| List groups a device belongs to |
Group Write Operations
Tool | Description |
| Add a device to an assigned-membership group (auto-resolves device IDs) |
| Remove a device from a group (auto-resolves device IDs) |
| Add a user to an assigned-membership group (accepts UPN or user object ID) |
| Remove a user from a group (accepts UPN or user object ID) |
Dynamic Membership Rule Editing
Gated behind ENABLE_DESTRUCTIVE_ACTIONS=true. Both require Group.ReadWrite.All + admin consent, take a confirmGroupName that must match the group's display name, and default to dryRun=true (preview only — set dryRun=false to apply). A rule change triggers an async, tenant-wide membership recompute.
Tool | Description |
| Destructive — Replace a dynamic group's entire membership rule (optionally set processing state On/Paused) |
| Destructive — Add or remove a single value in an |
Bulk Operations
Tool | Description |
| Trigger sync on multiple devices with throttle pacing (max 50) |
| Rename multiple devices with throttle pacing (max 50) |
| Add multiple members (users or devices) to a group with throttle pacing (max 50) |
Bulk operations run sequentially with a configurable delay (default 200ms) between API calls to avoid Graph API rate limits. Each returns per-item success/failure status.
Compound Tools
Tool | Description |
| Device details + resolved Azure AD object ID + group memberships in one call |
| Search for a device; auto-expands to a full overview on exactly one match |
| Group metadata + members in one call |
| Search for a group; auto-expands to a full overview on exactly one match |
list_devices,search_devices,list_device_categories,search_groups,list_group_members,list_device_groups,search_users, and the compound tools above all accept an optionalformat: "compact"|"full"parameter —"compact"returns one line per item,"full"returns every field. Compound tools default to"compact"; the rest default to"full"(list_group_membersdefaults to"compact").
Architecture
Dual transport: Supports stdio (for direct MCP client integration) and HTTP/Streamable (Express-based with session management)
GraphClient: Typed HTTP abstraction over Microsoft Graph with retry logic (3 retries for 401/429/5xx), exponential backoff, cursor-based pagination, and PUT support for
$refassignmentsAuth: MSAL device-code flow with token cache at
~/.intune-mcp-write/token-cache.jsonLogging: JSON structured logs to
~/.intune-mcp-write/logs/with rotation (10MB max, 5 files)
Project Structure
src/
index.ts Entry point (stdio or HTTP transport)
server.ts MCP server factory, registers all tool modules
graph.ts GraphClient (GET/POST/PATCH/PUT/DELETE with retries, pagination)
auth.ts AuthManager (MSAL device-code flow, token cache)
auth-cli.ts CLI for interactive sign-in
http.ts Express-based HTTP/Streamable transport
logger.ts JSON file logger with rotation
tools/
device-properties.ts Device read/write tools
group-membership.ts Group membership tools
remote-actions.ts Remote device actions (restart, lock, wipe, retire)
user-operations.ts User search and primary user management
bulk-operations.ts Bulk sync, rename, and group add tools
compound.ts Compound overview tools (device/group overview + search-and-expand)
shared.ts Error formatting, compact/full formatting, and shared helpers
__tests__/
graph.test.ts GraphClient unit tests
shared.test.ts Shared helper unit tests (errors, format, sanitization)
device-properties.test.ts list_devices/search_devices tool tests
device-properties-extended.test.ts Category, delete tool tests
group-membership.test.ts Group read/write tool tests
remote-actions.test.ts Remote action tool tests
user-operations.test.ts User operation tool tests
bulk-operations.test.ts Bulk operation tool tests
compound.test.ts Compound overview tool tests
scripts/
validate-live.mjs Read-only live validation against a real tenant
validate-mcp-client.mjs End-to-end MCP client test (spawns the server over stdio)Known Limitations
Dynamic groups cannot have members added/removed (Graph API constraint)
No policy/profile assignment management
No conditional access visibility
Bulk operations use sequential calls — not Graph API
$batch; optimize later if throughput becomes an issue
This server cannot be deployed
Maintenance
Related MCP Connectors
Manage Microsoft 365 email, calendar, contacts and inbox rules via the Graph API with OAuth 2.0.
Reach the computers you manage: list devices, run fixes, take screenshots, add devices.
Permissioned access to Outlook, OneDrive and Teams via the user's own Microsoft account
*Updated June 17th 2025** Manage your Microsoft 365 services effortlessly. Create and manage distr…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables management of Azure Cloud PCs using the Microsoft Graph API, allowing users to list available Cloud PCs in their tenant through Claude Desktop.MIT
- AlicenseBqualityNot gradedmaintenanceProvides comprehensive management of Microsoft 365 services including Exchange, SharePoint, Teams, Azure AD, Intune device management, security & compliance frameworks, and universal access to 1000+ Microsoft Graph API endpoints with advanced features like batch operations, delta queries, and real-time webhooks.5015-
- AlicenseNot gradedqualityCmaintenanceEnables management of Microsoft 365 users, licenses, and groups through Microsoft Graph API. Supports user provisioning, license assignment, group management, and automated M365 administration workflows.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants and automation tools to manage Microsoft 365, Entra ID, and Intune resources through 32 tools for user/device/file management and infrastructure monitoring.6MIT