Preserve Google Agent Identity token-sharing policy when constructing MCP tools#6037
Open
White-Mouse wants to merge 2 commits into
Open
Preserve Google Agent Identity token-sharing policy when constructing MCP tools#6037White-Mouse wants to merge 2 commits into
White-Mouse wants to merge 2 commits into
Conversation
Collaborator
|
An analysis of Pull Request #6037 has been completed. 🔍 ADK Pull Request Analysis: PR #6037Title: Preserve Google Agent Identity token-sharing policy when constructing MCP tools Executive Summary
Detailed Findings & Analysis1. Objectives & Impact ("What does it do?")
2. Justification & Value ("Is it a valid and useful change?")
3. Principle & Style Alignment Checklist ("Does it follow rules?")
The PR is ready for approval. Please let me know if you would like me to perform any further tasks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GOOGLE_API_PREVENT_AGENT_TOKEN_SHARING_FOR_GCP_SERVICESfrom MCP tool constructionMcpToolsetandMCPToolconstructors preserving an existing environment policy valueMotivation
MCP tool construction currently mutates
GOOGLE_API_PREVENT_AGENT_TOKEN_SHARING_FOR_GCP_SERVICESas a process-wide side effect.This PR removes the constructor-side environment mutation so deployment-level Google auth / Agent Identity policy remains controlled by the application environment. The constructors do not need to rewrite the process environment to initialize MCP tools.
Testing
uv run --extra mcp --extra test python -m pytest tests/unittests/tools/mcp_tool/test_mcp_tool.py tests/unittests/tools/mcp_tool/test_mcp_toolset.py tests/unittests/tools/mcp_tool/test_mcp_toolset_auth.py -quvx ruff check src/google/adk/tools/mcp_tool/mcp_tool.py src/google/adk/tools/mcp_tool/mcp_toolset.py tests/unittests/tools/mcp_tool/test_mcp_tool.py tests/unittests/tools/mcp_tool/test_mcp_toolset.pyuv run --extra mcp --extra test python -m py_compile src/google/adk/tools/mcp_tool/mcp_tool.py src/google/adk/tools/mcp_tool/mcp_toolset.py tests/unittests/tools/mcp_tool/test_mcp_tool.py tests/unittests/tools/mcp_tool/test_mcp_toolset.pygit diff --check