# Microsoft 365

Speakeasy hosts this Microsoft 365 MCP server. It gives each person's MCP client the same 50 tools as Anthropic's Microsoft 365 connector: Outlook mail and calendar, Teams chats and channels, SharePoint and OneDrive files, and people search. The server stores no credentials. Each person signs in with their own Microsoft account, and every call runs as that person through Microsoft Graph with delegated permissions.

You need a Microsoft 365 work or school account for each person who connects. Personal Microsoft accounts are not supported. Mail and calendar tools need an Exchange Online mailbox. Teams and SharePoint or OneDrive tools need access to those services. An Entra administrator registers one application in your tenant and grants admin consent once. Keep the client secret out of source control, screenshots, and support transcripts.

### Register the Entra application
<!-- screenshot: Entra app registration with "Accounts in this organizational directory only" and a Web redirect URI; tenant and client identifiers redacted -->

In the [Microsoft Entra admin center](https://entra.microsoft.com), open **App registrations** and select **New registration**. See Microsoft's [app registration guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app).

1. Enter a name, for example **Speakeasy Microsoft 365 MCP**.
2. Under **Supported account types**, select **Accounts in this organizational directory only**.
3. Under **Redirect URI**, select the **Web** platform and enter the callback for your Speakeasy deployment:

   ```text
   https://ai.speakeasy.com/mcp/remote_login_callback
   ```

   Use this exact value. Do not use an MCP client's localhost callback.

4. Select **Register**.
5. On the app's **Overview**, record the **Application (client) ID** and the **Directory (tenant) ID**. The object ID is not the client ID.

### Add the Microsoft Graph permissions
<!-- screenshot: API permissions list with the Microsoft Graph delegated permissions and admin consent granted; tenant name redacted -->

In the app, open **API permissions**, select **Add a permission → Microsoft Graph → Delegated permissions**, and add these permissions. See the [Microsoft Graph permissions reference](https://learn.microsoft.com/en-us/graph/permissions-reference) for what each one grants.

| Area | Delegated permissions |
| --- | --- |
| Sign-in | `openid`, `profile`, `offline_access` |
| Profile and people | `User.Read`, `User.ReadBasic.All`, `People.Read` |
| Mail | `Mail.ReadWrite`, `Mail.Read.Shared`, `Mail.Send`, `MailboxSettings.ReadWrite` |
| Calendar | `Calendars.ReadWrite`, `Calendars.Read.Shared` |
| Teams | `Chat.Read`, `Chat.Create`, `ChatMessage.Send`, `Channel.ReadBasic.All`, `ChannelMessage.Read.All`, `ChannelMessage.Send`, `Team.ReadBasic.All` |
| Files | `Files.ReadWrite.All`, `Sites.Read.All` |
| Meetings | `OnlineMeetings.Read`, `OnlineMeetingTranscript.Read.All` |

`offline_access` lets Speakeasy refresh sessions without asking people to sign in again every hour.

You can leave out permissions for tools you do not want to offer. For example, omit `Mail.Send`, `ChatMessage.Send`, and `ChannelMessage.Send` to prevent sending on people's behalf. A tool that needs a missing permission fails and asks the client to request it; it does not fall back to broader access.

Then select **Grant admin consent for** your tenant and confirm. See Microsoft's [admin consent guide](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent). `ChannelMessage.Read.All`, `Files.ReadWrite.All`, and `OnlineMeetingTranscript.Read.All` always need admin consent. Tenant-wide delegated consent approves the permissions; it does not sign anyone in or share a session. Each person still signs in individually, and access stays limited to what that person can already reach in Microsoft 365.

### Create a client secret
<!-- screenshot: Certificates & secrets with a new client secret; the secret value redacted -->

**Before you start:** Entra shows the secret **Value** only once. Have your approved password manager ready.

1. In the app, open **Certificates & secrets** and select **New client secret**.
2. Enter a description and choose an approved expiry.
3. Select **Add**, then copy the **Value**, not the **Secret ID**, into your password manager.

Record the expiry date and assign an owner. Sign-in stops working when the secret expires, so rotate it beforehand and update the client in Speakeasy.

### Restrict who can connect
<!-- screenshot: Enterprise application Properties with Assignment required set to Yes, and Users and groups with approved assignments; names redacted -->

Optional, but recommended before broad rollout.

1. Open **Enterprise applications** and select the app you registered.
2. Under **Properties**, set **Assignment required?** to **Yes** and save.
3. Under **Users and groups**, assign the people or groups who should connect. See Microsoft's [assignment guide](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/assign-user-or-group-access-portal). Group assignment requires Entra ID P1 or P2 and does not include nested groups.

Global Administrators can bypass the assignment requirement, so test with an ordinary account that unassigned people are denied.

### Add the server in Speakeasy
1. In the Speakeasy AI Control Plane sidebar, under **MCP Gateway**, select **MCP**.
2. Click **Add new** to open **Add MCP server**.
3. Choose **Hosted remotely**.
4. On **New remote MCP server**, paste this into **MCP server URL**:

   ```text
   https://catalog.speakeasy.com/m365/mcp
   ```

5. Optionally enter **Display name (optional)**, for example **Microsoft 365**.
6. Leave **User session issuer** at its default.
7. Click **Verify connectivity**. The server answers with a sign-in challenge, so **Identity** preselects **User Identity**. Keep it selected.
8. Leave **Guardrails** off unless your organization requires one, then click **Save** to open the server's **Overview**.

The server is expected to stay **Disabled** and ask you to finish setup in **Settings > Identity**. Microsoft does not support automatic client registration, so the client from [Register the Entra application](#register-entra-application) is added by hand below.

<!-- screenshot: New remote MCP server with the Microsoft 365 URL and User Identity selected -->

### Connect your credentials
The server's metadata names Microsoft's multi-tenant sign-in address (`https://login.microsoftonline.com/organizations/v2.0`). Its published issuer is a placeholder (`https://login.microsoftonline.com/{tenantid}/v2.0`), so Speakeasy cannot create a provider from it. Create a provider for your own tenant instead. Do not reuse an identity provider shared by unrelated servers.

1. Open the server's **Settings > Identity** and select **User Identity**.
2. Open **Choose an identity provider** and click **Create a custom identity provider**. This opens **Remote Identity Providers**.
3. Click **New Remote Identity Provider**.
4. In **Issuer URL**, enter the following, replacing `` with the **Directory (tenant) ID** from [Register the Entra application](#register-entra-application):

   ```text
   https://login.microsoftonline.com/<TENANT_ID>/v2.0
   ```

5. Click **Discover**, then verify under **Endpoints** that **Authorization Endpoint** and **Token Endpoint** are:

   ```text
   https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/authorize
   https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token
   ```

6. Keep the derived **Slug** and click **Create**.
7. On the new provider, click **Add Client** and set **Client Type** to **Manual**.
8. Paste the **Application (client) ID** into **Client ID**.
9. Paste the secret **Value** from [Create a client secret](#create-client-secret) into **Client Secret (optional)**. Microsoft requires the secret despite the field's optional label.
10. In **Scope (override)**, enter these scopes, comma-separated. Drop any you left out in [Add the Microsoft Graph permissions](#add-graph-permissions):

    ```text
    openid,profile,offline_access,https://graph.microsoft.com/User.Read,https://graph.microsoft.com/User.ReadBasic.All,https://graph.microsoft.com/People.Read,https://graph.microsoft.com/Mail.ReadWrite,https://graph.microsoft.com/Mail.Read.Shared,https://graph.microsoft.com/Mail.Send,https://graph.microsoft.com/MailboxSettings.ReadWrite,https://graph.microsoft.com/Calendars.ReadWrite,https://graph.microsoft.com/Calendars.Read.Shared,https://graph.microsoft.com/Chat.Read,https://graph.microsoft.com/Chat.Create,https://graph.microsoft.com/ChatMessage.Send,https://graph.microsoft.com/Channel.ReadBasic.All,https://graph.microsoft.com/ChannelMessage.Read.All,https://graph.microsoft.com/ChannelMessage.Send,https://graph.microsoft.com/Team.ReadBasic.All,https://graph.microsoft.com/Files.ReadWrite.All,https://graph.microsoft.com/Sites.Read.All,https://graph.microsoft.com/OnlineMeetings.Read,https://graph.microsoft.com/OnlineMeetingTranscript.Read.All
    ```

    Do not leave it blank. Without `offline_access`, people have to sign in again about every hour.

11. If your deployment shows a token endpoint authentication control for the client, select `client_secret_post`. The [Work IQ guide](../work-iq/speakeasy.md#connect-speakeasy-credentials) found this resolves `invalid_client` errors from Entra.
12. Confirm the displayed **Redirect URI** matches the **Web** callback you registered in [Register the Entra application](#register-entra-application), then click **Create**.
13. Return to the server's **Settings > Identity**, select **User Identity**, choose the new provider in **Choose an identity provider**, choose **Existing client**, and pick the client under **Client**.
14. Click **Save**. If prompted, confirm with **Save changes**.
15. Open **Settings > Danger Zone > Server Availability** and turn on **Enable MCP server** so it shows **Enabled**.

The first time each person uses the server, Microsoft's sign-in page appears in their browser. They sign in with their own account. If assignment is required, they must be assigned in [Restrict who can connect](#restrict-app-access).

If sign-in fails with `invalid_client`, check the client ID, the tenant in all three URLs, the **Web** callback, the secret **Value** and its expiry, and the selected `client_secret_post` method. If sign-in fails with an error about the `resource` parameter, ask your Speakeasy administrator to stop sending the resource indicator for this provider.

<!-- screenshot: Settings > Identity with User Identity, the tenant-specific custom provider, and Existing client selected; values redacted -->

### Test the connection
Connect an MCP client to the server's Speakeasy endpoint, sign in, and run these read-only tools:

| Tool | Expected result |
| --- | --- |
| `get_me` | Your own name and email address |
| `outlook_email_search` with `order: "newest"` | Your latest messages, then a final `nextOffset` item when more exist |
| `teams_list_teams` | The teams you belong to |
| `outlook_find_available_time` for a short range | Open slots in your mailbox time zone |

An empty calendar or no SharePoint results can still be a successful, authorized read. A tool that fails with a request to add a permission means that permission was left out or not consented in Entra.

This guide covers setup only. For anything beyond it, such as tool behavior and limits, see the [Microsoft Graph documentation](https://learn.microsoft.com/en-us/graph/overview).

---

Index of every Speakeasy page for agents: [llms.txt](https://www.speakeasy.com/llms.txt). AI control plane and MCP gateway content in one file: [llms-full.txt](https://www.speakeasy.com/llms-full.txt). Any page is available as markdown by appending `.md` to its URL or by requesting it with `Accept: text/markdown`.
