Skip to content

Migrate to symfony/mcp-bundle#4

Merged
Wojdylak merged 4 commits intoSylius:mainfrom
camilleislasse:feature/symfony-mcp-bundle
Feb 6, 2026
Merged

Migrate to symfony/mcp-bundle#4
Wojdylak merged 4 commits intoSylius:mainfrom
camilleislasse:feature/symfony-mcp-bundle

Conversation

@camilleislasse
Copy link
Copy Markdown
Contributor

Q A
Branch? main
Bug fix? no
New feature? no
BC breaks? yes
Related tickets -
License MIT

Summary

Migrate from php-mcp/server to symfony/mcp-bundle for better framework integration (includes profiler support)

Capture d'écran 2026-01-26 à 07 36 51

Changes

  • Replace php-mcp/server dependency with symfony/mcp-bundle ^0.3.0
  • Add PluginDiscoveryLoader to register plugin tools via LoaderInterface
  • Update configuration format to use mcp.yaml
  • Update README with new installation steps (mcp.yaml, routes)
  • Remove custom transport factory and server factory classes

BC Breaks

  • Configuration file changed from sylius_mcp_server.yaml to mcp.yaml
  • Console command changed from sylius:mcp-server:start to mcp:server
  • HTTP endpoint changed from /mcp to /_mcp

Comment thread config/services.php Outdated
Comment thread src/Mcp/Loader/PluginDiscoveryLoader.php
Comment thread tests/TestApplication/config/config.yaml Outdated
Comment thread tests/TestApplication/config/routes.yaml Outdated
Comment thread README.md Outdated
Comment thread config/services.php Outdated
$services = $container->services();

$services->load('Sylius\\McpServerPlugin\\Tool\\', '../src/Tool/*')
->autowire()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this plugin goes into sylius namespace, it should follow existing conventions like not using autowire/autoconfigure and specifying all dependencies manually in this file.

@Wojdylak unless a new convention was made, this is critical.

Comment thread src/Loader/PluginDiscoveryLoader.php Outdated
Comment thread src/Loader/PluginDiscoveryLoader.php Outdated
final readonly class PluginDiscoveryLoader implements LoaderInterface
{
public function __construct(
private LoggerInterface $logger = new NullLogger(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/Loader/PluginDiscoveryLoader.php Outdated
{
$discoverer = new Discoverer($this->logger);
$state = $discoverer->discover(
basePath: dirname(__DIR__, 2),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunate, that getPath is not static.

public function getPath(): string

for a fancy call like that.
https://github.com/symfony/symfony/blob/502b3648c0f6a8833d70065a7a54816ee69c9d9d/src/Symfony/Component/Intl/Intl.php#L115-L118

Fine as is though.

@camilleislasse camilleislasse force-pushed the feature/symfony-mcp-bundle branch from a002213 to 45a383a Compare January 30, 2026 11:59
Comment thread config/config.yaml Outdated

mcp:
app: 'Sylius MCP Server'
version: '0.1.0'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: '0.1.0'
version: '0.2.0'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@camilleislasse camilleislasse force-pushed the feature/symfony-mcp-bundle branch from 45a383a to f20107b Compare January 31, 2026 07:50
@Wojdylak Wojdylak merged commit bda4e19 into Sylius:main Feb 6, 2026
2 checks passed
@Wojdylak
Copy link
Copy Markdown
Member

Wojdylak commented Feb 6, 2026

@camilleislasse Thank you 🎉

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.

3 participants