|
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 |
|
12 | | -namespace Mcp\JsonRpc; |
| 12 | +namespace Mcp\Server\Handler; |
13 | 13 |
|
14 | 14 | use Mcp\Capability\Prompt\PromptGetterInterface; |
15 | 15 | use Mcp\Capability\Registry\ReferenceProviderInterface; |
|
20 | 20 | use Mcp\Exception\HandlerNotFoundException; |
21 | 21 | use Mcp\Exception\InvalidInputMessageException; |
22 | 22 | use Mcp\Exception\NotFoundExceptionInterface; |
| 23 | +use Mcp\JsonRpc\MessageFactory; |
23 | 24 | use Mcp\Schema\Implementation; |
24 | 25 | use Mcp\Schema\JsonRpc\Error; |
25 | 26 | use Mcp\Schema\JsonRpc\HasMethodInterface; |
26 | 27 | use Mcp\Schema\JsonRpc\Request; |
27 | 28 | use Mcp\Schema\JsonRpc\Response; |
28 | 29 | use Mcp\Schema\Request\InitializeRequest; |
29 | | -use Mcp\Server\MethodHandlerInterface; |
30 | | -use Mcp\Server\NotificationHandler; |
31 | | -use Mcp\Server\RequestHandler; |
| 30 | +use Mcp\Server\Handler; |
32 | 31 | use Mcp\Server\Session\SessionFactoryInterface; |
33 | 32 | use Mcp\Server\Session\SessionInterface; |
34 | 33 | use Mcp\Server\Session\SessionStoreInterface; |
|
41 | 40 | * |
42 | 41 | * @author Christopher Hertel <mail@christopher-hertel.de> |
43 | 42 | */ |
44 | | -class Handler |
| 43 | +class JsonRpcHandler |
45 | 44 | { |
46 | 45 | /** |
47 | 46 | * @var array<int, MethodHandlerInterface> |
@@ -80,15 +79,15 @@ public static function make( |
80 | 79 | sessionFactory: $sessionFactory, |
81 | 80 | sessionStore: $sessionStore, |
82 | 81 | methodHandlers: [ |
83 | | - new NotificationHandler\InitializedHandler(), |
84 | | - new RequestHandler\InitializeHandler($registry->getCapabilities(), $implementation), |
85 | | - new RequestHandler\PingHandler(), |
86 | | - new RequestHandler\ListPromptsHandler($referenceProvider, $paginationLimit), |
87 | | - new RequestHandler\GetPromptHandler($promptGetter), |
88 | | - new RequestHandler\ListResourcesHandler($referenceProvider, $paginationLimit), |
89 | | - new RequestHandler\ReadResourceHandler($resourceReader), |
90 | | - new RequestHandler\CallToolHandler($toolCaller, $logger), |
91 | | - new RequestHandler\ListToolsHandler($referenceProvider, $paginationLimit), |
| 82 | + new Notification\InitializedHandler(), |
| 83 | + new Handler\Request\InitializeHandler($registry->getCapabilities(), $implementation), |
| 84 | + new Handler\Request\PingHandler(), |
| 85 | + new Handler\Request\ListPromptsHandler($referenceProvider, $paginationLimit), |
| 86 | + new Handler\Request\GetPromptHandler($promptGetter), |
| 87 | + new Handler\Request\ListResourcesHandler($referenceProvider, $paginationLimit), |
| 88 | + new Handler\Request\ReadResourceHandler($resourceReader), |
| 89 | + new Handler\Request\CallToolHandler($toolCaller, $logger), |
| 90 | + new Handler\Request\ListToolsHandler($referenceProvider, $paginationLimit), |
92 | 91 | ], |
93 | 92 | logger: $logger, |
94 | 93 | ); |
|
0 commit comments