Skip to content

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Sep 5, 2025

Q A
Bug fix? no
New feature? yes
Docs? yes
Issues --
License MIT

Follows Symfony to Provide the Official MCP SDK

Todos

  • Remove mcp-sdk package from packagist
  • Update splitter to not split mcp-sdk anymore

@OskarStark OskarStark added the MCP Bundle Issues & PRs about the MCP SDK integration bundle label Sep 5, 2025
@OskarStark OskarStark marked this pull request as draft September 5, 2025 08:15
@carsonbot carsonbot changed the title Remove internal MCP SDK and migrate to external mcp/sdk package [MCP Bundle] Remove internal MCP SDK and migrate to external mcp/sdk package Sep 5, 2025
@OskarStark OskarStark changed the title [MCP Bundle] Remove internal MCP SDK and migrate to external mcp/sdk package [MCP Bundle] Remove internal MCP SDK Sep 5, 2025
@OskarStark OskarStark force-pushed the remove-mcp-sdk-use-external-sdk branch from 3929cf2 to 9c05fa5 Compare September 5, 2025 08:17
@@ -30,7 +30,7 @@ public function __construct(
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->server->connect(
new SymfonyConsoleTransport($input, $output)
new StdioTransport(STDIN, STDOUT)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needs to be checked, I propose to move the SymfonyConsoleTransport from the MCP SDK to our bundle and use it. Is this a solution @chr-hertel or is the change as is, fine?

@OskarStark OskarStark changed the title [MCP Bundle] Remove internal MCP SDK [MCP Bundle] Remove internal MCP SDK and use external mcp/sdk Sep 5, 2025
CLAUDE.md Outdated

### Integration Bundles
- **AI Bundle** (`src/ai-bundle/`): Symfony integration for Platform, Store, and Agent components
- **MCP Bundle** (`src/mcp-bundle/`): Symfony integration for MCP SDK
- **MCP Bundle** (`src/mcp-bundle/`): Symfony integration for external MCP SDK
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
- **MCP Bundle** (`src/mcp-bundle/`): Symfony integration for external MCP SDK
- **MCP Bundle** (`src/mcp-bundle/`): Symfony integration for official MCP SDK

CLAUDE.md Outdated
@@ -92,7 +91,7 @@ symfony server:start
Components are designed to work independently but have these relationships:
- Agent depends on Platform for AI communication
- AI Bundle integrates Platform, Agent, and Store
- MCP Bundle provides MCP SDK integration
- MCP Bundle provides external MCP SDK integration
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
- MCP Bundle provides external MCP SDK integration
- MCP Bundle provides official MCP SDK integration

README.md Outdated
* **Bundles**
* **[AI Bundle](src/ai-bundle/README.md)**: Symfony integration for AI Platform, Store and Agent components.
* **[MCP Bundle](src/mcp-bundle/README.md)**: Symfony integration for MCP SDK, allowing them to act as MCP servers or clients.
* **[MCP Bundle](src/mcp-bundle/README.md)**: Symfony integration for external [mcp/sdk](https://github.com/modelcontextprotocol/php-sdk), allowing them to act as MCP servers or clients.
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
* **[MCP Bundle](src/mcp-bundle/README.md)**: Symfony integration for external [mcp/sdk](https://github.com/modelcontextprotocol/php-sdk), allowing them to act as MCP servers or clients.
* **[MCP Bundle](src/mcp-bundle/README.md)**: Symfony integration for official [mcp/sdk](https://github.com/modelcontextprotocol/php-sdk), allowing them to act as MCP servers or clients.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, that doesn't work, does it?

Copy link
Member

Choose a reason for hiding this comment

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

is this claude? than let's remove it.

i don't think that's helpful in the repo - for the half of it that is correct we could create issues, but yea ... could do that later as well

@@ -1,7 +1,7 @@
# MCP Bundle

Symfony integration bundle for [Model Context Protocol](https://modelcontextprotocol.io/) using the Symfony AI
MCP SDK [symfony/mcp-sdk](https://github.com/symfony/mcp-sdk).
Symfony integration bundle for [Model Context Protocol](https://modelcontextprotocol.io/) using the external
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
Symfony integration bundle for [Model Context Protocol](https://modelcontextprotocol.io/) using the external
Symfony integration bundle for [Model Context Protocol](https://modelcontextprotocol.io/) using the official

Copy link
Member

Choose a reason for hiding this comment

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

oh wow, that works? :D

@OskarStark OskarStark changed the title [MCP Bundle] Remove internal MCP SDK and use external mcp/sdk [MCP Bundle] Remove internal MCP SDK and use official mcp/sdk Sep 8, 2025
- Remove src/mcp-sdk/ directory entirely
- Update MCP Bundle to use external mcp/sdk package instead of internal SDK
- Update all namespace imports from Symfony\AI\McpSdk to Mcp
- Update composer.json dependencies in MCP Bundle
- Update documentation references
- Update demo application tool to use new SDK
- Add migration notes documenting API changes and current status

The external mcp/sdk is still in development with significant API changes.
Further work is needed to fully adapt the bundle architecture to the new SDK structure.
- Create SymfonyRegistry to bridge Symfony services with new MCP Registry system
- Add McpRegistryCompilerPass to automatically register tagged tools
- Update service definitions to use new SDK architecture with Handler::make() factory
- Fix StdioTransport to use raw resources (STDIN/STDOUT) instead of Console I/O
- Update CurrentTimeTool demo to implement new ToolExecutorInterface with CallToolRequest/CallToolResult
- Update tests to reflect new architecture without separate handler services
- Remove obsolete handler interface autoconfigurations

All tests passing. The bundle now works with external mcp/sdk package.
Mark the migration as complete with all functionality working.
Document the new components and successful test status.
Add Oskar Stark as author for newly created classes instead of generic 'Assistant' placeholder.
Since we're fully migrating to external mcp/sdk, no backward compatibility is needed.
Simplify SymfonyRegistry to require ToolExecutorInterface implementation.
Add section covering:
- Potential enhancements (attribute-based discovery, docs, tests, performance)
- Additional capabilities (prompts, resources, discovery integration)
- Clear breaking changes from previous version
- Production-ready status with optional future improvements
Remove all completed migration details and only keep:
- Future improvement opportunities
- Breaking changes from previous version

The migration is complete, this now serves as a roadmap for future enhancements.
- Add discovery configuration options (enabled, directories, exclude)
- Create SymfonyRegistryFactory for configurable registry creation
- Integrate with external SDK's Discoverer for attribute-based tool discovery
- Registry now automatically discovers tools with #[McpTool] attributes
- All tests passing with new discovery functionality
- Update terminology in README.md, CLAUDE.md, and src/mcp-bundle/README.md
- Remove MIGRATION_NOTES.md as requested by @chr-hertel
- Clean up formatting in CurrentTimeTool.php
- Verified CurrentTimeTool implementation works correctly with new SDK
- Add newlines to README.md, mcp-bundle/README.md, CurrentTimeTool.php, and InvalidArgumentException.php
- Follows project coding standards requirement for file endings
@OskarStark OskarStark force-pushed the remove-mcp-sdk-use-external-sdk branch from aaa7619 to 52bc4d2 Compare September 8, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature MCP Bundle Issues & PRs about the MCP SDK integration bundle Status: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants