Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
McpServerServiceProvider | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||
register | n/a |
0 / 0 |
n/a |
0 / 0 |
1 |
1 | <?php |
2 | namespace Apie\McpServer; |
3 | |
4 | use Apie\ServiceProviderGenerator\UseGeneratedMethods; |
5 | use Illuminate\Support\ServiceProvider; |
6 | |
7 | /** |
8 | * This file is generated with apie/service-provider-generator from file: mcp_server.yaml |
9 | * @codeCoverageIgnore |
10 | */ |
11 | class McpServerServiceProvider extends ServiceProvider |
12 | { |
13 | use UseGeneratedMethods; |
14 | |
15 | public function register() |
16 | { |
17 | $this->app->singleton( |
18 | \Apie\McpServer\RunMcpServerCommand::class, |
19 | function ($app) { |
20 | return new \Apie\McpServer\RunMcpServerCommand( |
21 | $app->make(\Apie\McpServer\Factory\RunnerFactoryInterface::class), |
22 | $app->make(\Apie\McpServer\Tool\ToolFactory::class), |
23 | $app->make(\Apie\McpServer\Tool\ToolRunner::class) |
24 | ); |
25 | } |
26 | ); |
27 | \Apie\ServiceProviderGenerator\TagMap::register( |
28 | $this->app, |
29 | \Apie\McpServer\RunMcpServerCommand::class, |
30 | array( |
31 | 0 => |
32 | array( |
33 | 'name' => 'console.command', |
34 | ), |
35 | ) |
36 | ); |
37 | $this->app->tag([\Apie\McpServer\RunMcpServerCommand::class], 'console.command'); |
38 | $this->app->bind(\Apie\McpServer\Factory\RunnerFactoryInterface::class, \Apie\McpServer\Factory\RunnerFactory::class); |
39 | |
40 | $this->app->singleton( |
41 | \Apie\McpServer\Factory\RunnerFactory::class, |
42 | function ($app) { |
43 | return new \Apie\McpServer\Factory\RunnerFactory( |
44 | $app->make(\Psr\Log\LoggerInterface::class) |
45 | ); |
46 | } |
47 | ); |
48 | $this->app->singleton( |
49 | \Apie\McpServer\Tool\ToolRunner::class, |
50 | function ($app) { |
51 | return new \Apie\McpServer\Tool\ToolRunner( |
52 | $app->make(\Apie\Core\ContextBuilders\ContextBuilderFactory::class), |
53 | $app->make('apie') |
54 | ); |
55 | } |
56 | ); |
57 | $this->app->singleton( |
58 | \Apie\McpServer\Tool\ToolFactory::class, |
59 | function ($app) { |
60 | return new \Apie\McpServer\Tool\ToolFactory( |
61 | $app->make(\Apie\Core\ContextBuilders\ContextBuilderFactory::class), |
62 | $app->make(\Apie\SchemaGenerator\SchemaGenerator::class), |
63 | $app->make(\Apie\Core\BoundedContext\BoundedContextHashmap::class), |
64 | $app->make(\Apie\Common\ActionDefinitionProvider::class) |
65 | ); |
66 | } |
67 | ); |
68 | $this->app->singleton( |
69 | \Apie\McpServer\Controllers\RemoteMcpController::class, |
70 | function ($app) { |
71 | return new \Apie\McpServer\Controllers\RemoteMcpController( |
72 | $app->make(\Apie\McpServer\Tool\ToolFactory::class), |
73 | $app->make(\Apie\McpServer\Tool\ToolRunner::class), |
74 | $app->make(\Psr\Log\LoggerInterface::class), |
75 | $app->make('apie.mcp_store') |
76 | ); |
77 | } |
78 | ); |
79 | \Apie\ServiceProviderGenerator\TagMap::register( |
80 | $this->app, |
81 | \Apie\McpServer\Controllers\RemoteMcpController::class, |
82 | array( |
83 | 0 => |
84 | array( |
85 | 'name' => 'controller.service_arguments', |
86 | ), |
87 | ) |
88 | ); |
89 | $this->app->tag([\Apie\McpServer\Controllers\RemoteMcpController::class], 'controller.service_arguments'); |
90 | $this->app->bind('apie.mcp_store', \Mcp\Server\Transport\Http\SessionStoreInterface::class); |
91 | |
92 | $this->app->singleton( |
93 | \Apie\McpServer\RouteDefinitions\McpServerRouteDefinitionProvider::class, |
94 | function ($app) { |
95 | return new \Apie\McpServer\RouteDefinitions\McpServerRouteDefinitionProvider( |
96 | $this->parseArgument('%apie.remote_mcp_path%', \Apie\McpServer\RouteDefinitions\McpServerRouteDefinitionProvider::class, 0) |
97 | ); |
98 | } |
99 | ); |
100 | \Apie\ServiceProviderGenerator\TagMap::register( |
101 | $this->app, |
102 | \Apie\McpServer\RouteDefinitions\McpServerRouteDefinitionProvider::class, |
103 | array( |
104 | 0 => |
105 | array( |
106 | 'name' => 'apie.common.route_definition', |
107 | ), |
108 | ) |
109 | ); |
110 | $this->app->tag([\Apie\McpServer\RouteDefinitions\McpServerRouteDefinitionProvider::class], 'apie.common.route_definition'); |
111 | $this->app->singleton( |
112 | \Mcp\Server\Transport\Http\InMemorySessionStore::class, |
113 | function ($app) { |
114 | return new \Mcp\Server\Transport\Http\InMemorySessionStore( |
115 | |
116 | ); |
117 | } |
118 | ); |
119 | $this->app->singleton( |
120 | \Mcp\Server\Transport\Http\FileSessionStore::class, |
121 | function ($app) { |
122 | return new \Mcp\Server\Transport\Http\FileSessionStore( |
123 | $this->parseArgument('%kernel.cache_dir%/mcp_server_sessions', \Mcp\Server\Transport\Http\FileSessionStore::class, 0) |
124 | ); |
125 | } |
126 | ); |
127 | $this->app->bind(\Mcp\Server\Transport\Http\SessionStoreInterface::class, \Mcp\Server\Transport\Http\FileSessionStore::class); |
128 | |
129 | |
130 | } |
131 | } |