Skip to content

Commit ef47133

Browse files
committed
Fix Issues
1 parent 9af4c4e commit ef47133

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

src/Server.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ abstract class Server
6666
'prompts' => [
6767
'listChanged' => false,
6868
],
69-
'logging' => [],
7069
];
7170

7271
/**

src/Server/Methods/Initialize.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Laravel\Mcp\Server\ServerContext;
1010
use Laravel\Mcp\Server\Transport\JsonRpcRequest;
1111
use Laravel\Mcp\Server\Transport\JsonRpcResponse;
12-
use stdClass;
1312

1413
class Initialize implements Method
1514
{
@@ -32,7 +31,7 @@ public function handle(JsonRpcRequest $request, ServerContext $context): JsonRpc
3231
$protocolVersion = $requestedVersion ?? $context->supportedProtocolVersions[0];
3332
$initResult = [
3433
'protocolVersion' => $protocolVersion,
35-
'capabilities' => $this->normalizeCapabilities($context->serverCapabilities),
34+
'capabilities' => $context->serverCapabilities,
3635
'serverInfo' => [
3736
'name' => $context->serverName,
3837
'version' => $context->serverVersion,
@@ -46,13 +45,4 @@ public function handle(JsonRpcRequest $request, ServerContext $context): JsonRpc
4645

4746
return JsonRpcResponse::result($request->id, $initResult);
4847
}
49-
50-
/**
51-
* @param array<string, array<string, bool>|stdClass|string> $capabilities
52-
* @return array<string, array<string, bool>|stdClass|string>
53-
*/
54-
protected function normalizeCapabilities(array $capabilities): array
55-
{
56-
return array_map(fn (array|stdClass|string $value) => $value === [] ? (object) [] : $value, $capabilities);
57-
}
5848
}

tests/Pest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ function parseJsonRpcMessagesFromSseStream(string $content): array
316316

317317
function parseJsonRpcMessagesFromStdout(string $output): array
318318
{
319+
$output = str_replace("\r\n", "\n", $output);
319320
$jsonMessages = array_filter(explode("\n", trim($output)));
320321

321322
$messages = [];

tests/Unit/ServerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
->and($capabilities['anotherFeature'])->toBeArray()
4646
->and($capabilities)->toHaveKey('tools')
4747
->and($capabilities)->toHaveKey('resources')
48-
->and($capabilities)->toHaveKey('prompts')
49-
->and($capabilities)->toHaveKey('logging');
48+
->and($capabilities)->toHaveKey('prompts');
5049

5150
});
5251

0 commit comments

Comments
 (0)