Commit 65402c5
Migrate MCP Bundle from symfony/mcp-sdk to official mcp/sdk
- Replace symfony/mcp-sdk dependency with official mcp/sdk
- Refactor Server creation to use Server::make() builder pattern
- Convert tool definitions from interfaces to #[McpTool] attributes
- Implement automatic tool discovery in src/ directory
- Update STDIO transport command to mcp:server
- Simplify service configuration using native SDK patterns
- Remove redundant ServerFactory and routes.php files
- Add custom LogicException for bundle-specific errors
- Update all documentation (README, CHANGELOG, index.rst)
- Fix composer.json description
- Add .idea/ to .gitignore
Resolves #526
Fabbot + php-cs-fixer
DOCtor-RST
Fix RouteLoader registration to always create when transports enabled
Remove .idea
- Add autoconfiguration for #[McpTool] attribute with mcp.tool tag
- Create McpToolPass compiler pass using ServiceLocatorTagPass::register()
- Inject Service Locator into ServerBuilder via setContainer()
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
Remove symfony/mcp-sdk
Remove symfony/mcp-sdk ref in claude reamdde et phpstan
Rewrite CHANGELOG.md
Use [] === $taggedServices instead of empty($taggedServices)
Use use Symfony\Component\Routing\Exception\LogicException; instead of custom Exception
Add MCP capabilities support to Symfony bundle
This commit implements Model Context Protocol (MCP) support by adding:
- Prompts: System instructions for AI context using #[McpPrompt]
- Resources: Static data access using #[McpResource]
- Resource Templates: Dynamic resources with parameters using #[McpResourceTemplate]
Implementation includes:
- Auto-configuration for MCP attributes with proper tagging
- Compiler passes extending AbstractMcpPass for service registration
- Documentation updates with examples and usage patterns
- Demo examples showcasing each capability type
Technical details:
- Refactored auto-configuration into registerMcpAttributes() method
- Created AbstractMcpPass to eliminate code duplication
- Added proper error handling for timezone validation
- Resource Templates ready but await MCP SDK handler implementation
Apply PHP CS Fixer to demo MCP examples
- Add Symfony license headers to demo files
- Fix code style and formatting
- Add trailing commas where appropriate
Add pagination_limit and instructions configuration options
- Add pagination_limit option to control MCP list responses (default: 50)
- Add instructions option for server description to help LLMs
- Update services.php to pass both options to ServerBuilder
- Add comprehensive tests for new configuration options
- Update documentation with examples and usage
- Update demo configuration with practical examples
Both options map directly to ServerBuilder methods:
- setPaginationLimit(int)
- setInstructions(string)
Add dedicated MCP logger with configurable Monolog integration
- Create monolog.logger.mcp service with dedicated channel
- Update ServerBuilder to use MCP-specific logger instead of generic logger
- Add comprehensive logging documentation with configuration examples
- Include examples for different environments (dev/prod) and handlers (file/Slack)
- Add test coverage for MCP logger service creation and configuration
The MCP logger uses Monolog's logger prototype pattern and can be customized
by users through standard Monolog configuration in their applications.
Add EventDispatcher support and event system documentation
- Configure Symfony EventDispatcher for MCP SDK event handling
- Add comprehensive event system documentation with examples
- Add test coverage for EventDispatcher configuration
- Fix PHPStan type assertion for ChildDefinition
Migrate MCP Bundle from SSE to official StreamableHttpTransport
- Replace custom SSE implementation with MCP SDK's StreamableHttpTransport
- Change sse transport to http in configuration and code
- Simplify DependencyInjection compiler passes
- Add HTTP session management (file/memory store options)
- Update documentation and tests for HTTP transport1 parent dba7bb0 commit 65402c5
File tree
114 files changed
+822
-4156
lines changed- .phpstan
- demo
- config
- packages
- src/MCP
- Prompts
- ResourceTemplates
- Resources
- Tools
- src
- mcp-bundle
- config
- doc
- src
- Command
- Controller
- DependencyInjection
- Routing
- tests/DependencyInjection
- mcp-sdk
- .github
- workflows
- doc
- examples/cli
- src
- src
- Capability
- Prompt
- Resource
- Tool
- Exception
- Message
- Server
- NotificationHandler
- RequestHandler
- Transport
- Sse
- Store
- Stdio
- tests
- Fixtures
- Message
- Server
- RequestHandler
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
114 files changed
+822
-4156
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
4 | 10 | | |
5 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments