Skip to content

Conversation

@camilleislasse
Copy link

@camilleislasse camilleislasse commented Nov 13, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #830
License MIT

This PR makes MonologBundle optional dependency for McpBundle. Without it installed, the container compilation was failing with "Parent definition' monolog.logger_prototype' does not exist."

Changes

  • Wrap monolog.logger.mcp service creation in class_exists() check
  • Add ->nullOnInvalid() to setLogger() call in services.php
  • Uniformize logger references: both McpCommand and McpController now use monolog.logger.mcp with NULL_ON_INVALID_REFERENCE
  • Update test to skip when MonologBundle is not installed

Credits

Builds on the initial work in #849 by @WebMamba. That PR protected service creation but the service was still referenced without protection. This PR completes the fix by also protecting the service usage.

Fixes symfony#830

- Wrap monolog.logger.mcp service creation in class_exists() check
- Add ->nullOnInvalid() to setLogger() call
- Uniformize logger references in McpCommand and McpController
- Update test to skip when MonologBundle is not installed

Builds on symfony#849 by @WebMamba
@carsonbot carsonbot added Bug Something isn't working Status: Needs Review labels Nov 13, 2025
@carsonbot carsonbot changed the title Make MonologBundle optional in McpBundle Make MonologBundle optional in McpBundle Nov 13, 2025
@OskarStark OskarStark added the MCP Bundle Issues & PRs about the MCP SDK integration bundle label Nov 13, 2025
@carsonbot carsonbot changed the title Make MonologBundle optional in McpBundle [MCP Bundle] Make MonologBundle optional in McpBundle Nov 13, 2025
@OskarStark OskarStark changed the title [MCP Bundle] Make MonologBundle optional in McpBundle [MCP Bundle] Make MonologBundle optional Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working MCP Bundle Issues & PRs about the MCP SDK integration bundle Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MCP Bundle] missing requirement to monolog

3 participants