-
Notifications
You must be signed in to change notification settings - Fork 204
Open
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
Describe the bug
null-value properties of JSONRPCResponse (like _meta of RequestResult) incorrectly serialize to null in the response JSON, instead of being omitted.
According to the Spec, null is not an allowed value. It allows either omitting the property or an object value.
The MCP server is unusable.
To Reproduce
Steps to reproduce the behavior:
- Connect to a
kotlin-sdkMCP server with Claude Code. - Connection fails.
Expected behavior
Connection succeeds.
Logs
From Claude Code's debug log:
[DEBUG] MCP server "<name>": Connection failed after 36ms: [
{
"code": "invalid_union",
"errors": [
[
{
"expected": "string",
"code": "invalid_type",
"path": [
"method"
],
"message": "Invalid input: expected string, received undefined"
},
{
"code": "unrecognized_keys",
"keys": [
"result"
],
"path": [],
"message": "Unrecognized key: \"result\""
}
],
[
{
"expected": "string",
"code": "invalid_type",
"path": [
"method"
],
"message": "Invalid input: expected string, received undefined"
},
{
"code": "unrecognized_keys",
"keys": [
"id",
"result"
],
"path": [],
"message": "Unrecognized keys: \"id\", \"result\""
}
],
[
{
"expected": "object",
"code": "invalid_type",
"path": [
"result",
"_meta"
],
"message": "Invalid input: expected object, received null"
}
],
[
{
"expected": "object",
"code": "invalid_type",
"path": [
"error"
],
"message": "Invalid input: expected object, received undefined"
},
{
"code": "unrecognized_keys",
"keys": [
"result"
],
"path": [],
"message": "Unrecognized key: \"result\""
}
]
],
"path": [],
"message": "Invalid input"
}
]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested