Skip to content

Commit 812b49c

Browse files
authored
Fixes artisan optimize command (#66)
1 parent 4a8286a commit 812b49c

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Server/Registrar.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function web(string $route, string $serverClass): Route
3232
// https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#listening-for-messages-from-the-server
3333
Router::get($route, fn (): \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response => response(status: 405));
3434

35-
$route = Router::post($route, fn (): mixed => $this->startServer(
35+
$route = Router::post($route, fn (): mixed => static::startServer(
3636
$serverClass,
3737
fn (): HttpTransport => new HttpTransport(
3838
$request = request(),
@@ -56,12 +56,9 @@ public function web(string $route, string $serverClass): Route
5656
*/
5757
public function local(string $handle, string $serverClass): void
5858
{
59-
$this->localServers[$handle] = fn (): mixed => $this->startServer(
60-
$serverClass,
61-
fn (): StdioTransport => new StdioTransport(
62-
Str::uuid()->toString(),
63-
)
64-
);
59+
$this->localServers[$handle] = fn (): mixed => static::startServer($serverClass, fn (): StdioTransport => new StdioTransport(
60+
Str::uuid()->toString(),
61+
));
6562
}
6663

6764
public function getLocalServer(string $handle): ?callable
@@ -154,7 +151,7 @@ protected function maybeAddMcpScope(): array
154151
* @param class-string<Server> $serverClass
155152
* @param callable(): Transport $transportFactory
156153
*/
157-
protected function startServer(string $serverClass, callable $transportFactory): mixed
154+
protected static function startServer(string $serverClass, callable $transportFactory): mixed
158155
{
159156
$transport = $transportFactory();
160157

0 commit comments

Comments
 (0)