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

## Prerequisites

Before you can configure and use Gemini with Connect AI, you must first generate an [OAuth JWT bearer token](/en/API/Authentication-Embedded). 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, do the following:

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

  <Step>
    Copy and paste the following into the `settings.json` file. `"Authorization"` should be set to `"Bearer OAUTH_JWT_TOKEN"`. This is the OAuth JWT token from the prerequisites.

    ```json theme={null}
    {
    "mcpServers": {
       "connect-cloud": {
          "httpUrl": "https://mcp.cloud.cdata.com/mcp",
          "headers": {
            "Authorization": "Bearer OAUTH_JWT_TOKEN"  //Replace with your OAuth JWT Token
         },
          "trust": true
       }
     },
    "selectedAuthType": "oauth-personal"
    }
    ```
  </Step>

  <Step>
    In the terminal, type:

    ```bash theme={null}
    gemini
    ```

    You may need to give Google authorization to access your account.
  </Step>

  <Step>
    The Gemini screen appears as follows:

    <Frame>
      <img src="https://mintcdn.com/cdata/tJfdD354GT5ojxph/ja/images/gemini_client_homescreen.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=064b58026d6a1f485e1626cbd7569cd5" alt="Gemini Client Home Screen" width="1260" height="429" data-path="ja/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/tJfdD354GT5ojxph/ja/images/gemini_client_prompt.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=d7f5f5cc30ad6acdfc6bea57ba6a2cba" alt="Gemini Client Prompt" width="719" height="626" data-path="ja/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, remove `MCP_USERNAME` and `MCP_PASSWORD`. You are using the OAuth JWT token from the prerequisites to authenticate.
  </Step>

  <Step>
    Run the following command in your terminal:

    ```bash theme={null}
    pip install -r requirements.txt
    ```
  </Step>

  <Step>
    Run the following command. This starts the ADK at port 5000 on your local machine:

    ```bash theme={null}
    python -m google.adk.cli web --port 5000
    ```
  </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/tJfdD354GT5ojxph/ja/images/gemini_client_ADK.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=93a7a431bb5d5a27b94585312cd8f6c1" alt="Gemini Client ADK" width="3728" height="1950" data-path="ja/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/tJfdD354GT5ojxph/ja/images/gemini_client_adkprompt.png?fit=max&auto=format&n=tJfdD354GT5ojxph&q=85&s=f54ef665b72077a3017d6f9aad9ff482" alt="Gemini Client ADK Prompt" width="3787" height="2015" data-path="ja/images/gemini_client_adkprompt.png" />
    </Frame>
  </Step>
</Steps>
