fix(config): load validated MCP toolsets under adk web - #6736
Open
ftnext wants to merge 1 commit into
Open
Conversation
The web YAML denylist rejected every args field, so built-in McpToolset configs could not load. Allow args only for statically registered built-ins after tool-specific validation, while preserving the generic block and stdio opt-in.
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.
Link to Issue or Description of Change
1. Link to an existing issue:
McpToolsetargs in local YAML agents served byadk web#6735Problem:
adk webrecursively rejects every YAML key namedargsas part of the defense against CVE-2026-4810.This also rejects declarative configuration for the built-in
McpToolset.As a result, a local
root_agent.yamlcontainingMcpToolset.argsis skipped by the agent loader.The app is then unknown to the API server and
POST /run_ssereturns 404.Solution:
Add a static registry of ADK-owned built-ins whose YAML arguments can be validated without resolving a config-supplied Python reference.
This change:
McpToolset;McpToolsetConfig;toolsfield of a built-inLlmAgent;argsfor custom tools, factories, custom agents, and unregistered built-ins;httpx_client_factory;ADK_ALLOW_CONFIG_STDIO_MCP_SERVERS=1for explicitly trusted stdio configurations;adk web.This change applies only to agent configurations loaded from the local agents directory.
Agent Builder uploads continue to reject every
argskey.Builder support is intentionally out of scope because accepting uploaded remote MCP URLs requires a separate SSRF policy.
Testing Plan
Unit Tests:
Covered behaviors:
args;toolsfield;Type checking:
Pre-commit:
Manual End-to-End (E2E) Tests:
The YAML sample was loaded with the Web YAML denylist enabled
adk webchat flow.Checklist
Additional context
This is a positive allowlist layered on top of the existing YAML key denylist, module blocklist, Builder project-boundary checks, and stdio opt-in.
It does not weaken the Agent Builder upload restrictions.