From da16b7cd4d5721010eb102871ed2be3d80bdf243 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 29 May 2025 13:40:32 +0200 Subject: [PATCH 1/2] add readme and license headers --- .doctor-rst.yaml | 96 ++++++++++++++ .php-cs-fixer.dist.php | 51 +++++++- CONTRIBUTING.md | 26 ++++ README.md | 20 +++ src/mcp-sdk/README.md | 121 ++---------------- src/mcp-sdk/composer.json | 2 +- src/mcp-sdk/doc/index.rst | 32 +++++ src/mcp-sdk/examples/cli/index.php | 11 ++ src/mcp-sdk/examples/cli/src/Builder.php | 11 ++ .../examples/cli/src/ExamplePrompt.php | 13 +- .../examples/cli/src/ExampleResource.php | 11 ++ src/mcp-sdk/examples/cli/src/ExampleTool.php | 11 ++ .../Capability/Prompt/CollectionInterface.php | 11 ++ .../Capability/Prompt/IdentifierInterface.php | 11 ++ .../Capability/Prompt/MetadataInterface.php | 9 ++ .../src/Capability/Prompt/PromptGet.php | 9 ++ .../src/Capability/Prompt/PromptGetResult.php | 9 ++ .../Prompt/PromptGetResultMessages.php | 9 ++ .../Prompt/PromptGetterInterface.php | 11 ++ src/mcp-sdk/src/Capability/PromptChain.php | 11 ++ .../Resource/CollectionInterface.php | 11 ++ .../Resource/IdentifierInterface.php | 11 ++ .../Capability/Resource/MetadataInterface.php | 9 ++ .../src/Capability/Resource/ResourceRead.php | 9 ++ .../Resource/ResourceReadResult.php | 9 ++ .../Resource/ResourceReaderInterface.php | 11 ++ src/mcp-sdk/src/Capability/ResourceChain.php | 11 ++ .../Capability/Tool/CollectionInterface.php | 11 ++ .../Capability/Tool/IdentifierInterface.php | 11 ++ .../src/Capability/Tool/MetadataInterface.php | 9 ++ src/mcp-sdk/src/Capability/Tool/ToolCall.php | 9 ++ .../src/Capability/Tool/ToolCallResult.php | 9 ++ .../Tool/ToolCollectionInterface.php | 11 ++ .../Capability/Tool/ToolExecutorInterface.php | 11 ++ src/mcp-sdk/src/Capability/ToolChain.php | 11 ++ .../src/Exception/ExceptionInterface.php | 9 ++ .../Exception/NotFoundExceptionInterface.php | 9 ++ .../src/Exception/PromptGetException.php | 11 +- .../src/Exception/PromptNotFoundException.php | 11 +- .../Exception/ResourceNotFoundException.php | 11 +- .../src/Exception/ResourceReadException.php | 11 +- .../src/Exception/ToolExecutionException.php | 11 +- .../src/Exception/ToolNotFoundException.php | 11 +- src/mcp-sdk/src/Message/Error.php | 9 ++ src/mcp-sdk/src/Message/Factory.php | 11 +- src/mcp-sdk/src/Message/Notification.php | 11 +- src/mcp-sdk/src/Message/Request.php | 11 +- src/mcp-sdk/src/Message/Response.php | 9 ++ src/mcp-sdk/src/Server.php | 9 ++ src/mcp-sdk/src/Server/JsonRpcHandler.php | 19 ++- .../BaseNotificationHandler.php | 11 +- .../InitializedHandler.php | 9 ++ .../Server/NotificationHandlerInterface.php | 9 ++ .../RequestHandler/BaseRequestHandler.php | 9 ++ .../RequestHandler/InitializeHandler.php | 9 ++ .../src/Server/RequestHandler/PingHandler.php | 9 ++ .../RequestHandler/PromptGetHandler.php | 9 ++ .../RequestHandler/PromptListHandler.php | 9 ++ .../RequestHandler/ResourceListHandler.php | 9 ++ .../RequestHandler/ResourceReadHandler.php | 9 ++ .../Server/RequestHandler/ToolCallHandler.php | 9 ++ .../Server/RequestHandler/ToolListHandler.php | 9 ++ .../src/Server/RequestHandlerInterface.php | 9 ++ .../Transport/Sse/Store/CachePoolStore.php | 9 ++ .../Server/Transport/Sse/StoreInterface.php | 9 ++ .../Server/Transport/Sse/StreamTransport.php | 15 ++- .../Stdio/SymfonyConsoleTransport.php | 17 ++- src/mcp-sdk/src/Server/TransportInterface.php | 9 ++ src/mcp-sdk/tests/Message/ErrorTest.php | 9 ++ src/mcp-sdk/tests/Message/FactoryTest.php | 9 ++ src/mcp-sdk/tests/Message/ResponseTest.php | 9 ++ src/mcp-sdk/tests/ServerTest.php | 11 ++ 72 files changed, 881 insertions(+), 136 deletions(-) create mode 100644 .doctor-rst.yaml create mode 100644 CONTRIBUTING.md create mode 100644 README.md create mode 100644 src/mcp-sdk/doc/index.rst diff --git a/.doctor-rst.yaml b/.doctor-rst.yaml new file mode 100644 index 000000000..b90f9eff3 --- /dev/null +++ b/.doctor-rst.yaml @@ -0,0 +1,96 @@ +rules: + american_english: ~ + argument_variable_must_match_type: ~ + avoid_repetetive_words: ~ +# be_kind_to_newcomers: ~ + blank_line_after_anchor: ~ +# blank_line_after_colon: ~ + blank_line_after_directive: ~ +# blank_line_after_filepath_in_code_block: ~ +# blank_line_after_filepath_in_php_code_block: ~ +# blank_line_after_filepath_in_twig_code_block: ~ +# blank_line_after_filepath_in_xml_code_block: ~ +# blank_line_after_filepath_in_yaml_code_block: ~ + blank_line_before_directive: ~ +# composer_dev_option_at_the_end: ~ + composer_dev_option_not_at_the_end: ~ + correct_code_block_directive_based_on_the_content: ~ + deprecated_directive_major_version: + major_version: 2 + deprecated_directive_min_version: + min_version: '2.0' + deprecated_directive_should_have_version: ~ + ensure_bash_prompt_before_composer_command: ~ + ensure_exactly_one_space_before_directive_type: ~ + ensure_exactly_one_space_between_link_definition_and_link: ~ + ensure_link_definition_contains_valid_url: ~ + ensure_order_of_code_blocks_in_configuration_block: ~ + extend_abstract_admin: ~ + extend_abstract_controller: ~ +# extend_controller: ~ + extension_xlf_instead_of_xliff: ~ +# filename_uses_dashes_only: ~ +# filename_uses_underscores_only: ~ + final_admin_classes: ~ + final_admin_extension_classes: ~ + forbidden_directives: + directives: + - '.. index::' + indention: ~ + kernel_instead_of_app_kernel: ~ +# line_length: ~ + lowercase_as_in_use_statements: ~ + max_blank_lines: + max: 2 + max_colons: ~ + no_admin_yaml: ~ + no_app_bundle: ~ + no_app_console: ~ +# no_bash_prompt: ~ + no_blank_line_after_filepath_in_code_block: ~ + no_blank_line_after_filepath_in_php_code_block: ~ + no_blank_line_after_filepath_in_twig_code_block: ~ + no_blank_line_after_filepath_in_xml_code_block: ~ + no_blank_line_after_filepath_in_yaml_code_block: ~ + no_brackets_in_method_directive: ~ + no_composer_phar: ~ + no_composer_req: ~ + no_config_yaml: ~ +# no_contraction: ~ + no_directive_after_shorthand: ~ + no_explicit_use_of_code_block_php: ~ + no_inheritdoc_in_code_examples: ~ + no_merge_conflict: ~ + no_namespace_after_use_statements: ~ + no_php_open_tag_in_code_block_php_directive: ~ +# no_php_prefix_before_bin_console: ~ +# no_php_prefix_before_composer: ~ +# no_space_before_self_xml_closing_tag: ~ + only_backslashes_in_namespace_in_php_code_block: ~ + only_backslashes_in_use_statements_in_php_code_block: ~ + ordered_use_statements: ~ +# php_open_tag_in_code_block_php_directive: ~ + php_prefix_before_bin_console: ~ + replace_code_block_types: ~ + replacement: ~ + short_array_syntax: ~ +# space_before_self_xml_closing_tag: ~ + space_between_label_and_link_in_doc: ~ + space_between_label_and_link_in_ref: ~ + string_replacement: ~ + title_underline_length_must_match_title_length: ~ + typo: ~ + unused_links: ~ + use_deprecated_directive_instead_of_versionadded: ~ + use_https_xsd_urls: ~ +# use_named_constructor_without_new_keyword_rule: ~ + valid_inline_highlighted_namespaces: ~ + valid_use_statements: ~ + versionadded_directive_major_version: + major_version: 2 + versionadded_directive_min_version: + min_version: '2.0' + versionadded_directive_should_have_version: ~ + yaml_instead_of_yml_suffix: ~ + yarn_dev_option_at_the_end: ~ +# yarn_dev_option_not_at_the_end: ~ diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 67788bbfc..84c9bb48e 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,13 +1,54 @@ in('src') - ->exclude(['var', 'vendor']) -; +declare(strict_types=1); + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (!file_exists(__DIR__.'/src')) { + exit(0); +} + +$fileHeaderParts = [ + <<<'EOF' + This file is part of the Symfony package. + + (c) Fabien Potencier + + EOF, + <<<'EOF' + + For the full copyright and license information, please view the LICENSE + file that was distributed with this source code. + EOF, +]; return (new PhpCsFixer\Config()) + // @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777 + ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) ->setRules([ + '@PHP71Migration' => true, + '@PHPUnit75Migration:risky' => true, '@Symfony' => true, + '@Symfony:risky' => true, + 'protected_to_private' => false, + 'declare_strict_types' => true, + 'header_comment' => [ + 'header' => implode('', $fileHeaderParts), + ], ]) - ->setFinder($finder) + ->setRiskyAllowed(true) + ->setFinder( + (new PhpCsFixer\Finder()) + ->in(__DIR__.'/src') + ->append([__FILE__]) + ->notPath('#/Fixtures/#') + ) + ->setCacheFile('.php-cs-fixer.cache') ; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..7902d9aff --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +Contributing +------------ + +Symfony is an open source, community-driven project. + +If you'd like to contribute, please read the following documents: + +* [Reviewing issues/pull requests][0] +* [Reporting a Bug][1] +* [Submitting a Patch][2] +* [Symfony Core Team][3] +* [Security Issues][4] +* [Running Symfony Tests][5] +* [Our Backwards Compatibility Promise][6] +* [Coding Standards][7] +* [Conventions][8] + +[0]: https://symfony.com/doc/current/contributing/community/reviews.html +[1]: https://symfony.com/doc/current/contributing/code/bugs.html +[2]: https://symfony.com/doc/current/contributing/code/patches.html +[3]: https://symfony.com/doc/current/contributing/code/core_team.html +[4]: https://symfony.com/doc/current/contributing/code/security.html +[5]: https://symfony.com/doc/current/contributing/code/tests.html +[6]: https://symfony.com/doc/current/contributing/code/bc.html +[7]: https://symfony.com/doc/current/contributing/code/standards.html +[8]: https://symfony.com/doc/current/contributing/code/conventions.html diff --git a/README.md b/README.md new file mode 100644 index 000000000..09119044e --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +

+ Symfony Logo +

+ +

+ Symfony AI +

+ +Symfony AI is a set of packages that integrate AI capabilities into PHP applications. + +## Sponsor + +Help Symfony by [sponsoring][2] its development! + +## Contributing + +Thank you for considering contributing to Symfony AI! You can find the [contribution guide here](CONTRIBUTING.md). + +[1]: https://symfony.com/backers +[2]: https://symfony.com/sponsor diff --git a/src/mcp-sdk/README.md b/src/mcp-sdk/README.md index 21905fd97..c7637bedd 100644 --- a/src/mcp-sdk/README.md +++ b/src/mcp-sdk/README.md @@ -1,119 +1,26 @@ -# Model Context Protocol PHP SDK [WIP] +# Model Context Protocol PHP SDK Model Context Protocol SDK for Client and Server applications in PHP. -**Currently only support Tool Calls as Server via Server-Sent Events (SSE) and STDIO.** - -See [Demo App](https://github.com/php-llm/mcp-demo) for a working example and [MCP Bundle](https://github.com/php-llm/mcp-bundle) for Symfony integration. ## Installation ```bash -composer require php-llm/mcp-sdk -``` - -## Usage with Symfony - -Server integration points for are tailored to Symfony Console and HttpFoundation (Laravel compatible). - -### Console Command for STDIO Server - -```php -namespace App\Command; - -use PhpLlm\McpSdk\Server; -use PhpLlm\McpSdk\Server\Transport\Stdio\SymfonyConsoleTransport; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -#[AsCommand('mcp', 'Starts an MCP server')] -final class McpCommand extends Command -{ - public function __construct( - private readonly Server $server, - ) { - parent::__construct(); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $this->server->connect( - new SymfonyConsoleTransport($input, $output) - ); - - return Command::SUCCESS; - } -} +composer require symfony/mcp-sdk ``` -### Controller for Server-Sent Events Server +This is a low level SDK that implements the [Model Context Protocol](https://modelcontextprotocol.io/) +(MCP). The protocol is used by LLM model to build "plugins" and give them extra +context. Example the logged in users' latest order. -```php -namespace App\Controller; +**This repository is a READ-ONLY sub-tree split**. See +https://github.com/symfony/ai to create issues or submit pull requests. -use PhpLlm\McpSdk\Server; -use PhpLlm\McpSdk\Server\Transport\Sse\Store\CachePoolStore; -use PhpLlm\McpSdk\Server\Transport\Sse\StreamTransport; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\HttpKernel\Attribute\AsController; -use Symfony\Component\Routing\Attribute\Route; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Uid\Uuid; +## Resources -#[AsController] -#[Route('/mcp', name: 'mcp_')] -final readonly class McpController -{ - public function __construct( - private Server $server, - private CachePoolStore $store, - private UrlGeneratorInterface $urlGenerator, - ) { - } +- [Documentation](doc/index.rst) +- [Report issues](https://github.com/symfony/ai/issues) and + [send Pull Requests](https://github.com/symfony/ai/pulls) + in the [main Symfony AI repository](https://github.com/symfony/ai) - #[Route('/sse', name: 'sse', methods: ['GET'])] - public function sse(): StreamedResponse - { - $id = Uuid::v4(); - $endpoint = $this->urlGenerator->generate('mcp_messages', ['id' => $id], UrlGeneratorInterface::ABSOLUTE_URL); - $transport = new StreamTransport($endpoint, $this->store, $id); - - return new StreamedResponse(fn() => $this->server->connect($transport), headers: [ - 'Content-Type' => 'text/event-stream', - 'Cache-Control' => 'no-cache', - 'X-Accel-Buffering' => 'no', - ]); - } - - #[Route('/messages/{id}', name: 'messages', methods: ['POST'])] - public function messages(Request $request, Uuid $id): Response - { - $this->store->push($id, $request->getContent()); - - return new Response(); - } -} -``` - -### Exposing Tools - -Under the hood the SDK uses [LLM Chain](https://github.com/php-llm/llm-chain)'s `ToolBox` to register, analyze and -execute tools. In combination with its [Symfony Bundle](https://github.com/php-llm/llm-chain-bundle) you can expose -tools with `#[AsTool]` attribute. - -```php -use PhpLlm\LlmChain\ToolBox\Attribute\AsTool; - -#[AsTool('company_name', 'Provides the name of your company')] -final class CompanyName -{ - public function __invoke(): string - { - return 'ACME Corp.' - } -} -``` -See [LLM Chain Documentation](https://github.com/php-llm/llm-chain?tab=readme-ov-file#tools) for more information. +[1]: https://symfony.com/backers +[3]: https://symfony.com/sponsor diff --git a/src/mcp-sdk/composer.json b/src/mcp-sdk/composer.json index 8bc29e69a..f84ab438a 100644 --- a/src/mcp-sdk/composer.json +++ b/src/mcp-sdk/composer.json @@ -1,5 +1,5 @@ { - "name": "php-llm/mcp-sdk", + "name": "symfony/mcp-sdk", "type": "library", "description": "Model Context Protocol SDK for Client and Server applications in PHP", "license": "MIT", diff --git a/src/mcp-sdk/doc/index.rst b/src/mcp-sdk/doc/index.rst new file mode 100644 index 000000000..532165e82 --- /dev/null +++ b/src/mcp-sdk/doc/index.rst @@ -0,0 +1,32 @@ +Model Context Protocol SDK +========================== + +Symfony AI MCP SDK is the low level library that enables communication between +a PHP application and an LLM model. + +Installation +------------ + +Install the bundle using Composer: + +.. code-block:: terminal + + $ composer require symfony/mcp-sdk + +Usage +----- + +The `Model Context Protocol`_ is built on top of JSON-RPC. There two types of +messages. A Notification and Request. The Notification is just a status update +that something has happened. There is never a response to a Notification. A Request +is a message that expects a response. There are 3 concepts that you may request. +These are:: + +1. **Resources**: File-like data that can be read by clients (like API responses or file contents) +1. **Tools**: Functions that can be called by the LLM (with user approval) +1. **Prompts**: Pre-written templates that help users accomplish specific tasks + +The SDK comes with NotificationHandlers and RequestHandlers which are expected +to be wired up in your application. + +.. _`Model Context Protocol`: https://modelcontextprotocol.io/ diff --git a/src/mcp-sdk/examples/cli/index.php b/src/mcp-sdk/examples/cli/index.php index bf7040dab..d31a4845b 100644 --- a/src/mcp-sdk/examples/cli/index.php +++ b/src/mcp-sdk/examples/cli/index.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + require __DIR__.'/vendor/autoload.php'; use Symfony\Component\Console as SymfonyConsole; diff --git a/src/mcp-sdk/examples/cli/src/Builder.php b/src/mcp-sdk/examples/cli/src/Builder.php index 40e5a9c69..eb91d370d 100644 --- a/src/mcp-sdk/examples/cli/src/Builder.php +++ b/src/mcp-sdk/examples/cli/src/Builder.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace App; use PhpLlm\McpSdk\Capability\PromptChain; diff --git a/src/mcp-sdk/examples/cli/src/ExamplePrompt.php b/src/mcp-sdk/examples/cli/src/ExamplePrompt.php index bbe86c902..068aa1060 100644 --- a/src/mcp-sdk/examples/cli/src/ExamplePrompt.php +++ b/src/mcp-sdk/examples/cli/src/ExamplePrompt.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace App; use PhpLlm\McpSdk\Capability\Prompt\MetadataInterface; @@ -18,7 +29,7 @@ public function get(PromptGet $input): PromptGetResult $this->getDescription(), [new PromptGetResultMessages( 'user', - sprintf('Hello %s', $firstName ?? 'World') + \sprintf('Hello %s', $firstName ?? 'World') )] ); } diff --git a/src/mcp-sdk/examples/cli/src/ExampleResource.php b/src/mcp-sdk/examples/cli/src/ExampleResource.php index 9e6cdba73..e14b1797e 100644 --- a/src/mcp-sdk/examples/cli/src/ExampleResource.php +++ b/src/mcp-sdk/examples/cli/src/ExampleResource.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace App; use PhpLlm\McpSdk\Capability\Resource\MetadataInterface; diff --git a/src/mcp-sdk/examples/cli/src/ExampleTool.php b/src/mcp-sdk/examples/cli/src/ExampleTool.php index 618acb916..672d23dc1 100644 --- a/src/mcp-sdk/examples/cli/src/ExampleTool.php +++ b/src/mcp-sdk/examples/cli/src/ExampleTool.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace App; use PhpLlm\McpSdk\Capability\Tool\MetadataInterface; diff --git a/src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php b/src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php index 377585c52..e466c0553 100644 --- a/src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php +++ b/src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Prompt; interface CollectionInterface diff --git a/src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php b/src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php index 8096c178c..588999129 100644 --- a/src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php +++ b/src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Prompt; interface IdentifierInterface diff --git a/src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php b/src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php index 6dc340403..4916554af 100644 --- a/src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php +++ b/src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Prompt; interface MetadataInterface extends IdentifierInterface diff --git a/src/mcp-sdk/src/Capability/Prompt/PromptGet.php b/src/mcp-sdk/src/Capability/Prompt/PromptGet.php index 22c64f427..f87909ddc 100644 --- a/src/mcp-sdk/src/Capability/Prompt/PromptGet.php +++ b/src/mcp-sdk/src/Capability/Prompt/PromptGet.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Prompt; final readonly class PromptGet diff --git a/src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php b/src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php index 5362680d6..f14033555 100644 --- a/src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php +++ b/src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Prompt; final readonly class PromptGetResult diff --git a/src/mcp-sdk/src/Capability/Prompt/PromptGetResultMessages.php b/src/mcp-sdk/src/Capability/Prompt/PromptGetResultMessages.php index 48f85310d..f81a38ebd 100644 --- a/src/mcp-sdk/src/Capability/Prompt/PromptGetResultMessages.php +++ b/src/mcp-sdk/src/Capability/Prompt/PromptGetResultMessages.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Prompt; final readonly class PromptGetResultMessages diff --git a/src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php b/src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php index 75f2b86e4..21abb7979 100644 --- a/src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php +++ b/src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Prompt; use PhpLlm\McpSdk\Exception\PromptGetException; diff --git a/src/mcp-sdk/src/Capability/PromptChain.php b/src/mcp-sdk/src/Capability/PromptChain.php index 49f8e1d55..48513289d 100644 --- a/src/mcp-sdk/src/Capability/PromptChain.php +++ b/src/mcp-sdk/src/Capability/PromptChain.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability; use PhpLlm\McpSdk\Capability\Prompt\CollectionInterface; diff --git a/src/mcp-sdk/src/Capability/Resource/CollectionInterface.php b/src/mcp-sdk/src/Capability/Resource/CollectionInterface.php index d4a4fbed9..c36d5fabd 100644 --- a/src/mcp-sdk/src/Capability/Resource/CollectionInterface.php +++ b/src/mcp-sdk/src/Capability/Resource/CollectionInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Resource; interface CollectionInterface diff --git a/src/mcp-sdk/src/Capability/Resource/IdentifierInterface.php b/src/mcp-sdk/src/Capability/Resource/IdentifierInterface.php index e3ee06e14..d6ccbaeaf 100644 --- a/src/mcp-sdk/src/Capability/Resource/IdentifierInterface.php +++ b/src/mcp-sdk/src/Capability/Resource/IdentifierInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Resource; interface IdentifierInterface diff --git a/src/mcp-sdk/src/Capability/Resource/MetadataInterface.php b/src/mcp-sdk/src/Capability/Resource/MetadataInterface.php index 253ce8c9f..e491d8e80 100644 --- a/src/mcp-sdk/src/Capability/Resource/MetadataInterface.php +++ b/src/mcp-sdk/src/Capability/Resource/MetadataInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Resource; interface MetadataInterface extends IdentifierInterface diff --git a/src/mcp-sdk/src/Capability/Resource/ResourceRead.php b/src/mcp-sdk/src/Capability/Resource/ResourceRead.php index 6e2ed67ec..e7a6d9ca7 100644 --- a/src/mcp-sdk/src/Capability/Resource/ResourceRead.php +++ b/src/mcp-sdk/src/Capability/Resource/ResourceRead.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Resource; final readonly class ResourceRead diff --git a/src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php b/src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php index 4887ed0a6..411f155e1 100644 --- a/src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php +++ b/src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Resource; final readonly class ResourceReadResult diff --git a/src/mcp-sdk/src/Capability/Resource/ResourceReaderInterface.php b/src/mcp-sdk/src/Capability/Resource/ResourceReaderInterface.php index 3102ac886..9c74cd6f9 100644 --- a/src/mcp-sdk/src/Capability/Resource/ResourceReaderInterface.php +++ b/src/mcp-sdk/src/Capability/Resource/ResourceReaderInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Resource; use PhpLlm\McpSdk\Exception\ResourceNotFoundException; diff --git a/src/mcp-sdk/src/Capability/ResourceChain.php b/src/mcp-sdk/src/Capability/ResourceChain.php index e16d74cbb..77855fa13 100644 --- a/src/mcp-sdk/src/Capability/ResourceChain.php +++ b/src/mcp-sdk/src/Capability/ResourceChain.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability; use PhpLlm\McpSdk\Capability\Resource\CollectionInterface; diff --git a/src/mcp-sdk/src/Capability/Tool/CollectionInterface.php b/src/mcp-sdk/src/Capability/Tool/CollectionInterface.php index 2140fbf2f..19dcef9c5 100644 --- a/src/mcp-sdk/src/Capability/Tool/CollectionInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/CollectionInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Tool; interface CollectionInterface diff --git a/src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php b/src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php index 7dd5bb2b9..987ca1f85 100644 --- a/src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Tool; interface IdentifierInterface diff --git a/src/mcp-sdk/src/Capability/Tool/MetadataInterface.php b/src/mcp-sdk/src/Capability/Tool/MetadataInterface.php index 24d870d11..e6fb92ddb 100644 --- a/src/mcp-sdk/src/Capability/Tool/MetadataInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/MetadataInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Tool; interface MetadataInterface extends IdentifierInterface diff --git a/src/mcp-sdk/src/Capability/Tool/ToolCall.php b/src/mcp-sdk/src/Capability/Tool/ToolCall.php index d438dfc72..3b211078e 100644 --- a/src/mcp-sdk/src/Capability/Tool/ToolCall.php +++ b/src/mcp-sdk/src/Capability/Tool/ToolCall.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Tool; final readonly class ToolCall diff --git a/src/mcp-sdk/src/Capability/Tool/ToolCallResult.php b/src/mcp-sdk/src/Capability/Tool/ToolCallResult.php index b4b495132..2184ed81a 100644 --- a/src/mcp-sdk/src/Capability/Tool/ToolCallResult.php +++ b/src/mcp-sdk/src/Capability/Tool/ToolCallResult.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Tool; final readonly class ToolCallResult diff --git a/src/mcp-sdk/src/Capability/Tool/ToolCollectionInterface.php b/src/mcp-sdk/src/Capability/Tool/ToolCollectionInterface.php index ffb378b4a..19a8a5916 100644 --- a/src/mcp-sdk/src/Capability/Tool/ToolCollectionInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/ToolCollectionInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Tool; interface ToolCollectionInterface diff --git a/src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php b/src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php index a80c20156..ba3c3af36 100644 --- a/src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability\Tool; use PhpLlm\McpSdk\Exception\ToolExecutionException; diff --git a/src/mcp-sdk/src/Capability/ToolChain.php b/src/mcp-sdk/src/Capability/ToolChain.php index 6d3eb9ee0..2bd1310f8 100644 --- a/src/mcp-sdk/src/Capability/ToolChain.php +++ b/src/mcp-sdk/src/Capability/ToolChain.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Capability; use PhpLlm\McpSdk\Capability\Tool\CollectionInterface; diff --git a/src/mcp-sdk/src/Exception/ExceptionInterface.php b/src/mcp-sdk/src/Exception/ExceptionInterface.php index 14b84f4a8..521179717 100644 --- a/src/mcp-sdk/src/Exception/ExceptionInterface.php +++ b/src/mcp-sdk/src/Exception/ExceptionInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Exception; interface ExceptionInterface diff --git a/src/mcp-sdk/src/Exception/NotFoundExceptionInterface.php b/src/mcp-sdk/src/Exception/NotFoundExceptionInterface.php index dd0294ead..c3f9b69e3 100644 --- a/src/mcp-sdk/src/Exception/NotFoundExceptionInterface.php +++ b/src/mcp-sdk/src/Exception/NotFoundExceptionInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Exception; interface NotFoundExceptionInterface extends ExceptionInterface diff --git a/src/mcp-sdk/src/Exception/PromptGetException.php b/src/mcp-sdk/src/Exception/PromptGetException.php index 0e3f60911..b3242f866 100644 --- a/src/mcp-sdk/src/Exception/PromptGetException.php +++ b/src/mcp-sdk/src/Exception/PromptGetException.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Exception; use PhpLlm\McpSdk\Capability\Prompt\PromptGet; @@ -12,6 +21,6 @@ public function __construct( public readonly PromptGet $promptGet, ?\Throwable $previous = null, ) { - parent::__construct(sprintf('Handling prompt "%s" failed with error: %s', $promptGet->name, $previous->getMessage()), previous: $previous); + parent::__construct(\sprintf('Handling prompt "%s" failed with error: %s', $promptGet->name, $previous->getMessage()), previous: $previous); } } diff --git a/src/mcp-sdk/src/Exception/PromptNotFoundException.php b/src/mcp-sdk/src/Exception/PromptNotFoundException.php index fb163b3ca..b601029e2 100644 --- a/src/mcp-sdk/src/Exception/PromptNotFoundException.php +++ b/src/mcp-sdk/src/Exception/PromptNotFoundException.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Exception; use PhpLlm\McpSdk\Capability\Prompt\PromptGet; @@ -11,6 +20,6 @@ final class PromptNotFoundException extends \RuntimeException implements NotFoun public function __construct( public readonly PromptGet $promptGet, ) { - parent::__construct(sprintf('Resource not found for uri: "%s"', $promptGet->name)); + parent::__construct(\sprintf('Resource not found for uri: "%s"', $promptGet->name)); } } diff --git a/src/mcp-sdk/src/Exception/ResourceNotFoundException.php b/src/mcp-sdk/src/Exception/ResourceNotFoundException.php index 6cc1cd7b1..ad042921c 100644 --- a/src/mcp-sdk/src/Exception/ResourceNotFoundException.php +++ b/src/mcp-sdk/src/Exception/ResourceNotFoundException.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Exception; use PhpLlm\McpSdk\Capability\Resource\ResourceRead; @@ -11,6 +20,6 @@ final class ResourceNotFoundException extends \RuntimeException implements NotFo public function __construct( public readonly ResourceRead $readRequest, ) { - parent::__construct(sprintf('Resource not found for uri: "%s"', $readRequest->uri)); + parent::__construct(\sprintf('Resource not found for uri: "%s"', $readRequest->uri)); } } diff --git a/src/mcp-sdk/src/Exception/ResourceReadException.php b/src/mcp-sdk/src/Exception/ResourceReadException.php index 669d60a80..d986b223d 100644 --- a/src/mcp-sdk/src/Exception/ResourceReadException.php +++ b/src/mcp-sdk/src/Exception/ResourceReadException.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Exception; use PhpLlm\McpSdk\Capability\Resource\ResourceRead; @@ -12,6 +21,6 @@ public function __construct( public readonly ResourceRead $readRequest, ?\Throwable $previous = null, ) { - parent::__construct(sprintf('Reading resource "%s" failed with error: %s', $readRequest->uri, $previous?->getMessage() ?? ''), previous: $previous); + parent::__construct(\sprintf('Reading resource "%s" failed with error: %s', $readRequest->uri, $previous?->getMessage() ?? ''), previous: $previous); } } diff --git a/src/mcp-sdk/src/Exception/ToolExecutionException.php b/src/mcp-sdk/src/Exception/ToolExecutionException.php index 04c7efac1..70d65d194 100644 --- a/src/mcp-sdk/src/Exception/ToolExecutionException.php +++ b/src/mcp-sdk/src/Exception/ToolExecutionException.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Exception; use PhpLlm\McpSdk\Capability\Tool\ToolCall; @@ -12,6 +21,6 @@ public function __construct( public readonly ToolCall $toolCall, ?\Throwable $previous = null, ) { - parent::__construct(sprintf('Execution of tool "%s" failed with error: %s', $toolCall->name, $previous?->getMessage() ?? ''), previous: $previous); + parent::__construct(\sprintf('Execution of tool "%s" failed with error: %s', $toolCall->name, $previous?->getMessage() ?? ''), previous: $previous); } } diff --git a/src/mcp-sdk/src/Exception/ToolNotFoundException.php b/src/mcp-sdk/src/Exception/ToolNotFoundException.php index e8118cf51..0066cffc6 100644 --- a/src/mcp-sdk/src/Exception/ToolNotFoundException.php +++ b/src/mcp-sdk/src/Exception/ToolNotFoundException.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Exception; use PhpLlm\McpSdk\Capability\Tool\ToolCall; @@ -11,6 +20,6 @@ final class ToolNotFoundException extends \RuntimeException implements NotFoundE public function __construct( public readonly ToolCall $toolCall, ) { - parent::__construct(sprintf('Tool not found for call: "%s"', $toolCall->name)); + parent::__construct(\sprintf('Tool not found for call: "%s"', $toolCall->name)); } } diff --git a/src/mcp-sdk/src/Message/Error.php b/src/mcp-sdk/src/Message/Error.php index 294ecd5c6..e07ab20cf 100644 --- a/src/mcp-sdk/src/Message/Error.php +++ b/src/mcp-sdk/src/Message/Error.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Message; final readonly class Error implements \JsonSerializable diff --git a/src/mcp-sdk/src/Message/Factory.php b/src/mcp-sdk/src/Message/Factory.php index baf683e45..d2f73892b 100644 --- a/src/mcp-sdk/src/Message/Factory.php +++ b/src/mcp-sdk/src/Message/Factory.php @@ -2,13 +2,22 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Message; final class Factory { public function create(string $json): Request|Notification { - $data = json_decode($json, true, flags: JSON_THROW_ON_ERROR); + $data = json_decode($json, true, flags: \JSON_THROW_ON_ERROR); if (!isset($data['method'])) { throw new \InvalidArgumentException('Invalid JSON-RPC request, missing method'); diff --git a/src/mcp-sdk/src/Message/Notification.php b/src/mcp-sdk/src/Message/Notification.php index 74f9c3d5d..a32f497c3 100644 --- a/src/mcp-sdk/src/Message/Notification.php +++ b/src/mcp-sdk/src/Message/Notification.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Message; final readonly class Notification implements \JsonSerializable, \Stringable @@ -40,6 +49,6 @@ public function jsonSerialize(): array public function __toString(): string { - return sprintf('%s', $this->method); + return \sprintf('%s', $this->method); } } diff --git a/src/mcp-sdk/src/Message/Request.php b/src/mcp-sdk/src/Message/Request.php index 97bd1399d..95ced59d5 100644 --- a/src/mcp-sdk/src/Message/Request.php +++ b/src/mcp-sdk/src/Message/Request.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Message; final class Request implements \JsonSerializable, \Stringable @@ -43,6 +52,6 @@ public function jsonSerialize(): array public function __toString(): string { - return sprintf('%s: %s', $this->id, $this->method); + return \sprintf('%s: %s', $this->id, $this->method); } } diff --git a/src/mcp-sdk/src/Message/Response.php b/src/mcp-sdk/src/Message/Response.php index caccb4873..c0361d25b 100644 --- a/src/mcp-sdk/src/Message/Response.php +++ b/src/mcp-sdk/src/Message/Response.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Message; final readonly class Response implements \JsonSerializable diff --git a/src/mcp-sdk/src/Server.php b/src/mcp-sdk/src/Server.php index d6eb39f2c..566534088 100644 --- a/src/mcp-sdk/src/Server.php +++ b/src/mcp-sdk/src/Server.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk; use PhpLlm\McpSdk\Server\JsonRpcHandler; diff --git a/src/mcp-sdk/src/Server/JsonRpcHandler.php b/src/mcp-sdk/src/Server/JsonRpcHandler.php index 825688768..c0205ed54 100644 --- a/src/mcp-sdk/src/Server/JsonRpcHandler.php +++ b/src/mcp-sdk/src/Server/JsonRpcHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server; use PhpLlm\McpSdk\Message\Error; @@ -68,7 +77,7 @@ public function process(string $message): ?string } catch (\DomainException) { return null; } catch (\InvalidArgumentException $e) { - $this->logger->warning(sprintf('Failed to create response: %s', $e->getMessage()), ['exception' => $e]); + $this->logger->warning(\sprintf('Failed to create response: %s', $e->getMessage()), ['exception' => $e]); return $this->encodeResponse(Error::methodNotFound($message->id ?? 0, $e->getMessage())); } @@ -85,10 +94,10 @@ private function encodeResponse(Response|Error|null $response): ?string $this->logger->info('Encoding response', ['response' => $response]); if ($response instanceof Response && [] === $response->result) { - return json_encode($response, JSON_THROW_ON_ERROR | JSON_FORCE_OBJECT); + return json_encode($response, \JSON_THROW_ON_ERROR | \JSON_FORCE_OBJECT); } - return json_encode($response, JSON_THROW_ON_ERROR); + return json_encode($response, \JSON_THROW_ON_ERROR); } private function handleNotification(Notification $notification): null @@ -99,7 +108,7 @@ private function handleNotification(Notification $notification): null } } - $this->logger->warning(sprintf('No handler found for "%s".', $notification->method), ['notification' => $notification]); + $this->logger->warning(\sprintf('No handler found for "%s".', $notification->method), ['notification' => $notification]); return null; } @@ -112,6 +121,6 @@ private function handleRequest(Request $request): Response|Error } } - throw new \InvalidArgumentException(sprintf('No handler found for method "%s".', $request->method)); + throw new \InvalidArgumentException(\sprintf('No handler found for method "%s".', $request->method)); } } diff --git a/src/mcp-sdk/src/Server/NotificationHandler/BaseNotificationHandler.php b/src/mcp-sdk/src/Server/NotificationHandler/BaseNotificationHandler.php index 96d09cc04..c1bd4b031 100644 --- a/src/mcp-sdk/src/Server/NotificationHandler/BaseNotificationHandler.php +++ b/src/mcp-sdk/src/Server/NotificationHandler/BaseNotificationHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\NotificationHandler; use PhpLlm\McpSdk\Message\Notification; @@ -11,7 +20,7 @@ abstract class BaseNotificationHandler implements NotificationHandlerInterface { public function supports(Notification $message): bool { - return $message->method === sprintf('notifications/%s', $this->supportedNotification()); + return $message->method === \sprintf('notifications/%s', $this->supportedNotification()); } abstract protected function supportedNotification(): string; diff --git a/src/mcp-sdk/src/Server/NotificationHandler/InitializedHandler.php b/src/mcp-sdk/src/Server/NotificationHandler/InitializedHandler.php index afa5da189..ec214da1c 100644 --- a/src/mcp-sdk/src/Server/NotificationHandler/InitializedHandler.php +++ b/src/mcp-sdk/src/Server/NotificationHandler/InitializedHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\NotificationHandler; use PhpLlm\McpSdk\Message\Notification; diff --git a/src/mcp-sdk/src/Server/NotificationHandlerInterface.php b/src/mcp-sdk/src/Server/NotificationHandlerInterface.php index d2d71d3e8..110c3c9c0 100644 --- a/src/mcp-sdk/src/Server/NotificationHandlerInterface.php +++ b/src/mcp-sdk/src/Server/NotificationHandlerInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server; use PhpLlm\McpSdk\Message\Notification; diff --git a/src/mcp-sdk/src/Server/RequestHandler/BaseRequestHandler.php b/src/mcp-sdk/src/Server/RequestHandler/BaseRequestHandler.php index d7aad40f6..6c2ef33a1 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/BaseRequestHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/BaseRequestHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Message\Request; diff --git a/src/mcp-sdk/src/Server/RequestHandler/InitializeHandler.php b/src/mcp-sdk/src/Server/RequestHandler/InitializeHandler.php index 4740d6dc8..a90ab0e74 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/InitializeHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/InitializeHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Message\Request; diff --git a/src/mcp-sdk/src/Server/RequestHandler/PingHandler.php b/src/mcp-sdk/src/Server/RequestHandler/PingHandler.php index e29874031..ccad4b7d3 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/PingHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/PingHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Message\Request; diff --git a/src/mcp-sdk/src/Server/RequestHandler/PromptGetHandler.php b/src/mcp-sdk/src/Server/RequestHandler/PromptGetHandler.php index a956e25b9..e3f86b54c 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/PromptGetHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/PromptGetHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Capability\Prompt\PromptGet; diff --git a/src/mcp-sdk/src/Server/RequestHandler/PromptListHandler.php b/src/mcp-sdk/src/Server/RequestHandler/PromptListHandler.php index 86799a53c..a43bca102 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/PromptListHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/PromptListHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Capability\Prompt\CollectionInterface; diff --git a/src/mcp-sdk/src/Server/RequestHandler/ResourceListHandler.php b/src/mcp-sdk/src/Server/RequestHandler/ResourceListHandler.php index dd8aed06f..3f8a303fc 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/ResourceListHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/ResourceListHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Capability\Resource\CollectionInterface; diff --git a/src/mcp-sdk/src/Server/RequestHandler/ResourceReadHandler.php b/src/mcp-sdk/src/Server/RequestHandler/ResourceReadHandler.php index b02740ddd..d66d87120 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/ResourceReadHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/ResourceReadHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Capability\Resource\ResourceRead; diff --git a/src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php b/src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php index 4cab6e104..58e3655a5 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Capability\Tool\ToolCall; diff --git a/src/mcp-sdk/src/Server/RequestHandler/ToolListHandler.php b/src/mcp-sdk/src/Server/RequestHandler/ToolListHandler.php index fd4f717ef..7ce8d2e91 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/ToolListHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/ToolListHandler.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\RequestHandler; use PhpLlm\McpSdk\Capability\Tool\CollectionInterface; diff --git a/src/mcp-sdk/src/Server/RequestHandlerInterface.php b/src/mcp-sdk/src/Server/RequestHandlerInterface.php index 80fe78335..4cb3c51c0 100644 --- a/src/mcp-sdk/src/Server/RequestHandlerInterface.php +++ b/src/mcp-sdk/src/Server/RequestHandlerInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server; use PhpLlm\McpSdk\Message\Error; diff --git a/src/mcp-sdk/src/Server/Transport/Sse/Store/CachePoolStore.php b/src/mcp-sdk/src/Server/Transport/Sse/Store/CachePoolStore.php index d7683050c..c9000e6c5 100644 --- a/src/mcp-sdk/src/Server/Transport/Sse/Store/CachePoolStore.php +++ b/src/mcp-sdk/src/Server/Transport/Sse/Store/CachePoolStore.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\Transport\Sse\Store; use PhpLlm\McpSdk\Server\Transport\Sse\StoreInterface; diff --git a/src/mcp-sdk/src/Server/Transport/Sse/StoreInterface.php b/src/mcp-sdk/src/Server/Transport/Sse/StoreInterface.php index f6517e06b..98d30f7c0 100644 --- a/src/mcp-sdk/src/Server/Transport/Sse/StoreInterface.php +++ b/src/mcp-sdk/src/Server/Transport/Sse/StoreInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\Transport\Sse; use Symfony\Component\Uid\Uuid; diff --git a/src/mcp-sdk/src/Server/Transport/Sse/StreamTransport.php b/src/mcp-sdk/src/Server/Transport/Sse/StreamTransport.php index 7b6d7999c..8259f7886 100644 --- a/src/mcp-sdk/src/Server/Transport/Sse/StreamTransport.php +++ b/src/mcp-sdk/src/Server/Transport/Sse/StreamTransport.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\Transport\Sse; use PhpLlm\McpSdk\Server\TransportInterface; @@ -44,9 +53,9 @@ public function close(): void private function flushEvent(string $event, string $data): void { - echo sprintf('event: %s', $event).PHP_EOL; - echo sprintf('data: %s', $data).PHP_EOL; - echo PHP_EOL; + echo \sprintf('event: %s', $event).\PHP_EOL; + echo \sprintf('data: %s', $data).\PHP_EOL; + echo \PHP_EOL; if (false !== ob_get_length()) { ob_flush(); } diff --git a/src/mcp-sdk/src/Server/Transport/Stdio/SymfonyConsoleTransport.php b/src/mcp-sdk/src/Server/Transport/Stdio/SymfonyConsoleTransport.php index 778b2a840..00419bdcb 100644 --- a/src/mcp-sdk/src/Server/Transport/Stdio/SymfonyConsoleTransport.php +++ b/src/mcp-sdk/src/Server/Transport/Stdio/SymfonyConsoleTransport.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server\Transport\Stdio; use PhpLlm\McpSdk\Server\TransportInterface; @@ -33,14 +42,14 @@ public function isConnected(): bool public function receive(): \Generator { - $stream = $this->input instanceof StreamableInputInterface ? $this->input->getStream() ?? STDIN : STDIN; + $stream = $this->input instanceof StreamableInputInterface ? $this->input->getStream() ?? \STDIN : \STDIN; $line = fgets($stream); if (false === $line) { return; } - $this->buffer .= STDIN === $stream ? rtrim($line).PHP_EOL : $line; - if (str_contains($this->buffer, PHP_EOL)) { - $lines = explode(PHP_EOL, $this->buffer); + $this->buffer .= \STDIN === $stream ? rtrim($line).\PHP_EOL : $line; + if (str_contains($this->buffer, \PHP_EOL)) { + $lines = explode(\PHP_EOL, $this->buffer); $this->buffer = array_pop($lines); yield from $lines; diff --git a/src/mcp-sdk/src/Server/TransportInterface.php b/src/mcp-sdk/src/Server/TransportInterface.php index 6dd8b867c..c416a9248 100644 --- a/src/mcp-sdk/src/Server/TransportInterface.php +++ b/src/mcp-sdk/src/Server/TransportInterface.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Server; interface TransportInterface diff --git a/src/mcp-sdk/tests/Message/ErrorTest.php b/src/mcp-sdk/tests/Message/ErrorTest.php index 23745b533..c142f1e06 100644 --- a/src/mcp-sdk/tests/Message/ErrorTest.php +++ b/src/mcp-sdk/tests/Message/ErrorTest.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Tests\Message; use PhpLlm\McpSdk\Message\Error; diff --git a/src/mcp-sdk/tests/Message/FactoryTest.php b/src/mcp-sdk/tests/Message/FactoryTest.php index 8a7c632e7..d51370585 100644 --- a/src/mcp-sdk/tests/Message/FactoryTest.php +++ b/src/mcp-sdk/tests/Message/FactoryTest.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Tests\Message; use PhpLlm\McpSdk\Message\Factory; diff --git a/src/mcp-sdk/tests/Message/ResponseTest.php b/src/mcp-sdk/tests/Message/ResponseTest.php index b35e2b172..326411e21 100644 --- a/src/mcp-sdk/tests/Message/ResponseTest.php +++ b/src/mcp-sdk/tests/Message/ResponseTest.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Tests\Message; use PhpLlm\McpSdk\Message\Response; diff --git a/src/mcp-sdk/tests/ServerTest.php b/src/mcp-sdk/tests/ServerTest.php index d211410ec..a35fd1cab 100644 --- a/src/mcp-sdk/tests/ServerTest.php +++ b/src/mcp-sdk/tests/ServerTest.php @@ -1,5 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace PhpLlm\McpSdk\Tests; use PhpLlm\McpSdk\Server; From 726ef9aba45a60ef0a2c63e8692c9eb28e5a5423 Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Thu, 29 May 2025 15:09:25 +0200 Subject: [PATCH 2/2] refactor: switch to Symfony AI namespace --- composer.json | 3 +- src/mcp-sdk/composer.json | 4 +-- src/mcp-sdk/examples/cli/index.php | 8 +++--- src/mcp-sdk/examples/cli/src/Builder.php | 28 +++++++++---------- .../examples/cli/src/ExamplePrompt.php | 10 +++---- .../examples/cli/src/ExampleResource.php | 8 +++--- src/mcp-sdk/examples/cli/src/ExampleTool.php | 8 +++--- .../Capability/Prompt/CollectionInterface.php | 2 +- .../Capability/Prompt/IdentifierInterface.php | 2 +- .../Capability/Prompt/MetadataInterface.php | 2 +- .../src/Capability/Prompt/PromptGet.php | 2 +- .../src/Capability/Prompt/PromptGetResult.php | 2 +- .../Prompt/PromptGetResultMessages.php | 2 +- .../Prompt/PromptGetterInterface.php | 6 ++-- src/mcp-sdk/src/Capability/PromptChain.php | 20 ++++++------- .../Resource/CollectionInterface.php | 2 +- .../Resource/IdentifierInterface.php | 2 +- .../Capability/Resource/MetadataInterface.php | 2 +- .../src/Capability/Resource/ResourceRead.php | 2 +- .../Resource/ResourceReadResult.php | 2 +- .../Resource/ResourceReaderInterface.php | 6 ++-- src/mcp-sdk/src/Capability/ResourceChain.php | 20 ++++++------- .../Capability/Tool/CollectionInterface.php | 2 +- .../Capability/Tool/IdentifierInterface.php | 2 +- .../src/Capability/Tool/MetadataInterface.php | 2 +- src/mcp-sdk/src/Capability/Tool/ToolCall.php | 2 +- .../src/Capability/Tool/ToolCallResult.php | 2 +- .../Tool/ToolCollectionInterface.php | 2 +- .../Capability/Tool/ToolExecutorInterface.php | 6 ++-- src/mcp-sdk/src/Capability/ToolChain.php | 20 ++++++------- .../src/Exception/ExceptionInterface.php | 2 +- .../Exception/NotFoundExceptionInterface.php | 2 +- .../src/Exception/PromptGetException.php | 4 +-- .../src/Exception/PromptNotFoundException.php | 4 +-- .../Exception/ResourceNotFoundException.php | 4 +-- .../src/Exception/ResourceReadException.php | 4 +-- .../src/Exception/ToolExecutionException.php | 4 +-- .../src/Exception/ToolNotFoundException.php | 4 +-- src/mcp-sdk/src/Message/Error.php | 2 +- src/mcp-sdk/src/Message/Factory.php | 2 +- src/mcp-sdk/src/Message/Notification.php | 2 +- src/mcp-sdk/src/Message/Request.php | 2 +- src/mcp-sdk/src/Message/Response.php | 2 +- src/mcp-sdk/src/Server.php | 6 ++-- src/mcp-sdk/src/Server/JsonRpcHandler.php | 12 ++++---- .../BaseNotificationHandler.php | 6 ++-- .../InitializedHandler.php | 4 +-- .../Server/NotificationHandlerInterface.php | 4 +-- .../RequestHandler/BaseRequestHandler.php | 6 ++-- .../RequestHandler/InitializeHandler.php | 6 ++-- .../src/Server/RequestHandler/PingHandler.php | 6 ++-- .../RequestHandler/PromptGetHandler.php | 14 +++++----- .../RequestHandler/PromptListHandler.php | 12 ++++---- .../RequestHandler/ResourceListHandler.php | 12 ++++---- .../RequestHandler/ResourceReadHandler.php | 16 +++++------ .../Server/RequestHandler/ToolCallHandler.php | 14 +++++----- .../Server/RequestHandler/ToolListHandler.php | 10 +++---- .../src/Server/RequestHandlerInterface.php | 8 +++--- .../Transport/Sse/Store/CachePoolStore.php | 4 +-- .../Server/Transport/Sse/StoreInterface.php | 2 +- .../Server/Transport/Sse/StreamTransport.php | 4 +-- .../Stdio/SymfonyConsoleTransport.php | 4 +-- src/mcp-sdk/src/Server/TransportInterface.php | 2 +- .../tests/Fixtures/InMemoryTransport.php | 15 ++++++++-- src/mcp-sdk/tests/Message/ErrorTest.php | 4 +-- src/mcp-sdk/tests/Message/FactoryTest.php | 8 +++--- src/mcp-sdk/tests/Message/ResponseTest.php | 4 +-- src/mcp-sdk/tests/ServerTest.php | 8 +++--- 68 files changed, 211 insertions(+), 199 deletions(-) diff --git a/composer.json b/composer.json index c2924e22c..0024d3c17 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "require-dev": { "php": ">=8.1", "symfony/filesystem": "^6.4|^7.0", - "symfony/finder": "^6.4|^7.0" + "symfony/finder": "^6.4|^7.0", + "php-cs-fixer/shim": "^3.75" } } diff --git a/src/mcp-sdk/composer.json b/src/mcp-sdk/composer.json index f84ab438a..3cfeb4898 100644 --- a/src/mcp-sdk/composer.json +++ b/src/mcp-sdk/composer.json @@ -31,12 +31,12 @@ }, "autoload": { "psr-4": { - "PhpLlm\\McpSdk\\": "src/" + "Symfony\\AI\\McpSdk\\": "src/" } }, "autoload-dev": { "psr-4": { - "PhpLlm\\McpSdk\\Tests\\": "tests/" + "Symfony\\AI\\McpSdk\\Tests\\": "tests/" } } } diff --git a/src/mcp-sdk/examples/cli/index.php b/src/mcp-sdk/examples/cli/index.php index d31a4845b..ca90b7b65 100644 --- a/src/mcp-sdk/examples/cli/index.php +++ b/src/mcp-sdk/examples/cli/index.php @@ -24,18 +24,18 @@ $logger = new SymfonyConsole\Logger\ConsoleLogger($output); // Configure the JsonRpcHandler and build the functionality -$jsonRpcHandler = new PhpLlm\McpSdk\Server\JsonRpcHandler( - new PhpLlm\McpSdk\Message\Factory(), +$jsonRpcHandler = new Symfony\AI\McpSdk\Server\JsonRpcHandler( + new Symfony\AI\McpSdk\Message\Factory(), App\Builder::buildRequestHandlers(), App\Builder::buildNotificationHandlers(), $logger ); // Set up the server -$sever = new PhpLlm\McpSdk\Server($jsonRpcHandler, $logger); +$sever = new Symfony\AI\McpSdk\Server($jsonRpcHandler, $logger); // Create the transport layer using Symfony Console -$transport = new PhpLlm\McpSdk\Server\Transport\Stdio\SymfonyConsoleTransport($input, $output); +$transport = new Symfony\AI\McpSdk\Server\Transport\Stdio\SymfonyConsoleTransport($input, $output); // Start our application $sever->connect($transport); diff --git a/src/mcp-sdk/examples/cli/src/Builder.php b/src/mcp-sdk/examples/cli/src/Builder.php index eb91d370d..bb4ccafad 100644 --- a/src/mcp-sdk/examples/cli/src/Builder.php +++ b/src/mcp-sdk/examples/cli/src/Builder.php @@ -13,20 +13,20 @@ namespace App; -use PhpLlm\McpSdk\Capability\PromptChain; -use PhpLlm\McpSdk\Capability\ResourceChain; -use PhpLlm\McpSdk\Capability\ToolChain; -use PhpLlm\McpSdk\Server\NotificationHandler\InitializedHandler; -use PhpLlm\McpSdk\Server\NotificationHandlerInterface; -use PhpLlm\McpSdk\Server\RequestHandler\InitializeHandler; -use PhpLlm\McpSdk\Server\RequestHandler\PingHandler; -use PhpLlm\McpSdk\Server\RequestHandler\PromptGetHandler; -use PhpLlm\McpSdk\Server\RequestHandler\PromptListHandler; -use PhpLlm\McpSdk\Server\RequestHandler\ResourceListHandler; -use PhpLlm\McpSdk\Server\RequestHandler\ResourceReadHandler; -use PhpLlm\McpSdk\Server\RequestHandler\ToolCallHandler; -use PhpLlm\McpSdk\Server\RequestHandler\ToolListHandler; -use PhpLlm\McpSdk\Server\RequestHandlerInterface; +use Symfony\AI\McpSdk\Capability\PromptChain; +use Symfony\AI\McpSdk\Capability\ResourceChain; +use Symfony\AI\McpSdk\Capability\ToolChain; +use Symfony\AI\McpSdk\Server\NotificationHandler\InitializedHandler; +use Symfony\AI\McpSdk\Server\NotificationHandlerInterface; +use Symfony\AI\McpSdk\Server\RequestHandler\InitializeHandler; +use Symfony\AI\McpSdk\Server\RequestHandler\PingHandler; +use Symfony\AI\McpSdk\Server\RequestHandler\PromptGetHandler; +use Symfony\AI\McpSdk\Server\RequestHandler\PromptListHandler; +use Symfony\AI\McpSdk\Server\RequestHandler\ResourceListHandler; +use Symfony\AI\McpSdk\Server\RequestHandler\ResourceReadHandler; +use Symfony\AI\McpSdk\Server\RequestHandler\ToolCallHandler; +use Symfony\AI\McpSdk\Server\RequestHandler\ToolListHandler; +use Symfony\AI\McpSdk\Server\RequestHandlerInterface; class Builder { diff --git a/src/mcp-sdk/examples/cli/src/ExamplePrompt.php b/src/mcp-sdk/examples/cli/src/ExamplePrompt.php index 068aa1060..c247398e0 100644 --- a/src/mcp-sdk/examples/cli/src/ExamplePrompt.php +++ b/src/mcp-sdk/examples/cli/src/ExamplePrompt.php @@ -13,11 +13,11 @@ namespace App; -use PhpLlm\McpSdk\Capability\Prompt\MetadataInterface; -use PhpLlm\McpSdk\Capability\Prompt\PromptGet; -use PhpLlm\McpSdk\Capability\Prompt\PromptGetResult; -use PhpLlm\McpSdk\Capability\Prompt\PromptGetResultMessages; -use PhpLlm\McpSdk\Capability\Prompt\PromptGetterInterface; +use Symfony\AI\McpSdk\Capability\Prompt\MetadataInterface; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGet; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGetResult; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGetResultMessages; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGetterInterface; class ExamplePrompt implements MetadataInterface, PromptGetterInterface { diff --git a/src/mcp-sdk/examples/cli/src/ExampleResource.php b/src/mcp-sdk/examples/cli/src/ExampleResource.php index e14b1797e..b264d26cc 100644 --- a/src/mcp-sdk/examples/cli/src/ExampleResource.php +++ b/src/mcp-sdk/examples/cli/src/ExampleResource.php @@ -13,10 +13,10 @@ namespace App; -use PhpLlm\McpSdk\Capability\Resource\MetadataInterface; -use PhpLlm\McpSdk\Capability\Resource\ResourceRead; -use PhpLlm\McpSdk\Capability\Resource\ResourceReaderInterface; -use PhpLlm\McpSdk\Capability\Resource\ResourceReadResult; +use Symfony\AI\McpSdk\Capability\Resource\MetadataInterface; +use Symfony\AI\McpSdk\Capability\Resource\ResourceRead; +use Symfony\AI\McpSdk\Capability\Resource\ResourceReaderInterface; +use Symfony\AI\McpSdk\Capability\Resource\ResourceReadResult; class ExampleResource implements MetadataInterface, ResourceReaderInterface { diff --git a/src/mcp-sdk/examples/cli/src/ExampleTool.php b/src/mcp-sdk/examples/cli/src/ExampleTool.php index 672d23dc1..e459b019e 100644 --- a/src/mcp-sdk/examples/cli/src/ExampleTool.php +++ b/src/mcp-sdk/examples/cli/src/ExampleTool.php @@ -13,10 +13,10 @@ namespace App; -use PhpLlm\McpSdk\Capability\Tool\MetadataInterface; -use PhpLlm\McpSdk\Capability\Tool\ToolCall; -use PhpLlm\McpSdk\Capability\Tool\ToolCallResult; -use PhpLlm\McpSdk\Capability\Tool\ToolExecutorInterface; +use Symfony\AI\McpSdk\Capability\Tool\MetadataInterface; +use Symfony\AI\McpSdk\Capability\Tool\ToolCall; +use Symfony\AI\McpSdk\Capability\Tool\ToolCallResult; +use Symfony\AI\McpSdk\Capability\Tool\ToolExecutorInterface; class ExampleTool implements MetadataInterface, ToolExecutorInterface { diff --git a/src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php b/src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php index e466c0553..71df2162f 100644 --- a/src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php +++ b/src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Prompt; +namespace Symfony\AI\McpSdk\Capability\Prompt; interface CollectionInterface { diff --git a/src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php b/src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php index 588999129..4b7fa035d 100644 --- a/src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php +++ b/src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Prompt; +namespace Symfony\AI\McpSdk\Capability\Prompt; interface IdentifierInterface { diff --git a/src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php b/src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php index 4916554af..9e262067e 100644 --- a/src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php +++ b/src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Prompt; +namespace Symfony\AI\McpSdk\Capability\Prompt; interface MetadataInterface extends IdentifierInterface { diff --git a/src/mcp-sdk/src/Capability/Prompt/PromptGet.php b/src/mcp-sdk/src/Capability/Prompt/PromptGet.php index f87909ddc..e729eaa92 100644 --- a/src/mcp-sdk/src/Capability/Prompt/PromptGet.php +++ b/src/mcp-sdk/src/Capability/Prompt/PromptGet.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Prompt; +namespace Symfony\AI\McpSdk\Capability\Prompt; final readonly class PromptGet { diff --git a/src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php b/src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php index f14033555..a998627b8 100644 --- a/src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php +++ b/src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Prompt; +namespace Symfony\AI\McpSdk\Capability\Prompt; final readonly class PromptGetResult { diff --git a/src/mcp-sdk/src/Capability/Prompt/PromptGetResultMessages.php b/src/mcp-sdk/src/Capability/Prompt/PromptGetResultMessages.php index f81a38ebd..7c3a69d32 100644 --- a/src/mcp-sdk/src/Capability/Prompt/PromptGetResultMessages.php +++ b/src/mcp-sdk/src/Capability/Prompt/PromptGetResultMessages.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Prompt; +namespace Symfony\AI\McpSdk\Capability\Prompt; final readonly class PromptGetResultMessages { diff --git a/src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php b/src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php index 21abb7979..d877bd2d9 100644 --- a/src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php +++ b/src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Prompt; +namespace Symfony\AI\McpSdk\Capability\Prompt; -use PhpLlm\McpSdk\Exception\PromptGetException; -use PhpLlm\McpSdk\Exception\PromptNotFoundException; +use Symfony\AI\McpSdk\Exception\PromptGetException; +use Symfony\AI\McpSdk\Exception\PromptNotFoundException; interface PromptGetterInterface { diff --git a/src/mcp-sdk/src/Capability/PromptChain.php b/src/mcp-sdk/src/Capability/PromptChain.php index 48513289d..761c8ce11 100644 --- a/src/mcp-sdk/src/Capability/PromptChain.php +++ b/src/mcp-sdk/src/Capability/PromptChain.php @@ -11,16 +11,16 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability; - -use PhpLlm\McpSdk\Capability\Prompt\CollectionInterface; -use PhpLlm\McpSdk\Capability\Prompt\IdentifierInterface; -use PhpLlm\McpSdk\Capability\Prompt\MetadataInterface; -use PhpLlm\McpSdk\Capability\Prompt\PromptGet; -use PhpLlm\McpSdk\Capability\Prompt\PromptGetResult; -use PhpLlm\McpSdk\Capability\Prompt\PromptGetterInterface; -use PhpLlm\McpSdk\Exception\PromptGetException; -use PhpLlm\McpSdk\Exception\PromptNotFoundException; +namespace Symfony\AI\McpSdk\Capability; + +use Symfony\AI\McpSdk\Capability\Prompt\CollectionInterface; +use Symfony\AI\McpSdk\Capability\Prompt\IdentifierInterface; +use Symfony\AI\McpSdk\Capability\Prompt\MetadataInterface; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGet; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGetResult; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGetterInterface; +use Symfony\AI\McpSdk\Exception\PromptGetException; +use Symfony\AI\McpSdk\Exception\PromptNotFoundException; /** * A collection of prompts. All prompts need to implement IdentifierInterface. diff --git a/src/mcp-sdk/src/Capability/Resource/CollectionInterface.php b/src/mcp-sdk/src/Capability/Resource/CollectionInterface.php index c36d5fabd..b8bc12418 100644 --- a/src/mcp-sdk/src/Capability/Resource/CollectionInterface.php +++ b/src/mcp-sdk/src/Capability/Resource/CollectionInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Resource; +namespace Symfony\AI\McpSdk\Capability\Resource; interface CollectionInterface { diff --git a/src/mcp-sdk/src/Capability/Resource/IdentifierInterface.php b/src/mcp-sdk/src/Capability/Resource/IdentifierInterface.php index d6ccbaeaf..3ee5b93e4 100644 --- a/src/mcp-sdk/src/Capability/Resource/IdentifierInterface.php +++ b/src/mcp-sdk/src/Capability/Resource/IdentifierInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Resource; +namespace Symfony\AI\McpSdk\Capability\Resource; interface IdentifierInterface { diff --git a/src/mcp-sdk/src/Capability/Resource/MetadataInterface.php b/src/mcp-sdk/src/Capability/Resource/MetadataInterface.php index e491d8e80..dafabdbc4 100644 --- a/src/mcp-sdk/src/Capability/Resource/MetadataInterface.php +++ b/src/mcp-sdk/src/Capability/Resource/MetadataInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Resource; +namespace Symfony\AI\McpSdk\Capability\Resource; interface MetadataInterface extends IdentifierInterface { diff --git a/src/mcp-sdk/src/Capability/Resource/ResourceRead.php b/src/mcp-sdk/src/Capability/Resource/ResourceRead.php index e7a6d9ca7..c23ddded7 100644 --- a/src/mcp-sdk/src/Capability/Resource/ResourceRead.php +++ b/src/mcp-sdk/src/Capability/Resource/ResourceRead.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Resource; +namespace Symfony\AI\McpSdk\Capability\Resource; final readonly class ResourceRead { diff --git a/src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php b/src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php index 411f155e1..f6ad7d75a 100644 --- a/src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php +++ b/src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Resource; +namespace Symfony\AI\McpSdk\Capability\Resource; final readonly class ResourceReadResult { diff --git a/src/mcp-sdk/src/Capability/Resource/ResourceReaderInterface.php b/src/mcp-sdk/src/Capability/Resource/ResourceReaderInterface.php index 9c74cd6f9..ced197e52 100644 --- a/src/mcp-sdk/src/Capability/Resource/ResourceReaderInterface.php +++ b/src/mcp-sdk/src/Capability/Resource/ResourceReaderInterface.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Resource; +namespace Symfony\AI\McpSdk\Capability\Resource; -use PhpLlm\McpSdk\Exception\ResourceNotFoundException; -use PhpLlm\McpSdk\Exception\ResourceReadException; +use Symfony\AI\McpSdk\Exception\ResourceNotFoundException; +use Symfony\AI\McpSdk\Exception\ResourceReadException; interface ResourceReaderInterface { diff --git a/src/mcp-sdk/src/Capability/ResourceChain.php b/src/mcp-sdk/src/Capability/ResourceChain.php index 77855fa13..8d46f8689 100644 --- a/src/mcp-sdk/src/Capability/ResourceChain.php +++ b/src/mcp-sdk/src/Capability/ResourceChain.php @@ -11,16 +11,16 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability; - -use PhpLlm\McpSdk\Capability\Resource\CollectionInterface; -use PhpLlm\McpSdk\Capability\Resource\IdentifierInterface; -use PhpLlm\McpSdk\Capability\Resource\MetadataInterface; -use PhpLlm\McpSdk\Capability\Resource\ResourceRead; -use PhpLlm\McpSdk\Capability\Resource\ResourceReaderInterface; -use PhpLlm\McpSdk\Capability\Resource\ResourceReadResult; -use PhpLlm\McpSdk\Exception\ResourceNotFoundException; -use PhpLlm\McpSdk\Exception\ResourceReadException; +namespace Symfony\AI\McpSdk\Capability; + +use Symfony\AI\McpSdk\Capability\Resource\CollectionInterface; +use Symfony\AI\McpSdk\Capability\Resource\IdentifierInterface; +use Symfony\AI\McpSdk\Capability\Resource\MetadataInterface; +use Symfony\AI\McpSdk\Capability\Resource\ResourceRead; +use Symfony\AI\McpSdk\Capability\Resource\ResourceReaderInterface; +use Symfony\AI\McpSdk\Capability\Resource\ResourceReadResult; +use Symfony\AI\McpSdk\Exception\ResourceNotFoundException; +use Symfony\AI\McpSdk\Exception\ResourceReadException; /** * A collection of resources. All resources need to implement IdentifierInterface. diff --git a/src/mcp-sdk/src/Capability/Tool/CollectionInterface.php b/src/mcp-sdk/src/Capability/Tool/CollectionInterface.php index 19dcef9c5..bd1b1252e 100644 --- a/src/mcp-sdk/src/Capability/Tool/CollectionInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/CollectionInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Tool; +namespace Symfony\AI\McpSdk\Capability\Tool; interface CollectionInterface { diff --git a/src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php b/src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php index 987ca1f85..05ecba124 100644 --- a/src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Tool; +namespace Symfony\AI\McpSdk\Capability\Tool; interface IdentifierInterface { diff --git a/src/mcp-sdk/src/Capability/Tool/MetadataInterface.php b/src/mcp-sdk/src/Capability/Tool/MetadataInterface.php index e6fb92ddb..adafaf2fe 100644 --- a/src/mcp-sdk/src/Capability/Tool/MetadataInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/MetadataInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Tool; +namespace Symfony\AI\McpSdk\Capability\Tool; interface MetadataInterface extends IdentifierInterface { diff --git a/src/mcp-sdk/src/Capability/Tool/ToolCall.php b/src/mcp-sdk/src/Capability/Tool/ToolCall.php index 3b211078e..1682d6dc8 100644 --- a/src/mcp-sdk/src/Capability/Tool/ToolCall.php +++ b/src/mcp-sdk/src/Capability/Tool/ToolCall.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Tool; +namespace Symfony\AI\McpSdk\Capability\Tool; final readonly class ToolCall { diff --git a/src/mcp-sdk/src/Capability/Tool/ToolCallResult.php b/src/mcp-sdk/src/Capability/Tool/ToolCallResult.php index 2184ed81a..4c9609a1d 100644 --- a/src/mcp-sdk/src/Capability/Tool/ToolCallResult.php +++ b/src/mcp-sdk/src/Capability/Tool/ToolCallResult.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Tool; +namespace Symfony\AI\McpSdk\Capability\Tool; final readonly class ToolCallResult { diff --git a/src/mcp-sdk/src/Capability/Tool/ToolCollectionInterface.php b/src/mcp-sdk/src/Capability/Tool/ToolCollectionInterface.php index 19a8a5916..f695b0329 100644 --- a/src/mcp-sdk/src/Capability/Tool/ToolCollectionInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/ToolCollectionInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Tool; +namespace Symfony\AI\McpSdk\Capability\Tool; interface ToolCollectionInterface { diff --git a/src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php b/src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php index ba3c3af36..4906e48f2 100644 --- a/src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php +++ b/src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability\Tool; +namespace Symfony\AI\McpSdk\Capability\Tool; -use PhpLlm\McpSdk\Exception\ToolExecutionException; -use PhpLlm\McpSdk\Exception\ToolNotFoundException; +use Symfony\AI\McpSdk\Exception\ToolExecutionException; +use Symfony\AI\McpSdk\Exception\ToolNotFoundException; interface ToolExecutorInterface { diff --git a/src/mcp-sdk/src/Capability/ToolChain.php b/src/mcp-sdk/src/Capability/ToolChain.php index 2bd1310f8..7b48b5532 100644 --- a/src/mcp-sdk/src/Capability/ToolChain.php +++ b/src/mcp-sdk/src/Capability/ToolChain.php @@ -11,16 +11,16 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Capability; - -use PhpLlm\McpSdk\Capability\Tool\CollectionInterface; -use PhpLlm\McpSdk\Capability\Tool\IdentifierInterface; -use PhpLlm\McpSdk\Capability\Tool\MetadataInterface; -use PhpLlm\McpSdk\Capability\Tool\ToolCall; -use PhpLlm\McpSdk\Capability\Tool\ToolCallResult; -use PhpLlm\McpSdk\Capability\Tool\ToolExecutorInterface; -use PhpLlm\McpSdk\Exception\ToolExecutionException; -use PhpLlm\McpSdk\Exception\ToolNotFoundException; +namespace Symfony\AI\McpSdk\Capability; + +use Symfony\AI\McpSdk\Capability\Tool\CollectionInterface; +use Symfony\AI\McpSdk\Capability\Tool\IdentifierInterface; +use Symfony\AI\McpSdk\Capability\Tool\MetadataInterface; +use Symfony\AI\McpSdk\Capability\Tool\ToolCall; +use Symfony\AI\McpSdk\Capability\Tool\ToolCallResult; +use Symfony\AI\McpSdk\Capability\Tool\ToolExecutorInterface; +use Symfony\AI\McpSdk\Exception\ToolExecutionException; +use Symfony\AI\McpSdk\Exception\ToolNotFoundException; /** * A collection of tools. All tools need to implement IdentifierInterface. diff --git a/src/mcp-sdk/src/Exception/ExceptionInterface.php b/src/mcp-sdk/src/Exception/ExceptionInterface.php index 521179717..597451e0d 100644 --- a/src/mcp-sdk/src/Exception/ExceptionInterface.php +++ b/src/mcp-sdk/src/Exception/ExceptionInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Exception; +namespace Symfony\AI\McpSdk\Exception; interface ExceptionInterface { diff --git a/src/mcp-sdk/src/Exception/NotFoundExceptionInterface.php b/src/mcp-sdk/src/Exception/NotFoundExceptionInterface.php index c3f9b69e3..eb25edaad 100644 --- a/src/mcp-sdk/src/Exception/NotFoundExceptionInterface.php +++ b/src/mcp-sdk/src/Exception/NotFoundExceptionInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Exception; +namespace Symfony\AI\McpSdk\Exception; interface NotFoundExceptionInterface extends ExceptionInterface { diff --git a/src/mcp-sdk/src/Exception/PromptGetException.php b/src/mcp-sdk/src/Exception/PromptGetException.php index b3242f866..82b5494fe 100644 --- a/src/mcp-sdk/src/Exception/PromptGetException.php +++ b/src/mcp-sdk/src/Exception/PromptGetException.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Exception; +namespace Symfony\AI\McpSdk\Exception; -use PhpLlm\McpSdk\Capability\Prompt\PromptGet; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGet; final class PromptGetException extends \RuntimeException implements ExceptionInterface { diff --git a/src/mcp-sdk/src/Exception/PromptNotFoundException.php b/src/mcp-sdk/src/Exception/PromptNotFoundException.php index b601029e2..d98d8b704 100644 --- a/src/mcp-sdk/src/Exception/PromptNotFoundException.php +++ b/src/mcp-sdk/src/Exception/PromptNotFoundException.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Exception; +namespace Symfony\AI\McpSdk\Exception; -use PhpLlm\McpSdk\Capability\Prompt\PromptGet; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGet; final class PromptNotFoundException extends \RuntimeException implements NotFoundExceptionInterface { diff --git a/src/mcp-sdk/src/Exception/ResourceNotFoundException.php b/src/mcp-sdk/src/Exception/ResourceNotFoundException.php index ad042921c..2a1a4f3a4 100644 --- a/src/mcp-sdk/src/Exception/ResourceNotFoundException.php +++ b/src/mcp-sdk/src/Exception/ResourceNotFoundException.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Exception; +namespace Symfony\AI\McpSdk\Exception; -use PhpLlm\McpSdk\Capability\Resource\ResourceRead; +use Symfony\AI\McpSdk\Capability\Resource\ResourceRead; final class ResourceNotFoundException extends \RuntimeException implements NotFoundExceptionInterface { diff --git a/src/mcp-sdk/src/Exception/ResourceReadException.php b/src/mcp-sdk/src/Exception/ResourceReadException.php index d986b223d..0fbe457ff 100644 --- a/src/mcp-sdk/src/Exception/ResourceReadException.php +++ b/src/mcp-sdk/src/Exception/ResourceReadException.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Exception; +namespace Symfony\AI\McpSdk\Exception; -use PhpLlm\McpSdk\Capability\Resource\ResourceRead; +use Symfony\AI\McpSdk\Capability\Resource\ResourceRead; final class ResourceReadException extends \RuntimeException implements ExceptionInterface { diff --git a/src/mcp-sdk/src/Exception/ToolExecutionException.php b/src/mcp-sdk/src/Exception/ToolExecutionException.php index 70d65d194..ff9e1d4ed 100644 --- a/src/mcp-sdk/src/Exception/ToolExecutionException.php +++ b/src/mcp-sdk/src/Exception/ToolExecutionException.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Exception; +namespace Symfony\AI\McpSdk\Exception; -use PhpLlm\McpSdk\Capability\Tool\ToolCall; +use Symfony\AI\McpSdk\Capability\Tool\ToolCall; final class ToolExecutionException extends \RuntimeException implements ExceptionInterface { diff --git a/src/mcp-sdk/src/Exception/ToolNotFoundException.php b/src/mcp-sdk/src/Exception/ToolNotFoundException.php index 0066cffc6..7aa2a541b 100644 --- a/src/mcp-sdk/src/Exception/ToolNotFoundException.php +++ b/src/mcp-sdk/src/Exception/ToolNotFoundException.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Exception; +namespace Symfony\AI\McpSdk\Exception; -use PhpLlm\McpSdk\Capability\Tool\ToolCall; +use Symfony\AI\McpSdk\Capability\Tool\ToolCall; final class ToolNotFoundException extends \RuntimeException implements NotFoundExceptionInterface { diff --git a/src/mcp-sdk/src/Message/Error.php b/src/mcp-sdk/src/Message/Error.php index e07ab20cf..61f9327ad 100644 --- a/src/mcp-sdk/src/Message/Error.php +++ b/src/mcp-sdk/src/Message/Error.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Message; +namespace Symfony\AI\McpSdk\Message; final readonly class Error implements \JsonSerializable { diff --git a/src/mcp-sdk/src/Message/Factory.php b/src/mcp-sdk/src/Message/Factory.php index d2f73892b..1dc9e5297 100644 --- a/src/mcp-sdk/src/Message/Factory.php +++ b/src/mcp-sdk/src/Message/Factory.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Message; +namespace Symfony\AI\McpSdk\Message; final class Factory { diff --git a/src/mcp-sdk/src/Message/Notification.php b/src/mcp-sdk/src/Message/Notification.php index a32f497c3..05d60ca82 100644 --- a/src/mcp-sdk/src/Message/Notification.php +++ b/src/mcp-sdk/src/Message/Notification.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Message; +namespace Symfony\AI\McpSdk\Message; final readonly class Notification implements \JsonSerializable, \Stringable { diff --git a/src/mcp-sdk/src/Message/Request.php b/src/mcp-sdk/src/Message/Request.php index 95ced59d5..2a64f8be3 100644 --- a/src/mcp-sdk/src/Message/Request.php +++ b/src/mcp-sdk/src/Message/Request.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Message; +namespace Symfony\AI\McpSdk\Message; final class Request implements \JsonSerializable, \Stringable { diff --git a/src/mcp-sdk/src/Message/Response.php b/src/mcp-sdk/src/Message/Response.php index c0361d25b..85cbd002c 100644 --- a/src/mcp-sdk/src/Message/Response.php +++ b/src/mcp-sdk/src/Message/Response.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Message; +namespace Symfony\AI\McpSdk\Message; final readonly class Response implements \JsonSerializable { diff --git a/src/mcp-sdk/src/Server.php b/src/mcp-sdk/src/Server.php index 566534088..2fbcaa740 100644 --- a/src/mcp-sdk/src/Server.php +++ b/src/mcp-sdk/src/Server.php @@ -11,12 +11,12 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk; +namespace Symfony\AI\McpSdk; -use PhpLlm\McpSdk\Server\JsonRpcHandler; -use PhpLlm\McpSdk\Server\TransportInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; +use Symfony\AI\McpSdk\Server\JsonRpcHandler; +use Symfony\AI\McpSdk\Server\TransportInterface; final readonly class Server { diff --git a/src/mcp-sdk/src/Server/JsonRpcHandler.php b/src/mcp-sdk/src/Server/JsonRpcHandler.php index c0205ed54..3d453161a 100644 --- a/src/mcp-sdk/src/Server/JsonRpcHandler.php +++ b/src/mcp-sdk/src/Server/JsonRpcHandler.php @@ -11,14 +11,14 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server; +namespace Symfony\AI\McpSdk\Server; -use PhpLlm\McpSdk\Message\Error; -use PhpLlm\McpSdk\Message\Factory; -use PhpLlm\McpSdk\Message\Notification; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; use Psr\Log\LoggerInterface; +use Symfony\AI\McpSdk\Message\Error; +use Symfony\AI\McpSdk\Message\Factory; +use Symfony\AI\McpSdk\Message\Notification; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; /** * @final diff --git a/src/mcp-sdk/src/Server/NotificationHandler/BaseNotificationHandler.php b/src/mcp-sdk/src/Server/NotificationHandler/BaseNotificationHandler.php index c1bd4b031..9af39cedd 100644 --- a/src/mcp-sdk/src/Server/NotificationHandler/BaseNotificationHandler.php +++ b/src/mcp-sdk/src/Server/NotificationHandler/BaseNotificationHandler.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\NotificationHandler; +namespace Symfony\AI\McpSdk\Server\NotificationHandler; -use PhpLlm\McpSdk\Message\Notification; -use PhpLlm\McpSdk\Server\NotificationHandlerInterface; +use Symfony\AI\McpSdk\Message\Notification; +use Symfony\AI\McpSdk\Server\NotificationHandlerInterface; abstract class BaseNotificationHandler implements NotificationHandlerInterface { diff --git a/src/mcp-sdk/src/Server/NotificationHandler/InitializedHandler.php b/src/mcp-sdk/src/Server/NotificationHandler/InitializedHandler.php index ec214da1c..036439034 100644 --- a/src/mcp-sdk/src/Server/NotificationHandler/InitializedHandler.php +++ b/src/mcp-sdk/src/Server/NotificationHandler/InitializedHandler.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\NotificationHandler; +namespace Symfony\AI\McpSdk\Server\NotificationHandler; -use PhpLlm\McpSdk\Message\Notification; +use Symfony\AI\McpSdk\Message\Notification; final class InitializedHandler extends BaseNotificationHandler { diff --git a/src/mcp-sdk/src/Server/NotificationHandlerInterface.php b/src/mcp-sdk/src/Server/NotificationHandlerInterface.php index 110c3c9c0..d5bd9bb0a 100644 --- a/src/mcp-sdk/src/Server/NotificationHandlerInterface.php +++ b/src/mcp-sdk/src/Server/NotificationHandlerInterface.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server; +namespace Symfony\AI\McpSdk\Server; -use PhpLlm\McpSdk\Message\Notification; +use Symfony\AI\McpSdk\Message\Notification; interface NotificationHandlerInterface { diff --git a/src/mcp-sdk/src/Server/RequestHandler/BaseRequestHandler.php b/src/mcp-sdk/src/Server/RequestHandler/BaseRequestHandler.php index 6c2ef33a1..dee6dd6d1 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/BaseRequestHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/BaseRequestHandler.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; +namespace Symfony\AI\McpSdk\Server\RequestHandler; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Server\RequestHandlerInterface; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Server\RequestHandlerInterface; abstract class BaseRequestHandler implements RequestHandlerInterface { diff --git a/src/mcp-sdk/src/Server/RequestHandler/InitializeHandler.php b/src/mcp-sdk/src/Server/RequestHandler/InitializeHandler.php index a90ab0e74..68e2f66b3 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/InitializeHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/InitializeHandler.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; +namespace Symfony\AI\McpSdk\Server\RequestHandler; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; final class InitializeHandler extends BaseRequestHandler { diff --git a/src/mcp-sdk/src/Server/RequestHandler/PingHandler.php b/src/mcp-sdk/src/Server/RequestHandler/PingHandler.php index ccad4b7d3..afb9cdb9d 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/PingHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/PingHandler.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; +namespace Symfony\AI\McpSdk\Server\RequestHandler; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; final class PingHandler extends BaseRequestHandler { diff --git a/src/mcp-sdk/src/Server/RequestHandler/PromptGetHandler.php b/src/mcp-sdk/src/Server/RequestHandler/PromptGetHandler.php index e3f86b54c..c138c25f4 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/PromptGetHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/PromptGetHandler.php @@ -11,14 +11,14 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; +namespace Symfony\AI\McpSdk\Server\RequestHandler; -use PhpLlm\McpSdk\Capability\Prompt\PromptGet; -use PhpLlm\McpSdk\Capability\Prompt\PromptGetterInterface; -use PhpLlm\McpSdk\Exception\ExceptionInterface; -use PhpLlm\McpSdk\Message\Error; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGet; +use Symfony\AI\McpSdk\Capability\Prompt\PromptGetterInterface; +use Symfony\AI\McpSdk\Exception\ExceptionInterface; +use Symfony\AI\McpSdk\Message\Error; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; final class PromptGetHandler extends BaseRequestHandler { diff --git a/src/mcp-sdk/src/Server/RequestHandler/PromptListHandler.php b/src/mcp-sdk/src/Server/RequestHandler/PromptListHandler.php index a43bca102..3c7bd41ef 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/PromptListHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/PromptListHandler.php @@ -11,13 +11,13 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; +namespace Symfony\AI\McpSdk\Server\RequestHandler; -use PhpLlm\McpSdk\Capability\Prompt\CollectionInterface; -use PhpLlm\McpSdk\Capability\Prompt\MetadataInterface; -use PhpLlm\McpSdk\Message\Notification; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +use Symfony\AI\McpSdk\Capability\Prompt\CollectionInterface; +use Symfony\AI\McpSdk\Capability\Prompt\MetadataInterface; +use Symfony\AI\McpSdk\Message\Notification; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; final class PromptListHandler extends BaseRequestHandler { diff --git a/src/mcp-sdk/src/Server/RequestHandler/ResourceListHandler.php b/src/mcp-sdk/src/Server/RequestHandler/ResourceListHandler.php index 3f8a303fc..3317d7134 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/ResourceListHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/ResourceListHandler.php @@ -11,13 +11,13 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; +namespace Symfony\AI\McpSdk\Server\RequestHandler; -use PhpLlm\McpSdk\Capability\Resource\CollectionInterface; -use PhpLlm\McpSdk\Capability\Resource\MetadataInterface; -use PhpLlm\McpSdk\Message\Notification; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +use Symfony\AI\McpSdk\Capability\Resource\CollectionInterface; +use Symfony\AI\McpSdk\Capability\Resource\MetadataInterface; +use Symfony\AI\McpSdk\Message\Notification; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; final class ResourceListHandler extends BaseRequestHandler { diff --git a/src/mcp-sdk/src/Server/RequestHandler/ResourceReadHandler.php b/src/mcp-sdk/src/Server/RequestHandler/ResourceReadHandler.php index d66d87120..38dea7248 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/ResourceReadHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/ResourceReadHandler.php @@ -11,14 +11,14 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; - -use PhpLlm\McpSdk\Capability\Resource\ResourceRead; -use PhpLlm\McpSdk\Capability\Resource\ResourceReaderInterface; -use PhpLlm\McpSdk\Exception\ExceptionInterface; -use PhpLlm\McpSdk\Message\Error; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +namespace Symfony\AI\McpSdk\Server\RequestHandler; + +use Symfony\AI\McpSdk\Capability\Resource\ResourceRead; +use Symfony\AI\McpSdk\Capability\Resource\ResourceReaderInterface; +use Symfony\AI\McpSdk\Exception\ExceptionInterface; +use Symfony\AI\McpSdk\Message\Error; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; final class ResourceReadHandler extends BaseRequestHandler { diff --git a/src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php b/src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php index 58e3655a5..3590a555f 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/ToolCallHandler.php @@ -11,14 +11,14 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; +namespace Symfony\AI\McpSdk\Server\RequestHandler; -use PhpLlm\McpSdk\Capability\Tool\ToolCall; -use PhpLlm\McpSdk\Capability\Tool\ToolExecutorInterface; -use PhpLlm\McpSdk\Exception\ExceptionInterface; -use PhpLlm\McpSdk\Message\Error; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +use Symfony\AI\McpSdk\Capability\Tool\ToolCall; +use Symfony\AI\McpSdk\Capability\Tool\ToolExecutorInterface; +use Symfony\AI\McpSdk\Exception\ExceptionInterface; +use Symfony\AI\McpSdk\Message\Error; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; final class ToolCallHandler extends BaseRequestHandler { diff --git a/src/mcp-sdk/src/Server/RequestHandler/ToolListHandler.php b/src/mcp-sdk/src/Server/RequestHandler/ToolListHandler.php index 7ce8d2e91..8432cd4b5 100644 --- a/src/mcp-sdk/src/Server/RequestHandler/ToolListHandler.php +++ b/src/mcp-sdk/src/Server/RequestHandler/ToolListHandler.php @@ -11,12 +11,12 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\RequestHandler; +namespace Symfony\AI\McpSdk\Server\RequestHandler; -use PhpLlm\McpSdk\Capability\Tool\CollectionInterface; -use PhpLlm\McpSdk\Capability\Tool\MetadataInterface; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +use Symfony\AI\McpSdk\Capability\Tool\CollectionInterface; +use Symfony\AI\McpSdk\Capability\Tool\MetadataInterface; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; final class ToolListHandler extends BaseRequestHandler { diff --git a/src/mcp-sdk/src/Server/RequestHandlerInterface.php b/src/mcp-sdk/src/Server/RequestHandlerInterface.php index 4cb3c51c0..ca37dd63f 100644 --- a/src/mcp-sdk/src/Server/RequestHandlerInterface.php +++ b/src/mcp-sdk/src/Server/RequestHandlerInterface.php @@ -11,11 +11,11 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server; +namespace Symfony\AI\McpSdk\Server; -use PhpLlm\McpSdk\Message\Error; -use PhpLlm\McpSdk\Message\Request; -use PhpLlm\McpSdk\Message\Response; +use Symfony\AI\McpSdk\Message\Error; +use Symfony\AI\McpSdk\Message\Request; +use Symfony\AI\McpSdk\Message\Response; interface RequestHandlerInterface { diff --git a/src/mcp-sdk/src/Server/Transport/Sse/Store/CachePoolStore.php b/src/mcp-sdk/src/Server/Transport/Sse/Store/CachePoolStore.php index c9000e6c5..9ce41d718 100644 --- a/src/mcp-sdk/src/Server/Transport/Sse/Store/CachePoolStore.php +++ b/src/mcp-sdk/src/Server/Transport/Sse/Store/CachePoolStore.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\Transport\Sse\Store; +namespace Symfony\AI\McpSdk\Server\Transport\Sse\Store; -use PhpLlm\McpSdk\Server\Transport\Sse\StoreInterface; use Psr\Cache\CacheItemPoolInterface; +use Symfony\AI\McpSdk\Server\Transport\Sse\StoreInterface; use Symfony\Component\Uid\Uuid; final readonly class CachePoolStore implements StoreInterface diff --git a/src/mcp-sdk/src/Server/Transport/Sse/StoreInterface.php b/src/mcp-sdk/src/Server/Transport/Sse/StoreInterface.php index 98d30f7c0..b1d0cc977 100644 --- a/src/mcp-sdk/src/Server/Transport/Sse/StoreInterface.php +++ b/src/mcp-sdk/src/Server/Transport/Sse/StoreInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\Transport\Sse; +namespace Symfony\AI\McpSdk\Server\Transport\Sse; use Symfony\Component\Uid\Uuid; diff --git a/src/mcp-sdk/src/Server/Transport/Sse/StreamTransport.php b/src/mcp-sdk/src/Server/Transport/Sse/StreamTransport.php index 8259f7886..2c30d1e0a 100644 --- a/src/mcp-sdk/src/Server/Transport/Sse/StreamTransport.php +++ b/src/mcp-sdk/src/Server/Transport/Sse/StreamTransport.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\Transport\Sse; +namespace Symfony\AI\McpSdk\Server\Transport\Sse; -use PhpLlm\McpSdk\Server\TransportInterface; +use Symfony\AI\McpSdk\Server\TransportInterface; use Symfony\Component\Uid\Uuid; final readonly class StreamTransport implements TransportInterface diff --git a/src/mcp-sdk/src/Server/Transport/Stdio/SymfonyConsoleTransport.php b/src/mcp-sdk/src/Server/Transport/Stdio/SymfonyConsoleTransport.php index 00419bdcb..281737d2b 100644 --- a/src/mcp-sdk/src/Server/Transport/Stdio/SymfonyConsoleTransport.php +++ b/src/mcp-sdk/src/Server/Transport/Stdio/SymfonyConsoleTransport.php @@ -11,9 +11,9 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server\Transport\Stdio; +namespace Symfony\AI\McpSdk\Server\Transport\Stdio; -use PhpLlm\McpSdk\Server\TransportInterface; +use Symfony\AI\McpSdk\Server\TransportInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\StreamableInputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/src/mcp-sdk/src/Server/TransportInterface.php b/src/mcp-sdk/src/Server/TransportInterface.php index c416a9248..0ce64ceaf 100644 --- a/src/mcp-sdk/src/Server/TransportInterface.php +++ b/src/mcp-sdk/src/Server/TransportInterface.php @@ -11,7 +11,7 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Server; +namespace Symfony\AI\McpSdk\Server; interface TransportInterface { diff --git a/src/mcp-sdk/tests/Fixtures/InMemoryTransport.php b/src/mcp-sdk/tests/Fixtures/InMemoryTransport.php index 82fbb5326..eda931df9 100644 --- a/src/mcp-sdk/tests/Fixtures/InMemoryTransport.php +++ b/src/mcp-sdk/tests/Fixtures/InMemoryTransport.php @@ -1,8 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\AI\McpSdk\Tests\Fixtures; + +use Symfony\AI\McpSdk\Server\TransportInterface; class InMemoryTransport implements TransportInterface { diff --git a/src/mcp-sdk/tests/Message/ErrorTest.php b/src/mcp-sdk/tests/Message/ErrorTest.php index c142f1e06..7ccfed6f0 100644 --- a/src/mcp-sdk/tests/Message/ErrorTest.php +++ b/src/mcp-sdk/tests/Message/ErrorTest.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Tests\Message; +namespace Symfony\AI\McpSdk\Tests\Message; -use PhpLlm\McpSdk\Message\Error; use PHPUnit\Framework\TestCase; +use Symfony\AI\McpSdk\Message\Error; final class ErrorTest extends TestCase { diff --git a/src/mcp-sdk/tests/Message/FactoryTest.php b/src/mcp-sdk/tests/Message/FactoryTest.php index d51370585..752114031 100644 --- a/src/mcp-sdk/tests/Message/FactoryTest.php +++ b/src/mcp-sdk/tests/Message/FactoryTest.php @@ -11,12 +11,12 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Tests\Message; +namespace Symfony\AI\McpSdk\Tests\Message; -use PhpLlm\McpSdk\Message\Factory; -use PhpLlm\McpSdk\Message\Notification; -use PhpLlm\McpSdk\Message\Request; use PHPUnit\Framework\TestCase; +use Symfony\AI\McpSdk\Message\Factory; +use Symfony\AI\McpSdk\Message\Notification; +use Symfony\AI\McpSdk\Message\Request; final class FactoryTest extends TestCase { diff --git a/src/mcp-sdk/tests/Message/ResponseTest.php b/src/mcp-sdk/tests/Message/ResponseTest.php index 326411e21..85fac0607 100644 --- a/src/mcp-sdk/tests/Message/ResponseTest.php +++ b/src/mcp-sdk/tests/Message/ResponseTest.php @@ -11,10 +11,10 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Tests\Message; +namespace Symfony\AI\McpSdk\Tests\Message; -use PhpLlm\McpSdk\Message\Response; use PHPUnit\Framework\TestCase; +use Symfony\AI\McpSdk\Message\Response; final class ResponseTest extends TestCase { diff --git a/src/mcp-sdk/tests/ServerTest.php b/src/mcp-sdk/tests/ServerTest.php index a35fd1cab..9ff63e4cf 100644 --- a/src/mcp-sdk/tests/ServerTest.php +++ b/src/mcp-sdk/tests/ServerTest.php @@ -11,14 +11,14 @@ * file that was distributed with this source code. */ -namespace PhpLlm\McpSdk\Tests; +namespace Symfony\AI\McpSdk\Tests; -use PhpLlm\McpSdk\Server; -use PhpLlm\McpSdk\Server\JsonRpcHandler; -use PhpLlm\McpSdk\Tests\Fixtures\InMemoryTransport; use PHPUnit\Framework\MockObject\Stub\Exception; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; +use Symfony\AI\McpSdk\Server; +use Symfony\AI\McpSdk\Server\JsonRpcHandler; +use Symfony\AI\McpSdk\Tests\Fixtures\InMemoryTransport; class ServerTest extends TestCase {