-
-
Notifications
You must be signed in to change notification settings - Fork 57
[MCP SDK] Add server capabilities toSymfony\AI\McpSdk\Server\RequestHandler\InitializeHandler
#305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
*/ | ||
public function jsonSerialize(): array | ||
{ | ||
return array_filter((array) $this, fn ($value) => null !== $value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look nice, ideally it would be better to use centralized solution in \Symfony\AI\McpSdk\Message\Response::jsonSerialize
.
Serializer with AbstractObjectNormalizer::SKIP_NULL_VALUES
would fit perfectly, but it's not in dependencies list.
Symfony\AI\McpSdk\Server\RequestHandler\InitializeHandler
enum ProtocolVersionEnum: string | ||
{ | ||
case V2024_11_05 = '2024-11-05'; | ||
case V2025_03_26 = '2025-03-26'; | ||
case V2025_06_18 = '2025-06-18'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum ProtocolVersionEnum: string | |
{ | |
case V2024_11_05 = '2024-11-05'; | |
case V2025_03_26 = '2025-03-26'; | |
case V2025_06_18 = '2025-06-18'; | |
} | |
enum ProtocolVersion: string | |
{ | |
case VERSION_2024_11_05 = '2024-11-05'; | |
case VERSION_2025_03_26 = '2025-03-26'; | |
case VERSION_2025_06_18 = '2025-06-18'; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed suffix
Added Server capabilities classes, Enum for protocol version, updated
InitializeHandler
.Added skip null values at JSON serialization.
Added
InitializeHandlerTest
.Updated docs and example.