modelcontextprotocol / modelcontextprotocol/java-sdk
Current implementation of HttpServletStreamableServerTransportProvider or HttpServletSseServerTransportProvider needs strict stickyness
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 1.1k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 9
Description
Current implementations are holding mcp sessions into a in memory Map https://github.com/modelcontextprotocol/java-sdk/blob/713ee1add0e29d184224aabdf06d024ef30a2754/mcp/src/main/java/io/modelcontextprotocol/server/transport/HttpServletStreamableServerTransportProvider.java#L108
This make it mandatory to have strict stickyness "a la" browser" in a replicated/high availability environement which doesn't exist for agent (and we cannot rely on llm agents to implement this)
The feature could be
- first very simple option an option for HttpServletStreamableServerTransportProvider.Builder to have an option to provide the map (then users can use different tools to have some shared Map)
- create an interface to handle those sessions (with minimum operations such add, get. delete)
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 HttpServletStreamableServerTransportProvider.java around the in-memory session Map at line 108, then inspect HttpServletSseServerTransportProvider for the same session handling. Compare the proposed builder-provided Map and a session-management interface, and define which operations are required for replicated deployments without strict stickiness. Done means both servlet transports can use shared session state through a documented extension point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100