Skip to content

Clarification Needed: OAuth2 Authorization Code Flow Requirements for MCP Server Integration #3621

@priyayarrabolu-boop

Description

@priyayarrabolu-boop

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.oauth2 with 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:

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:

  1. 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?
  2. 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?
  3. 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!

Metadata

Metadata

Assignees

Labels

mcp[Component] Issues about MCP supportplanned[Status] This issue is planned to be work on by ADK eng teamtools[Component] This issue is related to tools

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions