Skip to content

refactor: switch to Symfony AI namespace #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions src/mcp-sdk/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
}
}
8 changes: 4 additions & 4 deletions src/mcp-sdk/examples/cli/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
28 changes: 14 additions & 14 deletions src/mcp-sdk/examples/cli/src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
10 changes: 5 additions & 5 deletions src/mcp-sdk/examples/cli/src/ExamplePrompt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions src/mcp-sdk/examples/cli/src/ExampleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions src/mcp-sdk/examples/cli/src/ExampleTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Prompt/CollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Prompt/IdentifierInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Prompt/MetadataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Prompt/PromptGet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Prompt/PromptGetResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/mcp-sdk/src/Capability/Prompt/PromptGetterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
20 changes: 10 additions & 10 deletions src/mcp-sdk/src/Capability/PromptChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Resource/MetadataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Resource/ResourceRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Resource/ResourceReadResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
20 changes: 10 additions & 10 deletions src/mcp-sdk/src/Capability/ResourceChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Tool/CollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Tool/IdentifierInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Tool/MetadataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Tool/ToolCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/src/Capability/Tool/ToolCallResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/mcp-sdk/src/Capability/Tool/ToolExecutorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Loading