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

# Using the MCP Server in Microsoft Copilot

> Connect your Omni data to Microsoft Copilot with Omni's MCP Server.

Microsoft Copilot can use Omni as a data source through MCP. You add the Omni MCP Server to an agent in [Microsoft Copilot Studio](https://learn.microsoft.com/en-us/microsoft-copilot-studio/agent-extend-action-mcp), then use that agent from Microsoft Copilot to ask questions about your data.

<Note>
  Custom MCP servers aren't added in the Microsoft Copilot chat assistant directly—they're added through Copilot Studio. You'll set up the connection on a Copilot Studio agent, then surface that agent in Microsoft Copilot.
</Note>

## Requirements

<Note>
  Every person who wants to use the MCP Server must create their own connection.
</Note>

To follow the steps in this guide, you'll need:

* The following in Microsoft Copilot Studio:
  * **A Copilot Studio environment** where you have permission to create and edit agents and tools.
  * **[Generative orchestration](https://learn.microsoft.com/en-us/microsoft-copilot-studio/advanced-generative-actions) enabled** on the agent, which is required to use MCP tools.
* The following in Omni:
  * **The MCP Server AI setting**. An Organization Admin can enable this setting by navigating to [**AI Hub > Setup > General**](/ai/settings/features#mcp-server).
  * **Personal access tokens (PATs)**, which are required to use [OAuth to authenticate](/ai/mcp/authentication). An Organization Admin can activate them by going to [**Settings > API Keys > Personal tokens**](/api/authentication#personal-access-tokens-pat).

## Setup

Choose an authentication method. See the [MCP authentication guide](/ai/mcp/authentication) if you need help deciding.

<Tabs>
  <Tab title="OAuth (Recommended)">
    OAuth provides streamlined setup without manually managing API keys.

    <Steps>
      <Step title="Add the MCP Server">
        1. In Copilot Studio, open your agent and go to the **Tools** page.
        2. Select **Add a tool**, then **New tool**.
        3. Select **Model Context Protocol** to open the MCP wizard.
        4. Fill in the following fields:
           * **Server name** — Enter a name, such as `Omni`
           * **Server description** — Enter a description, such as `Connect to Omni analytics data`
           * **Server URL** — Paste the OAuth URL:
             ```txt theme={null}
             https://callbacks.omniapp.co/callback/mcp
             ```
      </Step>

      <Step title="Configure authentication">
        1. Set **Authentication** to **OAuth 2.0**.
        2. Select **Dynamic Discovery**.
        3. Select **Create**.
      </Step>

      <Step title="Authorize the connection">
        1. On **Add tool**, select **Create a new connection**.
        2. Your browser will open and redirect you to an Omni authorization page.
        3. Review the requested permissions and click **Authorize**.

        Omni will automatically create a [Personal access token](/api/authentication#personal-access-tokens-pat) and link it to your Omni user account.
      </Step>

      <Step title="Add the tool to your agent">
        Select **Add to agent** to finish. Confirm [generative orchestration](https://learn.microsoft.com/en-us/microsoft-copilot-studio/advanced-generative-actions) is enabled on the agent so it can call the MCP tools.
      </Step>

      <Step title="Verify the connection">
        Open the **Test your agent** pane in Copilot Studio and send a trivial prompt such as `Hey Omni, what models can you access?`. If the agent invokes the Omni tool and returns a response, the connection is working.
      </Step>
    </Steps>
  </Tab>

  <Tab title="API Key">
    API key authentication gives you direct control over key management.

    <Steps>
      <Step title="Create an API key">
        If you don't have an Omni API key, [create one](/api/authentication) before continuing.
      </Step>

      <Step title="Add the MCP Server">
        1. In Copilot Studio, open your agent and go to the **Tools** page.
        2. Select **Add a tool**, then **New tool**.
        3. Select **Model Context Protocol** to open the MCP wizard.
        4. Fill in the following fields:

           * **Server name** — Enter a name, such as `Omni`
           * **Server description** — Enter a description, such as `Connect to Omni analytics data`
           * **Server URL** — Enter your instance URL with `/mcp/https` appended:
             ```txt theme={null}
             https://<YOUR_OMNI_INSTANCE>/mcp/https
             ```

           Replace `<YOUR_OMNI_INSTANCE>` with your Omni URL (e.g., `acme.omniapp.co`).
      </Step>

      <Step title="Configure authentication">
        1. Set **Authentication** to **API Key**.
        2. Set **Type** to **Header**.
        3. Set the **Parameter name** to `Authorization`.
        4. Select **Create**.
      </Step>

      <Step title="Add the tool to your agent">
        1. On **Add tool**, select **Create a new connection**.
        2. When prompted for the API key, enter your [Omni API key](/api/authentication) prefixed with `Bearer `:
           ```txt theme={null}
           Bearer <OMNI_API_KEY>
           ```
        3. Select **Add to agent** to finish.

        <Note>
          Copilot Studio's MCP tool sends a single authentication header, so the optional `X-MCP-*` headers used to scope other clients (model ID, topic, user) can't be set here. To scope queries, configure the model and topic in Omni instead.
        </Note>
      </Step>

      <Step title="Verify the connection">
        Open the **Test your agent** pane in Copilot Studio and send a trivial prompt such as `Hey Omni, what models can you access?`. If the agent invokes the Omni tool and returns a response, the connection is working.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Using the MCP

Once the MCP Server is added to your agent, Copilot Studio uses it automatically when you ask questions about your data.

<Steps>
  <Step>
    Confirm [generative orchestration](https://learn.microsoft.com/en-us/microsoft-copilot-studio/advanced-generative-actions) is enabled on the agent.
  </Step>

  <Step>
    In the Copilot Studio test pane, enter a prompt such as `Hey Omni, tell me how many users have been sourced by search and email`. Once the agent is published, you can send the same prompt from Microsoft Copilot.
  </Step>

  <Step>
    If prompted, approve the tool invocation to proceed.
  </Step>

  <Step>
    The MCP Server will pick a model and topic, then run a query to retrieve the data.
  </Step>
</Steps>

To make the agent available to end users in Microsoft Copilot, [publish it from Copilot Studio](https://learn.microsoft.com/en-us/microsoft-copilot-studio/publication-fundamentals-publish-channels) and add it to Microsoft Copilot.
