Office 365 MCP Server
Aembit supports the official Office 365 MCP server, which lets AI Agent: A software workload that authenticates to systems, requests credentials, and accesses resources, either on behalf of a person or on its own. Aembit secures AI agents with the same identity-first model it uses for any workload. User-driven agents such as Claude Desktop also carry a blended identity that ties access to both the user and the agent.Learn more access Microsoft 365 productivity data through Model Context Protocol: A standard protocol for AI agent and server interactions that defines how AI assistants communicate with external tools and data sources.Learn more(opens in new tab) tools.
This page describes how to configure Office 365 as an MCP Server: A server that implements the Model Context Protocol to provide tools, resources, or data to AI agents and MCP clients.Learn more(opens in new tab) behind the Aembit MCP Identity Gateway: A component that brokers MCP traffic between MCP clients and target MCP servers, validating authorization and presenting Aembit-managed credentials on each request.Learn more. Each user authenticates with their own Office 365 identity, and the Gateway injects their token into MCP requests.
This guide builds the Gateway-to-Server Policy: The Access Policy that authorizes the MCP Identity Gateway to access an MCP server on behalf of authenticated users—the Gateway itself is the Client Workload. Also called right-side auth; each MCP server behind the Gateway needs its own.Learn more—the second of the two Access Policy: Access Policies define, enforce, and audit access between Client and Server Workloads by cryptographically verifying workload identity and contextual factors rather than relying on static secrets.Learn more the MCP Identity Gateway requires. You create the first, the Client-to-Gateway Policy: The Access Policy that validates which MCP client can connect to the MCP Identity Gateway and authenticates users through your Identity Provider. Also called left-side auth; you create one per MCP client and Gateway combination.Learn more, during Gateway setup.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have the following:
- A Microsoft 365 subscription with access to the M365 MCP Server
- A configured Aembit MCP Identity Gateway
Requirements and considerations
Section titled “Requirements and considerations”Before you configure Office 365, review these requirements and behaviors specific to Office 365’s MCP server.
- Administrator pre-registration required. An administrator must pre-register the Azure App and share the Client ID and Client Secret. User-Based Auth here isn’t fully self-service like other servers.
- Tenant-specific OAuth URLs. The Authorization and Token URLs include your Azure Directory (tenant) ID, which is visible on the Azure App’s Overview page.
- Register the Callback URL first. Add the Aembit Callback URL to the Azure App’s Redirect URIs before authorization can succeed.
- Use User-Based Auth. Admin-Based Auth doesn’t work for Office 365.
Register the Azure app
Section titled “Register the Azure app”Office 365 doesn’t support OAuth Dynamic Client Registration, so an administrator must register an Azure App before users can authenticate. Both authentication approaches share this app, but only User-Based Auth works today.
- Go to Azure App registrations and click New registration. Enter any name, set Supported account types to Accounts in this organizational directory only (Single tenant), set the platform to Web, and set the Redirect URI to the Aembit Credential Provider’s Callback URL. Copy the exact read-only value from the Credential Provider after you create it in Aembit—don’t hand-construct it.
- On the app Overview page, copy the Application (client) ID. This is the Client ID.
- Go to Certificates & secrets > Client secrets, click + New client secret, name it, click Add, then copy the Value. This is the Client Secret.
- Go to API permissions, click Add a permission, select
APIs my organization uses, search for07c030f6-5743-41b7-ba00-0a6e85f37c17, select M365 MCP Server for Claude, checkaccess_as_user, then click Update permissions. - Note the Directory (tenant) ID GUID on the app Overview page. The OAuth URLs use it as
<azure-tenant-id>.
Configure the Credential Provider
Section titled “Configure the Credential Provider”Create an MCP User-Based Access Token Credential Provider: Credential Providers obtain the specific access credentials—such as API keys, OAuth tokens, or temporary cloud credentials—that Client Workloads need to authenticate to Server Workloads.Learn more in Aembit.
-
Log into your Aembit Tenant.
-
Go to Credential Providers in the left sidebar and click + New.
-
Configure the following fields:
Field Value Name A user-friendly name Credential Type MCP User-Based Access Token MCP Server URL https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0Client ID The Client ID you copied earlier Client Secret The Client Secret you copied earlier Scopes api://07c030f6-5743-41b7-ba00-0a6e85f37c17/.default offline_accessAuthorization URL https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0/authorizeToken URL https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0/tokenPKCE Required On Resource 07c030f6-5743-41b7-ba00-0a6e85f37c17Lifetime 1 yearDiscover doesn't work for Office 365 — enter the Authorization URL and Token URL from the table manually, substituting your own values for any placeholders.
-
Click Save.
-
Copy the read-only Callback URL from the Credential Provider.
Finish configuring the Azure app
Section titled “Finish configuring the Azure app”OAuth Discovery doesn’t work for Office 365, so enter the Authorization URL and Token URL manually when you
create the Credential Provider. Replace <azure-tenant-id> with the Azure Directory (tenant) ID from the app’s
Overview page.
- Set the Authorization URL to
https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0/authorize. - Set the Token URL to
https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0/token. - After you create the Credential Provider, copy its read-only Callback URL and add it to the Azure App’s Redirect URIs.
Authorize the Credential Provider
Section titled “Authorize the Credential Provider”There’s no administrator authorization step for this credential type. Each user completes their own Office 365 sign-in and consent the first time they access Office 365 through the Gateway. Aembit stores and refreshes each user’s tokens individually.
Create the Server Workload
Section titled “Create the Server Workload”-
Go to Server Workloads in the left sidebar and click + New.
-
Configure the following fields:
Field Value Name A user-friendly name Host microsoft365.mcp.claude.comApplication Protocol MCP Port 443 with TLS URL Path /mcpAuthentication method HTTP Authentication Authentication scheme Bearer -
Click Save.
Create an Access Policy
Section titled “Create an Access Policy”This section creates the Gateway-to-Server Access Policy, which authorizes the MCP Identity Gateway to access Office 365 on behalf of authenticated users.
Create an Access Policy linking the MCP Identity Gateway (as the Client Workload: Client Workloads represent software applications, scripts, or automated processes that initiate access requests to Server Workloads, operating autonomously without direct user interaction.Learn more), the Credential Provider you created, and the Server Workload for Office 365.
For step-by-step instructions, including the Client Workload settings that identify the Gateway, see Create the gateway-to-server Access Policy.
Verify
Section titled “Verify”After a user authorizes access, the Aembit AI Access Authorized page lists the Office 365 MCP Server as Ready. The AI agent can then call Office 365 MCP tools through the Gateway.