modelcontextprotocol / modelcontextprotocol/java-sdk
Streamable Stateless server should support upgrade to SSE response
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 3.7k
- Forks
- 1.1k
- Ø Merge
- 1 T. 15 Std.
- Gemergte PRs (30 T.)
- 9
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den Serverpfad nachzuverfolgen, der derzeit ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(jsonrpcResponse) zurückgibt. Suche anschließend nach der Verarbeitung einer eingehenden CallToolRequest. Lege anhand des Issues das SSE-Upgrade, die Fortschrittsbenachrichtigungen, die abschließende CallToolResponse und das Schließen des Streams fest, und prüfe, ob vorhandene Server-Response-Tests diese Sequenz abdecken.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api, backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100