Skip to content

Connecting to Gemini Enterprise

This guide covers adding AgentCube to Google Gemini Enterprise as a custom MCP connector. Gemini Enterprise connects to the Context Engine’s single MCP endpoint, which fronts every connector behind it — you add one connector in Gemini Enterprise, not one per Oracle system.

This procedure is verified end-to-end: no AgentCube change is required. The setup has several non-obvious prerequisites and one Google-side defect that will otherwise consume an afternoon, so read the next section before touching the console.

All of the following were required in testing — treat this as a checklist before creating the data store:

  • GCP project attached to an organization (an org-less project cannot configure an identity provider)
  • Billing account linked to the project itself (not inherited from the org)
  • Org policy constraints/discoveryengine.managed.disableCustomMcpServerConnector set to Not enforced — Google’s managed default is enforced, which blocks custom MCP connectors outright. Set it at the organization node so every project inherits it. This requires roles/orgpolicy.policyAdmin, which project Owner does not include. The policy simulator’s “Test changes” step may fail with a policysimulator.orgPolicyViolationsPreviews.create permission error — unrelated, safe to ignore, save anyway
  • APIs enabled: discoveryengine.googleapis.com and the Agent Platform API
  • Gemini Enterprise subscription (Standard tier is sufficient)
  • License assigned to the specific end user — auto-assign only fires on first sign-in. A mistyped address consumes the seat and the real user gets a “no more licenses available” error
  • IAM roles: Discovery Engine User and Discovery Engine Editor
  • Identity provider configured for the global location
  • A Gemini Enterprise app already exists
  • The data store is created from inside that app (Apps → your app → Connected data stores → New data store → Custom MCP Server). Google does not support connecting an already-existing data store to an app. A correctly-bound connector shows Connected apps: <your app> on its Details tab — N/A there means it will not work
FieldValue
Authentication methodOAuth 2.0
MCP Server URLhttps://{ce_hostname}/mcp
Authorization URLhttps://{ce_hostname}/authorize
Authorization URL Parameters(blank)
Token URLhttps://{ce_hostname}/token
Client ID / Secretfrom the Context Engine’s /register endpoint — see below
Scopesthe Context Engine’s required scopes (AGENTCUBE_CE_OIDC_SCOPES): access by default on Microsoft Entra ID (AGENTCUBE_CE_OIDC_PROVIDER=azure), openid profile email by default on a generic OIDC provider
Enable PKCE Supportchecked — the Context Engine advertises S256 only and requires it
Use HTTP Basic Authenticationunchecked

Gemini Enterprise supports neither OAuth discovery nor Dynamic Client Registration — unlike Claude.ai or ChatGPT, it needs a client ID and secret pasted directly into the form. Register one out-of-band by POSTing to the Context Engine’s /register endpoint with Google’s fixed redirect URI. The examples use access, the Entra ID default; on a generic OIDC provider, set scope to openid profile email (or whatever AGENTCUBE_CE_OIDC_SCOPES lists, space-separated):

Terminal window
$body = @{
redirect_uris = @("https://vertexaisearch.cloud.google.com/oauth-redirect")
scope = "access"
} | ConvertTo-Json
$client = Invoke-RestMethod -Uri "https://{ce_hostname}/register" -Method Post -ContentType "application/json" -Body $body
$client | Format-List

The response carries client_id and client_secret — paste those into the Gemini Enterprise connector form. The Context Engine stores registered clients persistently, so this survives redeploys; you only do it once per connector.

For a Context Engine running with AGENTCUBE_CE_AUTH_MODE=basic, skip the registration step entirely (to require sign-in, see Single Sign-On):

  1. Select No authentication as the authentication method
  2. Enter the MCP Server URL: https://{ce_hostname}/mcp
  3. Save the connector

Console-side reload works normally in this posture — there’s no per-user credential to acquire, so the authorization-order issue above doesn’t apply.

  1. In the Gemini Enterprise webapp (not the console), open the connector picker and confirm the data store shows Authorize rather than an error
  2. Enable actions for the connector
  3. Ask a question that triggers a tool call, for example:
    • “What’s the status of my connected systems?”
    • “List the applications I can access”
  4. Gemini should return data from your environment
IssueResolution
Console reload fails with UNAUTHENTICATEDAuthorize the connector from the Gemini Enterprise webapp, not the console — see the authorization order above
400 — no more licenses availableThe license is assigned to a different (often mistyped) address; reassign it to the correct end user
Data store creation blocked by an organization policySet constraints/discoveryengine.managed.disableCustomMcpServerConnector to Not enforced at the organization node
Connector’s Details tab shows Connected apps: N/AThe data store was created outside a Gemini Enterprise app; it must be created from Apps → your app → Connected data stores
No signal in connector_activity logs during a discovery failureThat log records tool invocations only. Use the Cloud Audit Log entry for RefreshDataConnectorTools instead
Tools return errors once authorizedCheck the Context Engine health endpoint: https://{ce_hostname}/health
  • Agent Gateway is not on this path and does not help. A connector imported from Agent Registry fails tool discovery outright (FAILED_PRECONDITION) — use the Custom MCP Server card when creating the data store, not an Agent Registry import.
  • Gemini Notebook Enterprise cannot consume MCP. It’s a document-ingestion product (Docs, Slides, PDFs, text, web URLs, and similar sources) with no tool-calling surface, and is not an AgentCube integration target.