File tree Expand file tree Collapse file tree 4 files changed +17
-35
lines changed
examples/09-cached-discovery-stdio Expand file tree Collapse file tree 4 files changed +17
-35
lines changed Original file line number Diff line number Diff line change 5959 "Mcp\\ Example\\ DependenciesStdioExample\\ " : " examples/06-custom-dependencies-stdio/" ,
6060 "Mcp\\ Example\\ ComplexSchemaHttpExample\\ " : " examples/07-complex-tool-schema-http/" ,
6161 "Mcp\\ Example\\ SchemaShowcaseExample\\ " : " examples/08-schema-showcase-streamable/" ,
62- "Mcp\\ Example\\ HttpTransportExample\\ " : " examples/10-simple-http-transport/" ,
63- "Mcp\\ Example\\ CachedDiscoveryExample\\ " : " examples/10-cached-discovery-stdio/" ,
62+ "Mcp\\ Example\\ CachedDiscoveryExample\\ " : " examples/09-cached-discovery-stdio/" ,
6463 "Mcp\\ Tests\\ " : " tests/"
6564 }
6665 },
File renamed without changes.
Original file line number Diff line number Diff line change 1212 * file that was distributed with this source code.
1313 */
1414
15- require_once __DIR__ .'/../bootstrap.php ' ;
15+ require_once dirname (__DIR__ ) . '/bootstrap.php ' ;
16+ chdir (__DIR__ );
1617
1718use Mcp \Server ;
1819use Mcp \Server \Transport \StdioTransport ;
1920use Symfony \Component \Cache \Adapter \ArrayAdapter ;
2021use Symfony \Component \Cache \Psr16Cache ;
2122
22- Server::make ()
23+ logger ()->info ('Starting MCP Cached Discovery Calculator Server... ' );
24+
25+ $ server = Server::make ()
2326 ->setServerInfo ('Cached Discovery Calculator ' , '1.0.0 ' , 'Calculator with cached discovery for better performance. ' )
24- ->setDiscovery ( __DIR__ , [ ' . ' ] )
27+ ->setContainer ( container () )
2528 ->setLogger (logger ())
29+ ->setDiscovery (__DIR__ , ['. ' ])
2630 ->setCache (new Psr16Cache (new ArrayAdapter ()))
27- ->build ()
28- ->connect (new StdioTransport ());
31+ ->build ();
32+
33+ $ transport = new StdioTransport (logger: logger ());
34+
35+ $ server ->connect ($ transport );
36+
37+ $ transport ->listen ();
38+
39+ logger ()->info ('Server listener stopped gracefully. ' );
Original file line number Diff line number Diff line change @@ -321,35 +321,7 @@ parameters:
321321 count : 1
322322 path : examples/08-schema-showcase-streamable/SchemaShowcaseElements.php
323323
324- -
325- message : ' #^Instantiated class Mcp\\Server\\Transports\\StreamableHttpServerTransport not found\.$#'
326- identifier : class.notFound
327- count : 1
328- path : examples/08-schema-showcase-streamable/server.php
329-
330- -
331- message : ' #^Parameter \#1 \$transport of method Mcp\\Server\:\:connect\(\) expects Mcp\\Server\\TransportInterface, Mcp\\Server\\Transports\\StreamableHttpServerTransport given\.$#'
332- identifier : argument.type
333- count : 1
334- path : examples/08-schema-showcase-streamable/server.php
335-
336- -
337- message : ' #^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListPromptsHandler constructor expects Mcp\\Capability\\Registry\\ReferenceProviderInterface, Mcp\\Capability\\PromptChain given\.$#'
338- identifier : argument.type
339- count : 1
340- path : examples/09-standalone-cli/src/Builder.php
341324
342- -
343- message : ' #^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListResourcesHandler constructor expects Mcp\\Capability\\Registry\\ReferenceProviderInterface, Mcp\\Capability\\ResourceChain given\.$#'
344- identifier : argument.type
345- count : 1
346- path : examples/09-standalone-cli/src/Builder.php
347-
348- -
349- message : ' #^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListToolsHandler constructor expects Mcp\\Capability\\Registry\\ReferenceProviderInterface, Mcp\\Capability\\ToolChain given\.$#'
350- identifier : argument.type
351- count : 1
352- path : examples/09-standalone-cli/src/Builder.php
353325
354326 -
355327 message : ' #^Call to an undefined method Mcp\\Capability\\Registry\\ResourceTemplateReference\:\:handle\(\)\.$#'
You can’t perform that action at this time.
0 commit comments