-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Hi team,
I’m working on integrating a third-party MCP server with the Google Agent Development Kit (ADK) and would like clarification on the exact OAuth2 setup required for Authorization Code flow.
Project Setup
- ADK agent integration with MCP server
- ADK agent deployed in Vertex AI Agent Engine
- Agent registered in Gemini Enterprise
- Tools config includes
auth.oauth2with authorization and token URLs
Problem
It’s unclear from the current documentation and GitHub discussions whether ADK supports fully automatic OAuth2 authorization-code handling, or if developers must still implement the full client-side OAuth2 callback flow in their MCP servers.
The following discussions/PRs suggest that ADK handles OAuth2 partially, but do not confirm end-to-end support for the Authorization Code flow:
- [Question] MCP tools with auth #2184
- Oauth2 Flow conflict with MCPToolSet discovery of tools #2116
- [Question] MCP tools with auth #2192
- PR MCPToolset: Add OAuth2 Client Credentials Flow with RFC 8414 Compliant Discovery #2061
From my testing:
- ADK can detect that a tool requires OAuth2
- ADK does not present an authorization URL in the ADK Web UI
- No redirect flow is initiated
- No access token is received
- It appears that ADK still expects a client-side redirect URL (
/oauth/callback) and code→token exchange to be implemented manually
Key Questions
Could you please clarify:
-
Does ADK support fully automatic OAuth2 Authorization Code flow?
- i.e., generating the authorization URL, handling the redirect, and exchanging the code for tokens without requiring a custom callback endpoint?
-
Or must developers still implement the full client-side OAuth2 callback flow
including:- hosting the redirect URL
- building
/oauth/callback - doing the code→token exchange
- passing the resulting token into ADK?
-
If the client-side callback is required, could you provide or point to an official end-to-end example that shows how this should be implemented for use with ADK + Vertex AI Agent Engine + Gemini Enterprise?
Any concrete guidance would be greatly appreciated.
Thank you!