modelcontextprotocol / modelcontextprotocol/kotlin-sdk
type-unsafe cast in Protocol result deserialization
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 1.5k
- Forks
- 248
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 23
Description
Protocol.request() deserializes the result using content-based polymorphic deserialization (selectClientResultDeserializer / selectServerResultDeserializer), which picks a concrete type based on JSON structure. The result is then cast to the caller's expected type via as T.
This is particularly problematic for:
GetTaskPayloadResultGetTaskResult
related #566
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Protocol.request() and the selectClientResultDeserializer/selectServerResultDeserializer entry points named in the issue, then read related issue #566. Compare deserialization behavior for GetTaskPayloadResult and GetTaskResult; done means the result handling no longer relies on the reported unsafe cast and its expected behavior is covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100