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

# GitHub Copilot

Connect AI uses OAuth authentication by default, but you can also use Basic authentication with a Personal Access Token (PAT).

## Prerequisites

Before you can configure and use GitHub Copilot with Connect AI, you must do the following:

* Connect a data source to your Connect AI account. See [Sources](/en/Sources) for more information.

* Install and enable GitHub Copilot in Visual Studio Code (or any IDE supporting GitHub Copilot).

* (Basic authentication only) Generate a Personal Access Token (PAT) on the [Settings](/en/Settings#personal-access-tokens) page. Copy this down, as it acts as your password during authentication.

* (Basic authentication only) Base64-encode your Connect AI credentials in the following format: `Base64("email:PAT")`.

## Connect to Connect AI

### OAuth Authentication

<Steps>
  <Step>
    Create a folder named `.vscode` in your project repository. Within this folder, create a file named `mcp.json` and add the following configuration.

    ```json theme={null}
    {
      "servers": {
          "cdata-mcp": {
          "type": "http",
          "url": "https://mcp.cloud.cdata.com/mcp"
       }
      },
     "inputs": []
    }
    ```
  </Step>

  <Step>
    Click **Start** within your IDE to start the MCP server. Visual Studio Code opens your browser to the Connect AI sign-in page. Complete the sign-in to authorize the connection.
  </Step>

  <Step>
    After authorization, the MCP server displays **Running**.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/githubcopilot_client_config.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=e224690545de25c6a8584cc91b789e88" alt="" width="961" height="399" data-path="en/images/githubcopilot_client_config.png" />
    </Frame>
  </Step>
</Steps>

### Basic Authentication

<Steps>
  <Step>
    Create a folder named `.vscode` in your project repository. Within this folder, create a file named `mcp.json` and add the following configuration. Replace `YOUR_BASE64_ENCODED_EMAIL:PAT` with the Base64-encoded value of `email:PAT` that you created in the prerequisites.

    ```json theme={null}
    {
      "servers": {
          "cdata-mcp": {
          "type": "http",
          "url": "https://mcp.cloud.cdata.com/mcp",
          "headers": {
             "Authorization": "Basic YOUR_BASE64_ENCODED_EMAIL:PAT"
         }
       }
      },
     "inputs": []
    }
    ```
  </Step>

  <Step>
    Click **Start** within your IDE to start the MCP server. If the MCP server starts without error, it displays **Running**.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/githubcopilot_client_config.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=e224690545de25c6a8584cc91b789e88" alt="" width="961" height="399" data-path="en/images/githubcopilot_client_config.png" />
    </Frame>
  </Step>
</Steps>

## Add the Connect AI Tools

<Steps>
  <Step>
    Toggle **Chat** in the title bar to display the **Chat** pane on the right.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/githubcopilot_client_chat.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=43f8b671de420fcc1d3095510749789c" alt="" width="1321" height="290" data-path="en/images/githubcopilot_client_chat.png" />
    </Frame>
  </Step>

  <Step>
    Click **Add Context** in the bottom of the **Chat** pane. In the search bar, select **Tools**. Then search for *CData*. Add **cdata-mcp All Tools**.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/githubcopilot_client_tools.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=a854d7455dda579365d92525d6a6636a" alt="" width="920" height="425" data-path="en/images/githubcopilot_client_tools.png" />
    </Frame>
  </Step>
</Steps>

## Chat with GitHub Copilot

You can now chat with GitHub Copilot and issue contextual prompts. As a test, you can provide the MCP server with a prompt, such as a list of tables for a particular connection. GitHub Copilot uses the Connect AI tools such as `getCatalogs`, `getSchemas`, and `getTables` to retrieve data from the connected data source.

<Frame>
  <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/githubcopilot_client_results.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=521dc07feeeb7bfd4b6dd406e5e9c7a8" alt="" width="972" height="735" data-path="en/images/githubcopilot_client_results.png" />
</Frame>
