Skip to content

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.

Before you begin, ensure you have the following:

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.

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.

  1. 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.
  2. On the app Overview page, copy the Application (client) ID. This is the Client ID.
  3. Go to Certificates & secrets > Client secrets, click + New client secret, name it, click Add, then copy the Value. This is the Client Secret.
  4. Go to API permissions, click Add a permission, select APIs my organization uses, search for 07c030f6-5743-41b7-ba00-0a6e85f37c17, select M365 MCP Server for Claude, check access_as_user, then click Update permissions.
  5. Note the Directory (tenant) ID GUID on the app Overview page. The OAuth URLs use it as <azure-tenant-id>.

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.

  1. Log into your Aembit Tenant.

  2. Go to Credential Providers in the left sidebar and click + New.

  3. 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.0
    Client ID The Client ID you copied earlier
    Client Secret The Client Secret you copied earlier
    Scopes api://07c030f6-5743-41b7-ba00-0a6e85f37c17/.default offline_access
    Authorization URL https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0/authorize
    Token URL https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0/token
    PKCE Required On
    Resource 07c030f6-5743-41b7-ba00-0a6e85f37c17
    Lifetime 1 year

    Discover doesn't work for Office 365 — enter the Authorization URL and Token URL from the table manually, substituting your own values for any placeholders.

  4. Click Save.

  5. Copy the read-only Callback URL from the Credential Provider.

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.

  1. Set the Authorization URL to https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0/authorize.
  2. Set the Token URL to https://login.microsoftonline.com/<azure-tenant-id>/oauth2/v2.0/token.
  3. After you create the Credential Provider, copy its read-only Callback URL and add it to the Azure App’s Redirect URIs.

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.

  1. Go to Server Workloads in the left sidebar and click + New.

  2. Configure the following fields:

    Field Value
    Name A user-friendly name
    Host microsoft365.mcp.claude.com
    Application Protocol MCP
    Port 443 with TLS
    URL Path /mcp
    Authentication method HTTP Authentication
    Authentication scheme Bearer
  3. Click Save.

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.

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.