Prerequisites
Before you can configure and use Gemini Enterprise with Connect AI, you must first do the following:- Connect a data source to your Connect AI account. See Sources for more information.
- Have a Gemini Enterprise account (trial available).
- Have a Google Cloud project with billing enabled.
- Install and configure the Google Cloud CLI.
- Install Python 3.12+ and the UV package manager.
- Install
google-adk>=1.31.1. - Have a Google Cloud Storage bucket available for ADK deployment staging.
Use
google-adk>=1.31.1. Versions prior to 1.31.1 have a known bug where a bound token mechanism interferes with McpToolset’s outbound HTTP requests, preventing the header_provider auth token from being passed correctly to the MCP server.ADK deployment has a known issue on Windows. Use Ubuntu via WSL (Windows Subsystem for Linux) on Windows machines. Mac and Linux environments work directly.
Create an OAuth App in CData Connect AI
Gemini Enterprise uses OAuth 2.0 Authorization Code with PKCE to authenticate users against the CData Connect AI MCP Server. This requires a user-based OAuth App in your CData Connect AI account.Enter the following settings:
- Name–enter a descriptive name (for example, GeminiEnterpriseOAuth).
- Authentication Flow–select User-based (Authorization Code).
- Callback URL–enter https://vertexaisearch.cloud.google.com/oauth-redirect.

Set Up the Google CLI and ADK Environment
Install the Google Cloud CLI and authenticate:
Develop the ADK Agent
The agent usesMcpToolset with StreamableHTTPConnectionParams and a header_provider to connect to the CData Connect AI MCP endpoint. The header_provider retrieves the per-session Bearer token from the ReadonlyContext, injected by Gemini Enterprise after the OAuth flow, so no credentials are stored in the agent code.
Folder Structure
agents/ directory, create the agent subdirectory and navigate into it:
agent.py
.env
The
CONNECT_AI_AUTHID value is the OAuth App ID generated above. It can be found on the OAuth Apps page in Connect AI Settings (format: cdata-connect-ai-oauth_XXXXXXXXXXXXXXXXX).__init__.py
Deploy to Vertex AI Agent Engine
Deployment typically takes about 5 minutes.When deployment completes, the Vertex AI Agent Engine resource name is displayed:Copy this resource name. You will need it in the next section.
Add the Agent to Gemini Enterprise
On the authorization screen, configure OAuth with the following settings:
- Client ID and Client Secret–from the OAuth App created above.
- Token URI–enter https://cloud-login.cdata.com/oauth/token.
- Authorization URI–enter https://cloud-login.cdata.com/authorize?response_type=code.
- Enable PKCE verification.

On the configuration screen, fill in the following:
- Agent name–enter an appropriate display name (for example, CData Connect AI Agent).
- Agent description–enter a description that helps Gemini understand when to invoke this agent.
- Agent Engine inference engine–enter the resource name copied from the previous section in the following format: projects/{project}/locations/{location}/reasoningEngines/{id}.

Query Live Data with Natural Language
With the agent registered, you can query live data using natural language from the Gemini Enterprise web application. Each user authenticates with their own Connect AI credentials via the OAuth flow on first use.Ask natural language questions about your data, such as:
- “Show me all records from the last 30 days”
- “What are the top accounts by revenue?”
- “List all active opportunities and their current status”
- “Summarize activity for this quarter”

