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

# Agent Bricks

> The Connect AI Remote MCP Service enables Agent Bricks to securely read and take action on your data in real time.

## Prerequisites

Before you can configure and use Agent Bricks with Connect AI, you must first connect a data source to your Connect AI account. See [Sources](/en/Sources) for more information.

## Create an OAuth App in CData Connect AI

Agent Bricks uses OAuth 2.0 to authenticate users against the CData Connect AI MCP Server. This requires an OAuth App in your CData Connect AI account.

The OAuth App requires a callback URL, which you build from your Databricks workspace host. The steps below walk you through constructing this URL and entering it as you create the app.

<Steps>
  <Step>
    Click the gear icon in the top-right corner of Connect AI to open **Settings**.
  </Step>

  <Step>
    Navigate to **OAuth Apps** and click **+ Create App**. The **Create OAuth App** dialog appears.
  </Step>

  <Step>
    Enter the following settings:

    * **Name**–enter a descriptive name (for example, *AgentBricksOAuth*).
    * **Application Type**–select **Web Application**.
    * **Callback URL**–follow the instructions below to create a callback URL.

    <Steps>
      <Step>
        Open your Databricks workspace in a browser and copy the host from the address bar, everything between `https://` and the next `/`. For example: `adb-5555555555555555.5.azuredatabricks.net`. (AWS workspaces look like `dbc-xxxxxxxx-xxxx.cloud.databricks.com`; GCP like `xxxx.gcp.databricks.com`.)
      </Step>

      <Step>
        Append `/login/oauth/http.html` to that host. Using the example above, you would enter the following as the **Callback URL**: *[https://adb-5555555555555555.5.azuredatabricks.net/login/oauth/http.html](https://adb-5555555555555555.5.azuredatabricks.net/login/oauth/http.html)*.
      </Step>

      <Step>
        Paste this value into the **Callback URL** field of your Connect AI OAuth app.

        <Frame>
          <img src="https://mintcdn.com/cdata/Mo9PW07TRZvrN4z0/en/images/databricks_client_create_oauth.png?fit=max&auto=format&n=Mo9PW07TRZvrN4z0&q=85&s=2277ff965cb7a039d8337f419a8625fc" alt="Creating an OAuth App in CData Connect AI" width="880" height="772" data-path="en/images/databricks_client_create_oauth.png" />
        </Frame>
      </Step>
    </Steps>
  </Step>

  <Step>
    Click **Confirm**. CData Connect AI creates the OAuth app and generates a **Client ID** and **Client Secret** for the client application.

    <Frame>
      <img src="https://mintcdn.com/cdata/Mo9PW07TRZvrN4z0/en/images/databricks_client_oauth_app.png?fit=max&auto=format&n=Mo9PW07TRZvrN4z0&q=85&s=284276047e1ac6c61e31e41cbcba1cfb" alt="OAuth App Client Id and Client Secret" width="1309" height="600" data-path="en/images/databricks_client_oauth_app.png" />
    </Frame>
  </Step>

  <Step>
    Copy both the **Client ID** and **Client Secret**. You will need them in the next section.
  </Step>
</Steps>

## Create an MCP Server Connection in Databricks

<Steps>
  <Step>
    Log in to Databricks and go to **Databricks Marketplace**.
  </Step>

  <Step>
    In the search bar, enter *Connect AI*. Click **CData Connect AI: Managed MCP Platform for Enterprise Databricks Agents**.

    <Frame>
      <img src="https://mintcdn.com/cdata/rb1dWc-Ry0V9CY4T/en/images/databricks_client_mcp_install.png?fit=max&auto=format&n=rb1dWc-Ry0V9CY4T&q=85&s=cce3f2bea1abc338275ad266b2ac9abb" alt="Install MCP platform" width="1907" height="986" data-path="en/images/databricks_client_mcp_install.png" />
    </Frame>
  </Step>

  <Step>
    Click **Install**. A dialog appears:

    <Frame>
      <img src="https://mintcdn.com/cdata/rb1dWc-Ry0V9CY4T/en/images/databricks_client_mcp_dialog.png?fit=max&auto=format&n=rb1dWc-Ry0V9CY4T&q=85&s=92410bddfdc6c9d0e7b4d27ed64350f1" alt="Install MCP platform dialog" width="638" height="1003" data-path="en/images/databricks_client_mcp_dialog.png" />
    </Frame>
  </Step>

  <Step>
    Enter the **Connection name** for the app, such as **QueryMCP**.
  </Step>

  <Step>
    **Host** and **Base path** are pre-filled.
  </Step>

  <Step>
    Enter the **Client ID** and **Client Secret** you copied from the OAuth App you created in the previous section.
  </Step>

  <Step>
    Select the checkbox to accept the terms and conditions, then click **Install**.
  </Step>
</Steps>

## Create an Agent in Databricks

<Steps>
  <Step>
    In the **Agents** tab, click **Create Agent**.
  </Step>

  <Step>
    Select **Supervisor Agent**.
  </Step>

  <Step>
    In the **Create Supervisor Agent** dialog, enter the following:

    * **Name**–enter a name for your agent.
    * **Description**–enter a description of the agent.
    * **Configure Agents**:
      * **Type**–select **External MCP Server**.
      * **Unity Catalog connection**–select the MCP connection you made in the previous step.
      * **Describe the content**–enter a description of what the MCP connection is.

    <Frame>
      <img src="https://mintcdn.com/cdata/Mo9PW07TRZvrN4z0/en/images/databricks_client_create_agent.png?fit=max&auto=format&n=Mo9PW07TRZvrN4z0&q=85&s=efb935c42fe11542a170809972f8f73a" alt="Create agent" width="1251" height="734" data-path="en/images/databricks_client_create_agent.png" />
    </Frame>
  </Step>

  <Step>
    Click **Create Agent**.
  </Step>
</Steps>

## Test your Agent

<Steps>
  <Step>
    On your agent’s page, click **Open in Playground**.

    <Frame>
      <img src="https://mintcdn.com/cdata/Mo9PW07TRZvrN4z0/en/images/databricks_client_playground.png?fit=max&auto=format&n=Mo9PW07TRZvrN4z0&q=85&s=e928a1dba4a6ab6e5597d694d1430ff2" alt="Open in playground" width="1558" height="736" data-path="en/images/databricks_client_playground.png" />
    </Frame>
  </Step>

  <Step>
    You can now query your connected data with the Connect AI MCP Server through the Supervisor Agent.

    <Frame>
      <img src="https://mintcdn.com/cdata/RvSV5SLEE-z6sDKX/en/images/databricks_client_playground2.png?fit=max&auto=format&n=RvSV5SLEE-z6sDKX&q=85&s=3100f40c6be3c98aaba8209f5d431b3d" alt="Agent playground" width="1244" height="587" data-path="en/images/databricks_client_playground2.png" />
    </Frame>
  </Step>
</Steps>
