> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dema.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Outlook

> Let the Dema Agent read, search, send, and manage Outlook mail through Microsoft's hosted Mail MCP server.

export const MicrosoftTroubleshootingNote = () => <Info>
    Invalid MCP URLs, <code>AADSTS</code> codes, admin approval, and 403 responses work the same way for every Microsoft integration. <a href="/guides/agent/integrations/microsoft#troubleshooting">Microsoft overview → Troubleshooting</a> covers them.
  </Info>;

export const MicrosoftPreviewNote = () => <Note>
    Microsoft integrations are in <strong>preview</strong>, and so are the Agent 365 / Work IQ MCP servers behind them. Tools can change without notice. Your workspace might need preview integrations enabled before these show up.
  </Note>;

export const McpUrlPlaceholderNote = () => <Note>
    Replace the whole <code>{'{tenant_id}'}</code> placeholder, braces included. Dema rejects a URL that still has braces in it. A tenant ID is a GUID, like <code>8f7a1b2c-3d4e-4f56-a7b8-9c0d1e2f3a4b</code>.
  </Note>;

## Overview

Once Microsoft Outlook is connected, the Dema Agent can read your mail and send mail on your behalf without you leaving the conversation.

The agent acts only when you ask it to, and Dema asks you to confirm sensitive changes first. It signs in as whoever authorized the connection, so it sees only that person's mailbox.

<MicrosoftPreviewNote />

<Tip>
  This integration covers **mail** only. Outlook Calendar runs on a separate Microsoft MCP server.
</Tip>

***

## What you can ask for

<AccordionGroup>
  <Accordion title="Find and read mail" icon="magnifying-glass">
    | Ask the agent to         | For example                                                        |
    | ------------------------ | ------------------------------------------------------------------ |
    | Search your mailbox      | *"Find emails from Acme about the Q3 invoice."*                    |
    | Read a specific message  | *"Open the latest email from our 3PL and tell me what they need."* |
    | Summarize a conversation | *"Summarize the thread about the Black Friday campaign."*          |
    | Triage the inbox         | *"List the five most recent unread emails."*                       |
  </Accordion>

  <Accordion title="Organize your inbox" icon="folder-tree">
    | Ask the agent to  | For example                                                       |
    | ----------------- | ----------------------------------------------------------------- |
    | Move messages     | *"Move everything from that supplier into the Suppliers folder."* |
    | Work with folders | *"What folders do I have, and how much unread is in each?"*       |
    | Mark messages     | *"Mark the newsletters from last week as read."*                  |
  </Accordion>

  <Accordion title="Compose and send" icon="paper-plane">
    | Ask the agent to     | For example                                                  |
    | -------------------- | ------------------------------------------------------------ |
    | Send an update       | *"Email this week's margin summary to the buying team."*     |
    | Reply in a thread    | *"Reply to Acme confirming the new delivery date."*          |
    | Forward with context | *"Forward that stock alert to ops with a one-line summary."* |
  </Accordion>
</AccordionGroup>

***

## Before you connect

Every Microsoft integration needs the same prerequisites, plus a tenant setup an admin does once per Microsoft 365 tenant. Start there, then come back:

<Card title="Microsoft overview" icon="https://mintcdn.com/demaai/-QBoxgr91D2DfDZm/images/integrations/microsoft-outlook.svg?fit=max&auto=format&n=-QBoxgr91D2DfDZm&q=85&s=27c70f1d558a00d59abfa6353181f84f" href="/guides/agent/integrations/microsoft" horizontal width="24" height="24" data-path="images/integrations/microsoft-outlook.svg">
  Prerequisites, one-time tenant setup, and shared troubleshooting
</Card>

***

## Connect Microsoft Outlook

<Steps>
  <Step title="Build your MCP URL">
    Outlook mail is served by `mcp_MailTools`. Replace `{tenant_id}` with your Entra tenant ID:

    ```text MCP URL theme={null}
    https://agent365.svc.cloud.microsoft/agents/tenants/{tenant_id}/servers/mcp_MailTools
    ```

    <McpUrlPlaceholderNote />
  </Step>

  <Step title="Connect in Dema">
    In Dema, go to **Agents → Settings → Integrations**, find **Microsoft Outlook**, and click **Connect**. Paste the MCP URL you built, then click **Add**.
  </Step>

  <Step title="Sign in and approve">
    Sign in with a Microsoft **work or school** account that belongs to the same tenant as the URL, and approve the permission Dema asks for.

    <Check>
      You are returned to Dema with the integration marked as Active.
    </Check>
  </Step>

  <Step title="Check it works">
    Ask the agent something only Outlook can answer, for example: *"List the five most recent unread emails in my inbox."* If it comes back with real subject lines, the connection works.
  </Step>
</Steps>

<Tip>
  Authorize with a dedicated agent mailbox instead of your personal inbox, and forward only what the agent needs. See [Best practices](/guides/agent/integrations/overview#best-practices) in the integrations overview.
</Tip>

***

## Scopes Dema requests

| Scope                 | What it allows                                                                         |
| --------------------- | -------------------------------------------------------------------------------------- |
| `McpServers.Mail.All` | Read, search, list, compose, and send Outlook mail, and manage folders, on your behalf |
| `offline_access`      | Keep the connection alive so you do not have to reconnect often                        |

Dema requests these against your tenant's own MCP server, so the grant covers that server and not your Microsoft 365 account as a whole.

***

## Troubleshooting

<MicrosoftTroubleshootingNote />

<AccordionGroup>
  <Accordion title="The agent cannot find an email you can see" icon="envelope">
    The agent searches only the mailbox of the account that authorized the connection. It cannot read someone else's mailbox, or a shared mailbox that account has no access to. Reconnect with an account that can open it.
  </Accordion>

  <Accordion title="The agent cannot see calendar events or meetings" icon="calendar-xmark">
    This integration is mail only. Outlook Calendar runs on a separate Microsoft MCP server, which Dema does not support yet.
  </Accordion>

  <Accordion title="McpServers.Mail.All does not appear in Entra" icon="key">
    An Entra admin has to register or consent the Work IQ Mail MCP server (`mcp_MailTools`) in your tenant before anyone can grant the permission.
  </Accordion>
</AccordionGroup>

Still stuck? Contact [support](mailto:info@dema.ai) with the error message, including the Entra `AADSTS` code if you have one.
