Skip to content

fix(mcp): fix no security / validation in mcp tools when using symfony listeners - #8435

Merged
soyuka merged 1 commit into
api-platform:4.3from
joelwurtz:fix/mcp-symfony-listeners
Aug 16, 2026
Merged

fix(mcp): fix no security / validation in mcp tools when using symfony listeners#8435
soyuka merged 1 commit into
api-platform:4.3from
joelwurtz:fix/mcp-symfony-listeners

Conversation

@joelwurtz

Copy link
Copy Markdown
Contributor
Q A
Branch? 4.3
Tickets /
License MIT
Doc PR /

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

@soyuka
soyuka merged commit 4f70189 into api-platform:4.3 Aug 16, 2026
109 of 112 checks passed
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".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants