Skip to content

Commit da439c8

Browse files
WIP
Add compiler pass to tag tools Changelog Linted CL
1 parent 1cdd1c1 commit da439c8

File tree

7 files changed

+140
-111
lines changed

7 files changed

+140
-111
lines changed

demo/composer.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
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+
],
822
"require": {
923
"php": ">=8.4",
1024
"ext-ctype": "*",
@@ -14,7 +28,7 @@
1428
"mrmysql/youtube-transcript": "^0.0.5",
1529
"php-http/discovery": "^1.20",
1630
"runtime/frankenphp-symfony": "^0.2.0",
17-
"symfony/ai-bundle": "@dev",
31+
"symfony/ai-bundle": "dev-main",
1832
"symfony/asset": "7.3.*",
1933
"symfony/asset-mapper": "7.3.*",
2034
"symfony/clock": "7.3.*",
@@ -25,7 +39,8 @@
2539
"symfony/flex": "^2.5",
2640
"symfony/framework-bundle": "7.3.*",
2741
"symfony/http-client": "7.3.*",
28-
"symfony/mcp-bundle": "@dev",
42+
"symfony/mcp-sdk": "dev-main",
43+
"symfony/mcp-bundle": "dev-main",
2944
"symfony/monolog-bundle": "^3.10",
3045
"symfony/runtime": "7.3.*",
3146
"symfony/twig-bundle": "7.3.*",

demo/composer.lock

Lines changed: 50 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/config/services.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ services:
1919
- '../src/Entity/'
2020
- '../src/Kernel.php'
2121

22-
Symfony\AI\McpSdk\Capability\Tool\ToolExecutorInterface:
23-
class: Symfony\AI\McpSdk\Capability\ToolChain
24-
arguments:
25-
- ['@App\MCP\Tools\CurrentTimeTool']
26-
27-
Symfony\AI\McpSdk\Capability\Tool\CollectionInterface:
28-
alias: Symfony\AI\McpSdk\Capability\Tool\ToolExecutorInterface
22+
App\MCP\Tools\CurrentTimeTool:
23+
tags:
24+
- { name: 'mcp_tool' }

src/mcp-bundle/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CHANGELOG
22
=========
33

4+
45
0.1
56
---
67

@@ -17,4 +18,6 @@ CHANGELOG
1718
* Add `McpCommand` providing STDIO interface
1819
* Add bundle configuration for enabling/disabling transports
1920
* Add cache-based SSE message storage
20-
* Add service configuration for MCP server setup
21+
* Add service configuration for MCP server setup
22+
* Added `\Symfony\AI\McpBundle\DependencyInjection\ContainerBuilder\MCPToolChainCompilerPass`
23+
to find services tagged `mcp_tool` and register them in the MCP tool chain.

src/mcp-bundle/doc/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ Configuration
6363
sse:
6464
url: 'http://localhost:8000/sse' # URL to SSE endpoint of MCP server
6565
66+
To add your tools to the MCP server, add the tag:
67+
68+
.. code-block:: yaml
69+
70+
App\MCP\Tools\MyCustomTool:
71+
tags:
72+
- { name: 'mcp_tool' }
73+
6674
.. _`Model Context Protocol`: https://modelcontextprotocol.io/
6775
.. _`symfony/mcp-sdk`: https://github.com/symfony/mcp-sdk
6876
.. _`Claude Desktop`: https://claude.ai/download

0 commit comments

Comments
 (0)