File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
01-discovery-stdio-calculator Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1919logger ()->info ('Starting MCP Stdio Calculator Server... ' );
2020
2121$ server = Server::make ()
22- ->withServerInfo ('Stdio Calculator ' , '1.1.0 ' , 'Basic Calculator over STDIO transport. ' )
23- ->withContainer (container ())
24- ->withLogger (logger ())
25- ->withDiscovery (__DIR__ , ['. ' ])
22+ ->setServerInfo ('Stdio Calculator ' , '1.1.0 ' , 'Basic Calculator over STDIO transport. ' )
23+ ->setContainer (container ())
24+ ->setLogger (logger ())
25+ ->setDiscovery (__DIR__ , ['. ' ])
2626 ->build ();
2727
2828$ transport = new StdioTransport (logger: logger ());
Original file line number Diff line number Diff line change 1616$ request = $ creator ->fromGlobals ();
1717
1818$ server = Server::make ()
19- ->withServerInfo ('HTTP MCP Server ' , '1.0.0 ' , 'MCP Server over HTTP transport ' )
20- ->withContainer (container ())
21- ->withSession (new FileSessionStore (__DIR__ . '/sessions ' ))
22- ->withDiscovery (__DIR__ , ['. ' ])
19+ ->setServerInfo ('HTTP MCP Server ' , '1.0.0 ' , 'MCP Server over HTTP transport ' )
20+ ->setContainer (container ())
21+ ->setSession (new FileSessionStore (__DIR__ . '/sessions ' ))
22+ ->setDiscovery (__DIR__ , ['. ' ])
2323 ->build ();
2424
2525$ transport = new StreamableHttpTransport ($ request , $ psr17Factory , $ psr17Factory );
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ public function setContainer(ContainerInterface $container): self
200200 return $ this ;
201201 }
202202
203- public function withSession (
203+ public function setSession (
204204 SessionStoreInterface $ sessionStore ,
205205 SessionFactoryInterface $ sessionFactory = new SessionFactory (),
206206 int $ ttl = 3600
You can’t perform that action at this time.
0 commit comments