Skip to content

Commit 0ea2bfa

Browse files
Address comments
1 parent 6dbb0dc commit 0ea2bfa

File tree

6 files changed

+10
-28
lines changed

6 files changed

+10
-28
lines changed

demo/composer.json

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,6 @@
55
"license": "MIT",
66
"minimum-stability": "dev",
77
"prefer-stable": true,
8-
"repositories": [
9-
{
10-
"type": "path",
11-
"url": "../src/mcp-bundle"
12-
},
13-
{
14-
"type": "path",
15-
"url": "../src/ai-bundle"
16-
},
17-
{
18-
"type": "path",
19-
"url": "../src/mcp-sdk"
20-
}
21-
],
228
"require": {
239
"php": ">=8.4",
2410
"ext-ctype": "*",
@@ -28,7 +14,7 @@
2814
"mrmysql/youtube-transcript": "^0.0.5",
2915
"php-http/discovery": "^1.20",
3016
"runtime/frankenphp-symfony": "^0.2.0",
31-
"symfony/ai-bundle": "dev-main",
17+
"symfony/ai-bundle": "@dev",
3218
"symfony/asset": "7.3.*",
3319
"symfony/asset-mapper": "7.3.*",
3420
"symfony/clock": "7.3.*",
@@ -39,8 +25,7 @@
3925
"symfony/flex": "^2.5",
4026
"symfony/framework-bundle": "7.3.*",
4127
"symfony/http-client": "7.3.*",
42-
"symfony/mcp-sdk": "dev-main",
43-
"symfony/mcp-bundle": "dev-main",
28+
"symfony/mcp-bundle": "@dev",
4429
"symfony/monolog-bundle": "^3.10",
4530
"symfony/runtime": "7.3.*",
4631
"symfony/twig-bundle": "7.3.*",

demo/config/services.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,3 @@ services:
1818
- '../src/DependencyInjection/'
1919
- '../src/Entity/'
2020
- '../src/Kernel.php'
21-
22-
App\MCP\Tools\CurrentTimeTool:
23-
tags:
24-
- { name: 'mcp_tool' }

demo/src/MCP/Tools/CurrentTimeTool.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
use Symfony\AI\McpSdk\Capability\Tool\ToolCall;
1616
use Symfony\AI\McpSdk\Capability\Tool\ToolCallResult;
1717
use Symfony\AI\McpSdk\Capability\Tool\ToolExecutorInterface;
18+
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
1819

1920
/**
2021
* @author Tom Hart <[email protected]>
2122
*/
23+
#[AutoconfigureTag('mcp.tool')]
2224
class CurrentTimeTool implements MetadataInterface, ToolExecutorInterface
2325
{
2426
public function call(ToolCall $input): ToolCallResult

src/mcp-bundle/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ CHANGELOG
2020
* Add cache-based SSE message storage
2121
* Add service configuration for MCP server setup
2222
* Added `\Symfony\AI\McpBundle\DependencyInjection\ContainerBuilder\MCPToolChainCompilerPass`
23-
to find services tagged `mcp_tool` and register them in the MCP tool chain.
23+
to find services tagged `mcp.tool` and register them in the MCP tool chain.

src/mcp-bundle/doc/index.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ Configuration
6565
6666
To add your tools to the MCP server, add the tag:
6767

68-
.. code-block:: yaml
68+
.. code-block:: php
6969
70-
App\MCP\Tools\MyCustomTool:
71-
tags:
72-
- { name: 'mcp_tool' }
70+
#[AutoconfigureTag('mcp.tool')]
71+
class CurrentTimeTool implements MetadataInterface, ToolExecutorInterface
7372
7473
.. _`Model Context Protocol`: https://modelcontextprotocol.io/
7574
.. _`symfony/mcp-sdk`: https://github.com/symfony/mcp-sdk

src/mcp-bundle/src/DependencyInjection/ContainerBuilder/MCPToolChainCompilerPass.php renamed to src/mcp-bundle/src/DependencyInjection/ContainerBuilder/McpToolChainCompilerPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* @author Tom Hart <[email protected]>
2626
*/
27-
class MCPToolChainCompilerPass implements CompilerPassInterface
27+
final class McpToolChainCompilerPass implements CompilerPassInterface
2828
{
2929
use PriorityTaggedServiceTrait;
3030

@@ -37,7 +37,7 @@ public function process(ContainerBuilder $container): void
3737

3838
$definition = new Definition(ToolChain::class);
3939

40-
$taggedServices = $this->findAndSortTaggedServices('mcp_tool', $container);
40+
$taggedServices = $this->findAndSortTaggedServices('mcp.tool', $container);
4141

4242
$definition->setArgument(0, $taggedServices);
4343

0 commit comments

Comments
 (0)