modelcontextprotocol / modelcontextprotocol/java-sdk

Streamable Stateless server should support upgrade to SSE response

Open
#539 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature/stateless-sse-upgrade
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.