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.
Prerequisites
Section titled “Prerequisites”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.disableCustomMcpServerConnectorset 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 requiresroles/orgpolicy.policyAdmin, which project Owner does not include. The policy simulator’s “Test changes” step may fail with apolicysimulator.orgPolicyViolationsPreviews.createpermission error — unrelated, safe to ignore, save anyway - APIs enabled:
discoveryengine.googleapis.comand 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
globallocation - 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/Athere means it will not work
Add the Connector
Section titled “Add the Connector”Connector configuration
Section titled “Connector configuration”| Field | Value |
|---|---|
| Authentication method | OAuth 2.0 |
| MCP Server URL | https://{ce_hostname}/mcp |
| Authorization URL | https://{ce_hostname}/authorize |
| Authorization URL Parameters | (blank) |
| Token URL | https://{ce_hostname}/token |
| Client ID / Secret | from the Context Engine’s /register endpoint — see below |
| Scopes | the 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 Support | checked — the Context Engine advertises S256 only and requires it |
| Use HTTP Basic Authentication | unchecked |
Register the OAuth client
Section titled “Register the OAuth client”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):
$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-Listcurl -X POST "https://{ce_hostname}/register" \ -H "Content-Type: application/json" \ -d '{"redirect_uris": ["https://vertexaisearch.cloud.google.com/oauth-redirect"], "scope": "access"}'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.
Basic / no-auth posture
Section titled “Basic / no-auth posture”For a Context Engine running with AGENTCUBE_CE_AUTH_MODE=basic, skip the registration step entirely (to require sign-in, see Single Sign-On):
- Select No authentication as the authentication method
- Enter the MCP Server URL:
https://{ce_hostname}/mcp - 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.
Verify the Connection
Section titled “Verify the Connection”- In the Gemini Enterprise webapp (not the console), open the connector picker and confirm the data store shows Authorize rather than an error
- Enable actions for the connector
- Ask a question that triggers a tool call, for example:
- “What’s the status of my connected systems?”
- “List the applications I can access”
- Gemini should return data from your environment
Troubleshooting
Section titled “Troubleshooting”| Issue | Resolution |
|---|---|
Console reload fails with UNAUTHENTICATED | Authorize the connector from the Gemini Enterprise webapp, not the console — see the authorization order above |
400 — no more licenses available | The license is assigned to a different (often mistyped) address; reassign it to the correct end user |
| Data store creation blocked by an organization policy | Set constraints/discoveryengine.managed.disableCustomMcpServerConnector to Not enforced at the organization node |
Connector’s Details tab shows Connected apps: N/A | The 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 failure | That log records tool invocations only. Use the Cloud Audit Log entry for RefreshDataConnectorTools instead |
| Tools return errors once authorized | Check the Context Engine health endpoint: https://{ce_hostname}/health |
Scope notes
Section titled “Scope notes”- 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.