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

# Gemini

> Gemini is Google’s family of large language models (LLMs). It can generate text, images, audio, video, and code. This page explains how to connect the Connect AI MCP to Gemini through either the command-line interface or the Google Agent Development Kit (ADK).

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 Gemini with Connect AI, you must first connect a data source to your Connect AI account. See [Sources](/en/Sources) for more information.

(Basic authentication and Google ADK 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.

You need Python >= 3.10 to use the Gemini tools.

## Connect through the Gemini Command Line Interface

After you install Gemini, create the settings file and then choose an authentication method.

<Steps>
  <Step>
    Go to your user directory `%USERPROFILE%` and create a `.gemini` folder.
  </Step>

  <Step>
    Within the folder, create a file named `settings.json`.
  </Step>
</Steps>

### OAuth Authentication

<Steps>
  <Step>
    Copy and paste the following into the `settings.json` file:

    ```json theme={null}
    {
    "mcpServers": {
       "connect-ai": {
          "httpUrl": "https://mcp.cloud.cdata.com/mcp/",
          "trust": true
       }
     },
    "selectedAuthType": "oauth-personal"
    }
    ```
  </Step>

  <Step>
    In the terminal, type `gemini`. You may need to give Google authorization to access your account.
  </Step>

  <Step>
    Run `/mcp auth connect-ai` to authenticate to the Connect AI MCP server. Gemini opens your browser to the Connect AI sign-in page. Complete the sign-in to authorize the connection.
  </Step>
</Steps>

### Basic Authentication

<Steps>
  <Step>
    Copy and paste the following into the `settings.json` file. Replace `EMAIL` with your Connect AI email and `PAT` with the PAT you obtained in the prerequisites:

    ```json theme={null}
    {
    "mcpServers": {
       "connect-ai": {
          "httpUrl": "https://mcp.cloud.cdata.com/mcp/",
          "headers": {
            "Authorization": "Basic EMAIL:PAT"  //Replace with your authorization header
         },
          "trust": true
       }
     },
    "selectedAuthType": "oauth-personal"
    }
    ```
  </Step>

  <Step>
    In the terminal, type `gemini`. You may need to give Google authorization to access your account.
  </Step>
</Steps>

## Use Gemini

<Steps>
  <Step>
    The Gemini screen appears as follows:

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/gemini_client_homescreen.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=8c7f37a8f07d0f7fc7adaf0de45987b6" alt="Gemini Home Screen" width="1260" height="429" data-path="en/images/gemini_client_homescreen.png" />
    </Frame>
  </Step>

  <Step>
    Enter a prompt in the prompt box to ask Gemini a question. Gemini uses the Connect AI tools such as `getCatalogs`, `getSchemas`, and `getTables` to retrieve data from connected data sources.
  </Step>

  <Step>
    Gemini returns a response to your prompt.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/gemini_client_prompt.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=d9b78e9caaddff1e9f7b9e7430daa7f6" alt="Gemini Prompt" width="719" height="626" data-path="en/images/gemini_client_prompt.png" />
    </Frame>
  </Step>
</Steps>

## Connect through the Google ADK

<Steps>
  <Step>
    Download the folder [adk-mcp-client](https://github.com/CDataSoftware/adk-mcp-client) and unzip the folder.
  </Step>

  <Step>
    Rename `.env example` to `.env`.
  </Step>

  <Step>
    In the `.env` file, replace `your_email@example.com` with your Connect AI email, and replace `your_mcp_password_here` with the PAT created in the prerequisites.
  </Step>

  <Step>
    Run `pip install -r requirements.txt` in your terminal.
  </Step>

  <Step>
    Run `python -m google.adk.cli web --port 5000`. This starts the ADK at port 5000 on your local machine.
  </Step>

  <Step>
    In your web browser, open `127.0.0.1:5000`. The application looks like the following:

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/gemini_client_ADK.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=4ca22734e21993b3f5534c6dbb6252e7" alt="Gemini ADK" width="3728" height="1950" data-path="en/images/gemini_client_ADK.png" />
    </Frame>
  </Step>

  <Step>
    Enter a prompt in the **Type a Message** box. Gemini uses the Connect AI tools such as `getCatalogs`, `getSchemas`, and `getTables` to retrieve data from connected data sources.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/gemini_client_adkprompt.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=a457654ec5e542cba4ad64c1abfc55ee" alt="Gemini ADK Prompt" width="3787" height="2015" data-path="en/images/gemini_client_adkprompt.png" />
    </Frame>
  </Step>
</Steps>
