Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mcp/streamable.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ type StreamableHTTPOptions struct {

// TODO: support session retention (?)

// jsonResponse is forwarded to StreamableServerTransport.jsonResponse.
jsonResponse bool
// JSONResponse is forwarded to StreamableServerTransport.jsonResponse.
JSONResponse bool
}

// NewStreamableHTTPHandler returns a new [StreamableHTTPHandler].
Expand Down Expand Up @@ -233,7 +233,7 @@ func (h *StreamableHTTPHandler) ServeHTTP(w http.ResponseWriter, req *http.Reque
transport = &StreamableServerTransport{
SessionID: sessionID,
Stateless: h.opts.Stateless,
jsonResponse: h.opts.jsonResponse,
jsonResponse: h.opts.JSONResponse,
}

// To support stateless mode, we initialize the session with a default
Expand Down Expand Up @@ -487,7 +487,7 @@ type stream struct {
// jsonResponse records whether this stream should respond with application/json
// instead of text/event-stream.
//
// See [StreamableServerTransportOptions.jsonResponse].
// See [StreamableServerTransportOptions.JSONResponse].
jsonResponse bool

// signal is a 1-buffered channel, owned by an incoming HTTP request, that signals
Expand Down
2 changes: 1 addition & 1 deletion mcp/streamable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestStreamableTransports(t *testing.T) {
// Start an httptest.Server with the StreamableHTTPHandler, wrapped in a
// cookie-checking middleware.
handler := NewStreamableHTTPHandler(func(req *http.Request) *Server { return server }, &StreamableHTTPOptions{
jsonResponse: useJSON,
JSONResponse: useJSON,
})

var (
Expand Down