modelcontextprotocol / modelcontextprotocol/kotlin-sdk
refactor: Unify workflow across server transports
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 1.5k
- Forks
- 248
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 23
Description
refactor: Unify workflow across server transports
Currently, there is duplication of workflow-management logic in server transports: atomic booleans for initialized/closed state, session management, etc
Similar to #517, but for server transports.
- Consider unifying the client/server TransportState enum.
- Consider moving more logic to
AbstractTransport
Todo
- Introduce AbstractServerTransport for handling common workflow logic, similar to AbstractClientTransport
- WebSocket transport hierarchy should be refactored
- Introduce transport state + state machine (FSM) for possible transitions
- [TBD]
- Profit
Definition of done
- Current integration tests pass. Exception types might be changed for unification.
- Unit test for edge cases, especially for the state machine
See #517
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 by comparing the existing server transport implementations with AbstractClientTransport, then review the WebSocket transport hierarchy and the related work in #517. Define the shared transport states and valid transitions, refactor the common workflow into an AbstractServerTransport, and verify that integration tests and new state-machine edge-case tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- networking
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100