Adopt Schema component in server handlers

This commit is contained in:
Christopher Hertel 2025-08-03 22:06:46 +02:00
commit 09707b4798
No known key found for this signature in database
GPG key ID: 111F6BFF7B6B5AA3

View file

@ -11,19 +11,24 @@
namespace Mcp\Server\NotificationHandler;
use Mcp\Message\Notification;
use Mcp\Schema\JsonRpc\Error;
use Mcp\Schema\JsonRpc\HasMethodInterface;
use Mcp\Schema\JsonRpc\Response;
use Mcp\Schema\Notification\InitializedNotification;
use Mcp\Server\MethodHandlerInterface;
/**
* @author Christopher Hertel <mail@christopher-hertel.de>
*/
final class InitializedHandler extends BaseNotificationHandler
final class InitializedHandler implements MethodHandlerInterface
{
protected function supportedNotification(): string
public function supports(HasMethodInterface $message): bool
{
return 'initialized';
return $message instanceof InitializedNotification;
}
public function handle(Notification $notification): void
public function handle(InitializedNotification|HasMethodInterface $message): Response|Error|null
{
return null;
}
}