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 19
19
logger ()->info ('Starting MCP Stdio Calculator Server... ' );
20
20
21
21
$ 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__ , ['. ' ])
26
26
->build ();
27
27
28
28
$ transport = new StdioTransport (logger: logger ());
Original file line number Diff line number Diff line change 16
16
$ request = $ creator ->fromGlobals ();
17
17
18
18
$ 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__ , ['. ' ])
23
23
->build ();
24
24
25
25
$ 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
200
200
return $ this ;
201
201
}
202
202
203
- public function withSession (
203
+ public function setSession (
204
204
SessionStoreInterface $ sessionStore ,
205
205
SessionFactoryInterface $ sessionFactory = new SessionFactory (),
206
206
int $ ttl = 3600
You can’t perform that action at this time.
0 commit comments