Skip to content

Commit fa90aee

Browse files
author
camilleislasse
committed
Fix PR review comments for MCP Bundle migration
- Remove prefer-stable from root composer.json - Move CHANGELOG content to 0.1 section and remove BC BREAK labels - Use ServerBuilder::class and Server::class in services configuration - Fix "client vs server" comment in documentation - Use ServerBuilder::class in test instead of string
1 parent f17441e commit fa90aee

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"symfony/finder": "^7.3|^8.0"
1313
},
1414
"minimum-stability": "dev",
15-
"prefer-stable": true,
1615
"config": {
1716
"sort-packages": true
1817
}

src/mcp-bundle/CHANGELOG.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
CHANGELOG
22
=========
33

4-
0.2
4+
0.1
55
---
66

7-
* [BC BREAK] Migration from `symfony/mcp-sdk` to official `mcp/sdk`
8-
* [BC BREAK] Tool definition changed from interfaces to PHP attributes `#[McpTool]`
9-
* [BC BREAK] Automatic tool discovery via attributes instead of manual registration
10-
* [BC BREAK] Server creation now uses `Server::make()` builder pattern
7+
* Migration from `symfony/mcp-sdk` to official `mcp/sdk`
8+
* Tool definition changed from interfaces to PHP attributes `#[McpTool]`
9+
* Automatic tool discovery via attributes instead of manual registration
10+
* Server creation now uses `Server::make()` builder pattern
1111
* Updated STDIO transport command to `mcp:server`
1212
* Simplified service configuration using native SDK patterns
1313
* Enhanced auto-discovery scanning in `src/` directory
14-
15-
0.1
16-
---
17-
1814
* Add Symfony bundle bridging MCP-SDK with Symfony applications
1915
* Add server mode exposing Symfony tools to MCP clients:
2016
- STDIO transport via `php bin/console mcp:server` command

src/mcp-bundle/config/services.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

14+
use Mcp\Server;
15+
use Mcp\Server\ServerBuilder;
1416
use Mcp\Server\Transport\Sse\Store\CachePoolStore;
1517

1618
return static function (ContainerConfigurator $container): void {
@@ -19,13 +21,13 @@
1921
->args([
2022
service('cache.app'),
2123
])
22-
->set('mcp.server.builder', 'Mcp\\Server\\ServerBuilder')
23-
->factory(['Mcp\\Server', 'make'])
24+
->set('mcp.server.builder', ServerBuilder::class)
25+
->factory([Server::class, 'make'])
2426
->call('setServerInfo', [param('mcp.app'), param('mcp.version')])
2527
->call('setLogger', [service('logger')])
2628
->call('setDiscovery', [param('kernel.project_dir'), ['src']])
2729

28-
->set('mcp.server', 'Mcp\\Server')
30+
->set('mcp.server', Server::class)
2931
->factory([service('mcp.server.builder'), 'build'])
3032

3133
;

src/mcp-bundle/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Configuration
7575
name:
7676
transport: 'stdio' # Transport method to use, either 'stdio' or 'sse'
7777
stdio:
78-
command: 'php /path/bin/console mcp:server' # Command to execute to start the client
78+
command: 'php /path/bin/console mcp:server' # Command to execute to start the server
7979
arguments: [] # Arguments to pass to the command
8080
sse:
8181
url: 'http://localhost:8000/sse' # URL to SSE endpoint of MCP server

src/mcp-bundle/tests/DependencyInjection/McpToolPassTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\AI\McpBundle\Tests\DependencyInjection;
1313

14+
use Mcp\Server\ServerBuilder;
1415
use PHPUnit\Framework\Attributes\CoversClass;
1516
use PHPUnit\Framework\TestCase;
1617
use Symfony\AI\McpBundle\DependencyInjection\McpToolPass;
@@ -23,7 +24,7 @@ public function testCreatesServiceLocatorForTaggedServices()
2324
{
2425
$container = new ContainerBuilder();
2526

26-
$container->register('mcp.server.builder', 'Mcp\\Server\\ServerBuilder');
27+
$container->register('mcp.server.builder', ServerBuilder::class);
2728

2829
$container->register('tool1', 'MockTool1')
2930
->addTag('mcp.tool');
@@ -53,7 +54,7 @@ public function testDoesNothingWhenNoToolsTagged()
5354
{
5455
$container = new ContainerBuilder();
5556

56-
$container->register('mcp.server.builder', 'Mcp\\Server\\ServerBuilder');
57+
$container->register('mcp.server.builder', ServerBuilder::class);
5758
$container->register('service1', 'MockService');
5859
$container->register('service2', 'MockService');
5960

0 commit comments

Comments
 (0)