Skip to content

Migrate to symfony/mcp-bundle#4

Open
camilleislasse wants to merge 4 commits intoSylius:mainfrom
camilleislasse:feature/symfony-mcp-bundle
Open

Migrate to symfony/mcp-bundle#4
camilleislasse wants to merge 4 commits intoSylius:mainfrom
camilleislasse:feature/symfony-mcp-bundle

Conversation

@camilleislasse
Copy link

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

$services = $container->services();

$services->load('Sylius\\McpServerPlugin\\Tool\\', '../src/Tool/*')
->autowire()
Copy link
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.

final readonly class PluginDiscoveryLoader implements LoaderInterface
{
public function __construct(
private LoggerInterface $logger = new NullLogger(),
Copy link
Member

Choose a reason for hiding this comment

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

{
$discoverer = new Discoverer($this->logger);
$state = $discoverer->discover(
basePath: dirname(__DIR__, 2),
Copy link
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

mcp:
app: 'Sylius MCP Server'
version: '0.1.0'
Copy link
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
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
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