> ## 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 Teams

> Let the Dema Agent read and manage Microsoft Teams chats, channels, members, and messages through Microsoft's hosted Teams 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 Teams is connected, the Dema Agent can read Teams discussions and post messages back to them 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 the same chats and channels that person sees in Teams.

<MicrosoftPreviewNote />

***

## What you can ask for

<AccordionGroup>
  <Accordion title="Read chats and channels" icon="comments">
    | Ask the agent to           | For example                                                                  |
    | -------------------------- | ---------------------------------------------------------------------------- |
    | Catch up on a channel      | *"Summarize the last 20 messages in #trading."*                              |
    | Follow a thread            | *"What was decided in the thread about the delivery delay?"*                 |
    | Search conversations       | *"Find where we discussed the supplier price increase."*                     |
    | Pull context into analysis | *"Compare last week's sales with what the team reported in #weekly-review."* |
  </Accordion>

  <Accordion title="Post messages" icon="paper-plane">
    | Ask the agent to      | For example                                                  |
    | --------------------- | ------------------------------------------------------------ |
    | Share an analysis     | *"Post this margin breakdown to #trading."*                  |
    | Reply in a thread     | *"Reply to that thread with the corrected forecast."*        |
    | Send a direct message | *"Send Alex a chat with the top five underperforming SKUs."* |
  </Accordion>

  <Accordion title="Find teams, channels, and people" icon="users">
    | Ask the agent to             | For example                              |
    | ---------------------------- | ---------------------------------------- |
    | List what you have access to | *"Which teams and channels am I in?"*    |
    | Check membership             | *"Who is in the #trading channel?"*      |
    | Manage channel members       | *"Add Sam to the #forecasting channel."* |
  </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-teams.svg?fit=max&auto=format&n=-QBoxgr91D2DfDZm&q=85&s=9564e19b6a969b4b43bc80b891980978" href="/guides/agent/integrations/microsoft" horizontal width="24" height="24" data-path="images/integrations/microsoft-teams.svg">
  Prerequisites, one-time tenant setup, and shared troubleshooting
</Card>

***

## Connect Microsoft Teams

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

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

    <McpUrlPlaceholderNote />
  </Step>

  <Step title="Connect in Dema">
    In Dema, go to **Agents → Settings → Integrations**, find **Microsoft Teams**, 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 Teams can answer, for example: *"Summarize the last 20 messages in the #general channel."* If it comes back with real messages, the connection works.
  </Step>
</Steps>

***

## Scopes Dema requests

| Scope                  | What it allows                                                                       |
| ---------------------- | ------------------------------------------------------------------------------------ |
| `McpServers.Teams.All` | Read and manage Teams chats, channels, messages, threads, and members 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 see a channel or chat" icon="eye-slash">
    The agent sees only what the authorizing account is a member of. Add that account to the team or chat, or reconnect with one that already has access. Private channels need an explicit join, even for members of the parent team.
  </Accordion>

  <Accordion title="Posting a message fails" icon="ban">
    Check that the authorizing account can post in that channel itself. Moderated and read-only channels reject posts from members, and the agent inherits those limits.
  </Accordion>

  <Accordion title="McpServers.Teams.All does not appear in Entra" icon="key">
    An Entra admin has to register or consent the Work IQ Teams MCP server (`mcp_TeamsServer`) 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.
