fix(mcp): fix no security / validation in mcp tools when using symfony listeners - #8435
Merged
Merged
Conversation
This was referenced Aug 16, 2026
soyuka
added a commit
to soyuka/core
that referenced
this pull request
Aug 16, 2026
PR api-platform#8435 re-derived isset($bundles['SecurityBundle']) and interface_exists(ValidatorInterface) inside load() to decide whether to wire mcp/security.php and mcp/validator.php. Both gates already exist in registerSecurityConfiguration() and registerValidatorConfiguration(). They agree today, but changing a canonical gate would silently strip MCP of security again -- the exact bug api-platform#8435 fixed. Load the MCP files from inside those two methods instead, guarded by a single $mcpProviderChain flag derived once from the existing MCP-enabled condition. One place now decides "security available", one decides "validator available".
soyuka
added a commit
to soyuka/core
that referenced
this pull request
Aug 16, 2026
PR api-platform#8435 re-derived isset($bundles['SecurityBundle']) and interface_exists(ValidatorInterface) inside load() to decide whether to wire mcp/security.php and mcp/validator.php. Both gates already exist in registerSecurityConfiguration() and registerValidatorConfiguration(). They agree today, but changing a canonical gate would silently strip MCP of security again -- the exact bug api-platform#8435 fixed. Load the MCP files from inside those two methods instead, guarded by a single $mcpProviderChain flag derived once from the existing MCP-enabled condition. One place now decides "security available", one decides "validator available".
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.
When using both McpTool and symfony listeners all security / validation are not executed, even if defined on the attribute.
This is mainly due because the call don't trigger the symfony listener.
This PR add missing provider for mcp when using symfony listeners