modelcontextprotocol / modelcontextprotocol/java-sdk
Streamable Stateless server should support upgrade to SSE response
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 1.1k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 9
Description
Expected Behavior
A server that is fully stateless and does not support long-lived connections can still take advantage of streaming in this design.
For example, to issue progress notifications during a tool call:
When the incoming POST request is a CallToolRequest, server indicates the response will be SSE
Server starts executing the tool
Server sends any number of ProgressNotifications over SSE while the tool is executing
When the tool execution completes, the server sends a CallToolResponse over SSE
Server closes the SSE stream
https://github.com/modelcontextprotocol/modelcontextprotocol/pull/206
Current Behavior
The current implementation can only return json
return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(jsonrpcResponse);
Context
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 tracing the server path that currently returns ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(jsonrpcResponse), then locate handling for an incoming CallToolRequest. Define the SSE upgrade, progress notifications, final CallToolResponse, and stream closure from the issue, and check whether existing server-response tests cover this sequence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100