Skip to content

feat(models): forward MCP OAuth scopes in agy_cli generator - #707

Open
ikenwan-dev wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
ikenwan-dev:fix-agy-mcp-oauth-scopes
Open

ikenwan-dev wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
ikenwan-dev:fix-agy-mcp-oauth-scopes

Conversation

@ikenwan-dev

Copy link
Copy Markdown
Contributor

Forwards oauth.scopes for authProviderType: google_credentials MCP servers in AgyCliGenerator:

  • Why: agy's built-in google_credentials ADC provider ignores oauth.scopes in mcp_config.json and hardcodes https://www.googleapis.com/auth/cloud-platform, causing MCP servers that require non-cloud-platform scopes (e.g. https://www.googleapis.com/auth/colaboratory) to fail attachment with 403 ACCESS_TOKEN_SCOPE_INSUFFICIENT.
  • Fix: When oauth.scopes is configured on a google_credentials MCP server, mint a scoped Bearer token via gcloud auth application-default print-access-token --scopes=... (including GKE service account impersonation support), inject headers.Authorization into mcp_config.json, and refresh the token across turns.

@ikenwan-dev
ikenwan-dev force-pushed the fix-agy-mcp-oauth-scopes branch from 878e48d to af7f210 Compare November 6, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant