Skip to content

Add example on external MCPTool usage and proper auth management #466

@blindosbarra

Description

@blindosbarra

When an agent need to initialize a connection to a custom MCP tool, it is required to manipulate the MCP tool calls on agent side for adding/checking headers (i.e. auth info could come from the application wrapping the agent). I think it would be nice to have a working ADK sample with the best practices for working with external MCP server (i.e. implemented as streamable http protocol via fast MCP) with proper handling of auth tokens highlithing the proper callbacks functions and context variables to use. This example should clearly illustrate the use of the aforementioned ADK callbacks/extension points and context variables.
The current documentation does not fully clarify the lifecycle of a MCPTool in terms of initialization, agent internal MCPTool instance retrivial and how to properly use callback to customize the interactions between agent and tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions